Re: [PATCH v2] ARM: qcom: Fix SCM interface for big-endian kernels
From: Stephen Boyd
Date: Thu Jan 22 2015 - 13:29:54 EST
On 01/22, Kumar Gala wrote:
>
> On Jan 21, 2015, at 1:21 PM, Stephen Boyd <sboyd@xxxxxxxxxxxxxx> wrote:
>
> > The secure environment only runs in little-endian mode, so any
> > buffers shared with the secure environment should have their
> > contents converted to little-endian. We also mark such elements
> > with __le32 to allow sparse to catch such problems.
> >
> > Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
> > ---
> >
> > Changes since v1:
> > * Rebased onto Kumar's qcom/soc branch
> >
> > drivers/soc/qcom/scm-boot.c | 8 ++++----
> > drivers/soc/qcom/scm.c | 30 ++++++++++++++++--------------
> > 2 files changed, 20 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/soc/qcom/scm-boot.c b/drivers/soc/qcom/scm-boot.c
> > index 1822b13bbc10..af16fcc8d5cb 100644
> > --- a/drivers/soc/qcom/scm-boot.c
> > +++ b/drivers/soc/qcom/scm-boot.c
> > @@ -27,12 +27,12 @@
> > int scm_set_boot_addr(u32 addr, int flags)
> > {
> > struct {
> > - unsigned int flags;
> > - phys_addr_t addr;
> > + __le32 flags;
> > + __le32 addr;
>
> How does this work? How can we go from phys_addr_t back to __le32 on LPAE or 64-bit systems?
>
I guess I missed updating this in the patch titled "Clarify boot
interface". In that patch we should have updated addr to be a u32
(or __le32 as is done here). From what I can tell by looking at
the codeaurora tree this is still 32 bits wide even on 64-bit
platforms.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/