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 17:49:50 +0100 Message-ID: <543C02AE.4050104@linaro.org> References: <1413214141-370-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xdioo-00035W-Qi for xen-devel@lists.xenproject.org; Mon, 13 Oct 2014 16:49:58 +0000 Received: by mail-wg0-f49.google.com with SMTP id x12so9045652wgg.8 for ; Mon, 13 Oct 2014 09:49:57 -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 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. Regards, -- Julien Grall