From: Ian Campbell <Ian.Campbell@citrix.com>
To: Parth Dixit <parth.dixit@linaro.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
tim@xen.org, Christoffer Dall <christoffer.dall@linaro.org>,
Julien Grall <julien.grall@linaro.org>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: Fwd: [PATCH v5] xen/arm : emulation of arm's PSCI v0.2 standard
Date: Fri, 25 Jul 2014 09:54:15 +0100 [thread overview]
Message-ID: <1406278455.29480.93.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <CABy3MN=TU5HVTzgxnS4r7-ARzTQtu5ErTKoJbK=rYmPHTW94GQ@mail.gmail.com>
On Fri, 2014-07-25 at 12:40 +0530, Parth Dixit wrote:
> >
> > I notice that sometimes you have an else case setting
> > PSCI_INVALID_PARAMETERS and other times you don't. Is that just an
> > oversight or is there a reason why they should differ?
> It was done because rest of the functions were using default preloaded
> value with return type int32 , functions with else case are functions
> that have return type other than int32(uint32 or register_t) but as
> you have commented further if PSCI* result codes do not require
> casting, this will go away.
> To summarize i will remove the casting of result codes this will also
> do away the need of else statements in patchset v6.
Sounds good.
> >> +
> >> + if ( is_32bit_domain(d) )
> >> + {
> >> + regs->pc32 = entry_point;
> >> + regs->r0 = context_id;
> >> + }
> >> +#ifdef CONFIG_ARM_64
> >> + else
> >> + {
> >> + regs->pc = entry_point;
> >> + regs->x0 = context_id;
> >> + }
> >> +#endif
> >> + vcpu_block_unless_event_pending(v);
> >> + return PSCI_SUCCESS;
> >
> > This only seems to be handling the case where the requested power state
> > is power down and not the standby state.
> >
> > By my reading when bit 16 if the power_state argument is 0 (standby)
> > then entry_point and context_id are ignored and the PSCI call is
> > expected to return success to the place it was called from, not jump to
> > entry_point.
> >
> > If bit 16 is one you are supposed to return to entry_point with x0/r0
> > set to context_id, but because you return PSCI_SUCCESS that will get
> > written to x0/r0 by the generic handler clobbering your write of x0/r0
> > above. You should probably return the desired value (with an explanatory
> > comment)
> valid point, i am just wondering why kvm implementation ignored these values,
It's possible that I'm being overly picky in reading the spec.
My concern is that there isn't currently much in the way of reference
implementations of this thing to compare against for real world
behaviour. When such things turn up and behave differently to Xen (or
KVM for that matter), perhaps because they interpret the ambiguities in
the spec differently, and the spec is clarified we may end up having to
change. Which then runs the risk of regressions for existing guests etc.
> i will implement it in next patchset
Thanks.
> > The upper bits of power_state also describe an affinity level to put to
> > sleep, which you also don't handle AFAICT. Perhaps since we don't
> > actually have affinities > 0 what you've done is OK, what do you think?
> I think it is better to put a comment explicitly stating that we have
> ignored the value because affinities > 0 are not valid for xen or we
> can check for affinity and return if it is greater than zero.
> I think i'll go with check, will take care in next patchset
I'm not 100% what the spec allows/requires us to do here. I've asked
ARM. I suspect shutting down only the local core would be permissible.
Ian.
next prev parent reply other threads:[~2014-07-25 8:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 16:41 [PATCH v5] xen/arm : emulation of arm's PSCI v0.2 standard Parth Dixit
2014-07-24 14:06 ` Ian Campbell
[not found] ` <CABy3MNkuZ_S0YPHyPwXXdp_rGvJ2VrPmsTLW=k=CBqN4qXpmdA@mail.gmail.com>
2014-07-25 7:10 ` Fwd: " Parth Dixit
2014-07-25 8:54 ` Ian Campbell [this message]
2014-07-25 14:56 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406278455.29480.93.camel@dagon.hellion.org.uk \
--to=ian.campbell@citrix.com \
--cc=christoffer.dall@linaro.org \
--cc=julien.grall@linaro.org \
--cc=parth.dixit@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).