[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] xen/arm : emulation of arm's PSCI v0.2 standard



On Tue, 2014-07-01 at 14:11 +0530, Parth Dixit wrote:
> Hi,
> 
> On 30 June 2014 16:41, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> > On Mon, 2014-06-30 at 16:36 +0530, Parth Dixit wrote:
> >> >>         TBH given the relatively small number of PSCI calls maybe just
> >> >>         switching
> >> >>         to a C switch() statement would be best.
> >> >> patchset v1 was based on switch case it was moved to if/else after
> >> >> review comments, should i change it back to switch case?
> >> >
> >> > Sorry for not getting to this for v1.
> >> >
> >> > v1 had a switch statement to lookup fn_index, which it then looked up
> >> > again in the op table. I think that approach was the worst of both
> >> > worlds.
> >> >
> >> > What I was suggesting was a switch statement which actually dispatched
> >> > the call to the appropriate handler directly, rather than having a
> >> > second indirection via a table.
> >> >
> >> > The main thing I don't like is macro hoops you are jumping through in
> >> > order to turn the spec mandated sparse function space into a compact one
> >> > suitable for placing in an array.
> >> >
> >> > Another viable alternative would be to have separate tables for PSCI 0.1
> >> > and PSCSI 0.2 32- and 64-bit and look through each in turn.
> >>
> >> Sure, let me try the two table approach.
> >
> > NB: Three tables (0.1, 0.2-32bit, 0.2-64bit), unless you are planning
> > something clever with multiple fn ids per table entry.
> As i am using common functions for 32bit as well as 64 bit two tables
> are sufficient 0.2, 64 bit table for 0.2 would be redundant.

Oh, because the per-funciton offsets from the 32- vs. 64-bit base are
all consistent. Yes I think that could work.

> On second thought's i can also use the current table with single mask
> something like
> psci_call = arm_psci_table[PSCI_OP_REG(regs) & VERSION_MASK].fn;
> what do you think? i'll wait for ur opinion

Are the 0.1 and 0.2 fn numbers not overlapping? I suppose you control
the 0.1 numbers so you could make it so if it isn't already.

You would also need to validate that PSCI_OP_REG(regs) & ~VERSION_MASK
was one of the acceptable base addresses.

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.