From: Ian Campbell Subject: Re: [PATCH v6] xen/arm : emulation of arm's PSCI v0.2 standard Date: Wed, 30 Jul 2014 14:25:18 +0100 Message-ID: <1406726718.10402.10.camel@kazak.uk.xensource.com> References: <1406317971-8479-1-git-send-email-parth.dixit@linaro.org> <1406718844.31718.0.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406718844.31718.0.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Parth Dixit Cc: xen-devel@lists.xen.org, julien.grall@linaro.org, tim@xen.org, christoffer.dall@linaro.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2014-07-30 at 12:14 +0100, Ian Campbell wrote: > > +register_t do_psci_0_2_cpu_suspend(uint32_t power_state, register_t entry_point, > > + register_t context_id) > > +{ > > + struct vcpu *v = current; > > + > > + /* affinity values are ignored in this implementation as > > + * at present xen does not supports affinity level greater > > + * than 0, for all affinity values passed we power down/ standby > > + * the current core */ > > + > > + vcpu_block_unless_event_pending(v); > > + > > + /* if power down is requested context_id must be returned in x0/r0 > > + * as the function return will be written in x0/r0 we return context_id > > + * instead os success value */ > > The spec isn't clear on this, but I don't think this can be correct. > > I expect the requirement is that you either return PSCI_SUCCESS to the > instruction after the smc or you return to entry_point with > x0==context_id. I don't think it makes sense to return after the smc > with the x0==context_id. This is implied by section 5.4.2 bullet #4 > which talks about handling PSCI return codes. > > I'm going to ask ARM for clarification, please stand by. ARM have confirmed. If you are returning to the instruction after the smc then you should return a PSCI error code in x0, not context_id. Ian.