linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Michal Simek <michal.simek@xilinx.com>
Cc: "Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Michal Simek" <monstr@monstr.eu>,
	"yangbo lu" <yangbo.lu@nxp.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Alexandre Belloni" <alexandre.belloni@free-electrons.com>,
	"Baoyou Xie" <baoyou.xie@linaro.org>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Simon Horman" <horms+renesas@verge.net.au>
Subject: Re: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface
Date: Thu, 17 Aug 2017 23:11:45 +0200	[thread overview]
Message-ID: <CAK8P3a0+tMHHYtVsq77LdcH+3Sdse38md=Bn3Sjkg0LzKyTn9w@mail.gmail.com> (raw)
In-Reply-To: <5a53e449-b269-89da-9b69-e560132502fc@xilinx.com>

On Thu, Aug 17, 2017 at 12:48 PM, Michal Simek <michal.simek@xilinx.com> wrote:
> On 16.8.2017 17:05, Arnd Bergmann wrote:
>> On Wed, Aug 16, 2017 at 4:34 PM, Michal Simek <michal.simek@xilinx.com> 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.

> 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.

       Arnd

  reply	other threads:[~2017-08-17 21:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 13:45 [PATCH 0/3] arm64 xilinx zynqmp firmware interface Michal Simek
2017-08-04 13:45 ` [PATCH 1/3] dt: xilinx: zynqmp: Add bindings for PM firmware Michal Simek
2017-08-10 19:10   ` Rob Herring
2017-08-11 12:58     ` Michal Simek
2017-08-11 13:54       ` Edgar E. Iglesias
2017-08-14 13:47         ` Michal Simek
2017-08-14 14:03           ` Rob Herring
2017-08-14 14:35             ` Michal Simek
2017-08-04 13:45 ` [PATCH 2/3] arm64: zynqmp: dt: Add PM firmware node Michal Simek
2017-08-04 13:45 ` [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface Michal Simek
2017-08-14 15:06   ` Arnd Bergmann
2017-08-16 11:51     ` Michal Simek
2017-08-16 12:05       ` Michal Simek
2017-08-16 12:41       ` Arnd Bergmann
2017-08-16 14:00         ` Michal Simek
2017-08-16 14:34           ` Michal Simek
2017-08-16 15:05             ` Arnd Bergmann
2017-08-17 10:48               ` Michal Simek
2017-08-17 21:11                 ` Arnd Bergmann [this message]
2017-08-18 12:14                   ` Michal Simek
2017-08-05  4:23 ` [PATCH 0/3] arm64 xilinx zynqmp " Alexander Graf
2017-08-07  6:09   ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK8P3a0+tMHHYtVsq77LdcH+3Sdse38md=Bn3Sjkg0LzKyTn9w@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=afaerber@suse.de \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=baoyou.xie@linaro.org \
    --cc=geert+renesas@glider.be \
    --cc=horms+renesas@verge.net.au \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=nicolas.ferre@microchip.com \
    --cc=shawnguo@kernel.org \
    --cc=soren.brinkmann@xilinx.com \
    --cc=yangbo.lu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).