From mboxrd@z Thu Jan 1 00:00:00 1970 From: mark.rutland@arm.com (Mark Rutland) Date: Mon, 2 Nov 2015 14:03:13 +0000 Subject: [PATCH v6 1/6] arm/arm64: add smccc In-Reply-To: <20151102135633.GA17559@ermac> References: <1446106888-8983-1-git-send-email-jens.wiklander@linaro.org> <1446106888-8983-2-git-send-email-jens.wiklander@linaro.org> <20151102115119.GB29657@arm.com> <20151102135633.GA17559@ermac> Message-ID: <20151102140313.GG2684@leverpostej> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org > > > +/* > > > + * void smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2, > > > + * unsigned long a3, unsigned long a4, unsigned long a5, > > > + * unsigned long a6, unsigned long a7, struct smccc_res *res) > > > + */ > > > +ENTRY(smccc_smc) > > > + smc #0 > > > + ldr x4, [sp] > > > + stp x0, x1, [x4, #SMC_RES_X0_OFFS] > > > + stp x2, x3, [x4, #SMC_RES_X2_OFFS] > > > + ret > > > +ENDPROC(smccc_smc) > > > +/* > > > + * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2, > > > + * unsigned long a3, unsigned long a4, unsigned long a5, > > > + * unsigned long a6, unsigned long a7, struct smccc_res *res) > > > + */ > > > +ENTRY(smccc_hvc) > > > + hvc #0 > > > + ldr x4, [sp] > > > + stp x0, x1, [x4, #SMC_RES_X0_OFFS] > > > + stp x2, x3, [x4, #SMC_RES_X2_OFFS] > > > + ret > > > +ENDPROC(smccc_hvc) > > > +/** > > > + * struct smccc_res - Result from SMC/HVC call > > > + * @a0-a3 result values from registers 0 to 3 > > > + */ > > > +struct smccc_res { > > > + unsigned long a0; > > > + unsigned long a1; > > > + unsigned long a2; > > > + unsigned long a3; > > > +}; > > > > Are there any endianness considerations for this structure? > > No, I can't find anything in the ARM SMC Calling Convention document > indicating that. The calling conventions have no bearing on the structure, which is our invention. We stash register values (which don't have endianness) returned by the firmeware into the structure in the sequences above (which appear endian-clean to me). Thanks, Mark. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Rutland Subject: Re: [PATCH v6 1/6] arm/arm64: add smccc Date: Mon, 2 Nov 2015 14:03:13 +0000 Message-ID: <20151102140313.GG2684@leverpostej> References: <1446106888-8983-1-git-send-email-jens.wiklander@linaro.org> <1446106888-8983-2-git-send-email-jens.wiklander@linaro.org> <20151102115119.GB29657@arm.com> <20151102135633.GA17559@ermac> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20151102135633.GA17559@ermac> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Jens Wiklander Cc: Will Deacon , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Arnd Bergmann , Greg Kroah-Hartman , Kees Cook , valentin.manea-hv44wF8Li93QT0dZR+AlfA@public.gmane.org, jean-michel.delorme-qxv4g6HH51o@public.gmane.org, emmanuel.michel-qxv4g6HH51o@public.gmane.org, javier-5MUHepqpBA1BDgjK7y7TUQ@public.gmane.org, Jason Gunthorpe , Michal Simek , Rob Herring List-Id: devicetree@vger.kernel.org > > > +/* > > > + * void smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2, > > > + * unsigned long a3, unsigned long a4, unsigned long a5, > > > + * unsigned long a6, unsigned long a7, struct smccc_res *res) > > > + */ > > > +ENTRY(smccc_smc) > > > + smc #0 > > > + ldr x4, [sp] > > > + stp x0, x1, [x4, #SMC_RES_X0_OFFS] > > > + stp x2, x3, [x4, #SMC_RES_X2_OFFS] > > > + ret > > > +ENDPROC(smccc_smc) > > > +/* > > > + * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2, > > > + * unsigned long a3, unsigned long a4, unsigned long a5, > > > + * unsigned long a6, unsigned long a7, struct smccc_res *res) > > > + */ > > > +ENTRY(smccc_hvc) > > > + hvc #0 > > > + ldr x4, [sp] > > > + stp x0, x1, [x4, #SMC_RES_X0_OFFS] > > > + stp x2, x3, [x4, #SMC_RES_X2_OFFS] > > > + ret > > > +ENDPROC(smccc_hvc) > > > +/** > > > + * struct smccc_res - Result from SMC/HVC call > > > + * @a0-a3 result values from registers 0 to 3 > > > + */ > > > +struct smccc_res { > > > + unsigned long a0; > > > + unsigned long a1; > > > + unsigned long a2; > > > + unsigned long a3; > > > +}; > > > > Are there any endianness considerations for this structure? > > No, I can't find anything in the ARM SMC Calling Convention document > indicating that. The calling conventions have no bearing on the structure, which is our invention. We stash register values (which don't have endianness) returned by the firmeware into the structure in the sequences above (which appear endian-clean to me). Thanks, Mark. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753505AbbKBODx (ORCPT ); Mon, 2 Nov 2015 09:03:53 -0500 Received: from foss.arm.com ([217.140.101.70]:51132 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216AbbKBOD0 (ORCPT ); Mon, 2 Nov 2015 09:03:26 -0500 Date: Mon, 2 Nov 2015 14:03:13 +0000 From: Mark Rutland To: Jens Wiklander Cc: Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Kees Cook , valentin.manea@huawei.com, jean-michel.delorme@st.com, emmanuel.michel@st.com, javier@javigon.com, Jason Gunthorpe , Michal Simek , Rob Herring Subject: Re: [PATCH v6 1/6] arm/arm64: add smccc Message-ID: <20151102140313.GG2684@leverpostej> References: <1446106888-8983-1-git-send-email-jens.wiklander@linaro.org> <1446106888-8983-2-git-send-email-jens.wiklander@linaro.org> <20151102115119.GB29657@arm.com> <20151102135633.GA17559@ermac> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151102135633.GA17559@ermac> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > +/* > > > + * void smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2, > > > + * unsigned long a3, unsigned long a4, unsigned long a5, > > > + * unsigned long a6, unsigned long a7, struct smccc_res *res) > > > + */ > > > +ENTRY(smccc_smc) > > > + smc #0 > > > + ldr x4, [sp] > > > + stp x0, x1, [x4, #SMC_RES_X0_OFFS] > > > + stp x2, x3, [x4, #SMC_RES_X2_OFFS] > > > + ret > > > +ENDPROC(smccc_smc) > > > +/* > > > + * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2, > > > + * unsigned long a3, unsigned long a4, unsigned long a5, > > > + * unsigned long a6, unsigned long a7, struct smccc_res *res) > > > + */ > > > +ENTRY(smccc_hvc) > > > + hvc #0 > > > + ldr x4, [sp] > > > + stp x0, x1, [x4, #SMC_RES_X0_OFFS] > > > + stp x2, x3, [x4, #SMC_RES_X2_OFFS] > > > + ret > > > +ENDPROC(smccc_hvc) > > > +/** > > > + * struct smccc_res - Result from SMC/HVC call > > > + * @a0-a3 result values from registers 0 to 3 > > > + */ > > > +struct smccc_res { > > > + unsigned long a0; > > > + unsigned long a1; > > > + unsigned long a2; > > > + unsigned long a3; > > > +}; > > > > Are there any endianness considerations for this structure? > > No, I can't find anything in the ARM SMC Calling Convention document > indicating that. The calling conventions have no bearing on the structure, which is our invention. We stash register values (which don't have endianness) returned by the firmeware into the structure in the sequences above (which appear endian-clean to me). Thanks, Mark.