From mboxrd@z Thu Jan 1 00:00:00 1970 From: michal.simek@xilinx.com (Michal Simek) Date: Fri, 18 Aug 2017 14:14:55 +0200 Subject: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface In-Reply-To: References: <98038734d73c604dee6ac0d34740d5bc2034e87d.1501854302.git.michal.simek@xilinx.com> <247a5660-6c53-ccc3-7b9f-bfd2a11f6f54@xilinx.com> <3809b6a0-1cb9-37af-a524-8bc1986268ec@xilinx.com> <5a53e449-b269-89da-9b69-e560132502fc@xilinx.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 17.8.2017 23:11, Arnd Bergmann wrote: > On Thu, Aug 17, 2017 at 12:48 PM, Michal Simek wrote: >> On 16.8.2017 17:05, Arnd Bergmann wrote: >>> On Wed, Aug 16, 2017 at 4:34 PM, Michal Simek wrote: >>> >>> Looks good, just make sure you also check with sparse (make C=1) >>> to ensure you have the right __le64/__le32 types everywhere. >> >> Are you aware about any doc where it is written that data should be >> passed as little endian? > > Looking at http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf > now, I think that the structure above is endian-neutral as the arguments > get passed in registers rather than memory. > > However, if you pass pointers to data structures in memory, those > data structures would have to be defined with __le32/__le64 types. ok. > >> I was playing with it a little bit and this means that these 2(3 with >> hvc) needs to be changed. >> >> asmlinkage void __arm_smccc_smc(__le64 a0, __le64 a1, __le64 a2, >> __le64 a3,__le64 a4, __le64 a5, __le64 a6, __le64 a7, >> struct arm_smccc_res *res, struct arm_smccc_quirk *quirk); >> >> struct arm_smccc_res { >> - unsigned long a0; >> - unsigned long a1; >> - unsigned long a2; >> - unsigned long a3; >> + __le64 a0; >> + __le64 a1; >> + __le64 a2; >> + __le64 a3; >> }; > > This is clearly wrong on 32-bit machines, I think this is intentionally > defined as 'unsigned long' to have register sized arguments. Yep, I know. Let me integrate that changes which Marc wanted and will send next version. Thanks, Michal