From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 for 4.5] arm32: fix build after 063188f4b3 Date: Mon, 13 Oct 2014 18:05:06 +0100 Message-ID: <543C0642.2020002@linaro.org> References: <1413214141-370-1-git-send-email-julien.grall@linaro.org> <543C02AE.4050104@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xdj3c-0003VY-ER for xen-devel@lists.xenproject.org; Mon, 13 Oct 2014 17:05:16 +0000 Received: by mail-wg0-f44.google.com with SMTP id y10so9029962wgg.15 for ; Mon, 13 Oct 2014 10:05:13 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, Jan Beulich , tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 10/13/2014 06:01 PM, Stefano Stabellini wrote: > On Mon, 13 Oct 2014, Julien Grall wrote: >> Hi Stefano, >> >> On 10/13/2014 05:06 PM, Stefano Stabellini wrote: >>>> +int do_smc(register_t function_id, ...); >>> >>> I am not sure whether this is safe: the smc calling convention on arm64 >>> doesn't promise to save the x0-x17 registers. The smc calling convention >>> on arm32 only promises to save r4-r15. That means that after issuing an >>> smc call with just two arguments, you could still find r3 to be changed >>> afterwards. >>> I think you'll have to manually save/restore all the registers outside >>> the safety guarantees of the smc protocol. >> >> The calling convention specifies: >> - r0-r3 as argument/scratch register on ARM32 >> - x0-x17 as argument/temporary register on ARM64 >> >> So we don't need to save/restore them before/after calling the SMC function. > > I think you are right. I will resend a patch with Jan comments. -- Julien Grall