Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490060 > unrolled thread
| Started by | Stuart Yoder <stuart.yoder@nxp.com> |
|---|---|
| First post | 2016-09-23 15:20 +0200 |
| Last post | 2016-09-23 21:40 +0200 |
| Articles | 12 — 6 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
RE: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Stuart Yoder <stuart.yoder@nxp.com> - 2016-09-23 15:20 +0200
Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Robin Murphy <robin.murphy@arm.com> - 2016-09-23 15:20 +0200
Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Rob Herring <robh@kernel.org> - 2016-09-23 15:30 +0200
Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Sudeep Holla <sudeep.holla@arm.com> - 2016-09-23 15:50 +0200
Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Robin Murphy <robin.murphy@arm.com> - 2016-09-23 16:30 +0200
Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Arnd Bergmann <arnd@arndb.de> - 2016-09-23 16:50 +0200
Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Robin Murphy <robin.murphy@arm.com> - 2016-09-23 17:20 +0200
Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Arnd Bergmann <arnd@arndb.de> - 2016-09-23 18:00 +0200
Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Arnd Bergmann <arnd@arndb.de> - 2016-09-23 20:30 +0200
RE: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Jason Jin <jason.jin@nxp.com> - 2016-09-26 23:30 +0200
RE: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Stuart Yoder <stuart.yoder@nxp.com> - 2016-09-23 21:50 +0200
RE: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms Stuart Yoder <stuart.yoder@nxp.com> - 2016-09-23 21:40 +0200
| From | Stuart Yoder <stuart.yoder@nxp.com> |
|---|---|
| Date | 2016-09-23 15:20 +0200 |
| Subject | RE: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms |
| Message-ID | <skyyt-47t-7@gated-at.bofh.it> |
> -----Original Message----- > From: Robin Murphy [mailto:robin.murphy@arm.com] > Sent: Friday, September 23, 2016 7:17 AM > To: Alison Wang <b18965@freescale.com>; shawnguo@kernel.org; kernel@pengutronix.de; Fabio Estevam > Estevam <fabio.estevam@nxp.com>; linux@armlinux.org.uk; linux-arm-kernel@lists.infradead.org; linux- > kernel@vger.kernel.org; Scott Wood <scott.wood@nxp.com>; Stuart Yoder <stuart.yoder@nxp.com>; Leo Li > <leoyang.li@nxp.com> > Cc: Jason Jin <jason.jin@nxp.com> > Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms > > Hi Alison, > > On 23/09/16 03:19, Alison Wang wrote: > > The ARMv8 architecture supports: > > 1. 64-bit execution state, AArch64. > > 2. 32-bit execution state, AArch32, that is compatible with previous > > versions of the ARM architecture. > > > > LayerScape platforms are compliant with ARMv8 architecture. This patch > > is to support running 32-bit Linux kernel for LayerScape platforms. > > > > Verified on LayerScape LS1043ARDB, LS1012ARDB, LS1046ARDB boards. > > > > Signed-off-by: Ebony Zhu <ebony.zhu@nxp.com> > > Signed-off-by: Alison Wang <alison.wang@nxp.com> > > --- > > arch/arm/Kconfig | 9 +++++++++ > > arch/arm/mach-imx/Kconfig | 14 ++++++++++++++ > > arch/arm/mach-imx/Makefile | 4 +++- > > arch/arm/mach-imx/mach-layerscape.c | 23 +++++++++++++++++++++++ > > 4 files changed, 49 insertions(+), 1 deletion(-) > > create mode 100644 arch/arm/mach-imx/mach-layerscape.c > > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > > index f0c8068..e8d470e 100644 > > --- a/arch/arm/Kconfig > > +++ b/arch/arm/Kconfig > > @@ -294,6 +294,15 @@ config PGTABLE_LEVELS > > default 3 if ARM_LPAE > > default 2 > > > > +config ARCH_AARCH32_ES_SUPPORT > > + def_bool n > > + help > > + The ARMv8 architecture supports 64-bit execution state, AArch64 > > + and 32-bit execution state, AArch32, that is compatible with > > + previous versions of the ARM architecture. > > + > > + Enable AArch32 execution state support for ARMv8 architecture. > > What's this supposed to do, exactly? I've been running 32-bit kernels on > my Juno with very little issue (beyond a couple of DT tweaks, and some > firmware hacks with a corresponding bit of A64 assembly tacked on the > front of the zImage to switch into AArch32 state). Which arch/arm/mach-* platform are you using for Juno? Thanks, Stuart
[toc] | [next] | [standalone]
| From | Robin Murphy <robin.murphy@arm.com> |
|---|---|
| Date | 2016-09-23 15:20 +0200 |
| Message-ID | <skyyt-47t-13@gated-at.bofh.it> |
| In reply to | #1490060 |
On 23/09/16 14:13, Stuart Yoder wrote: > > >> -----Original Message----- >> From: Robin Murphy [mailto:robin.murphy@arm.com] >> Sent: Friday, September 23, 2016 7:17 AM >> To: Alison Wang <b18965@freescale.com>; shawnguo@kernel.org; kernel@pengutronix.de; Fabio Estevam >> Estevam <fabio.estevam@nxp.com>; linux@armlinux.org.uk; linux-arm-kernel@lists.infradead.org; linux- >> kernel@vger.kernel.org; Scott Wood <scott.wood@nxp.com>; Stuart Yoder <stuart.yoder@nxp.com>; Leo Li >> <leoyang.li@nxp.com> >> Cc: Jason Jin <jason.jin@nxp.com> >> Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms >> >> Hi Alison, >> >> On 23/09/16 03:19, Alison Wang wrote: >>> The ARMv8 architecture supports: >>> 1. 64-bit execution state, AArch64. >>> 2. 32-bit execution state, AArch32, that is compatible with previous >>> versions of the ARM architecture. >>> >>> LayerScape platforms are compliant with ARMv8 architecture. This patch >>> is to support running 32-bit Linux kernel for LayerScape platforms. >>> >>> Verified on LayerScape LS1043ARDB, LS1012ARDB, LS1046ARDB boards. >>> >>> Signed-off-by: Ebony Zhu <ebony.zhu@nxp.com> >>> Signed-off-by: Alison Wang <alison.wang@nxp.com> >>> --- >>> arch/arm/Kconfig | 9 +++++++++ >>> arch/arm/mach-imx/Kconfig | 14 ++++++++++++++ >>> arch/arm/mach-imx/Makefile | 4 +++- >>> arch/arm/mach-imx/mach-layerscape.c | 23 +++++++++++++++++++++++ >>> 4 files changed, 49 insertions(+), 1 deletion(-) >>> create mode 100644 arch/arm/mach-imx/mach-layerscape.c >>> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig >>> index f0c8068..e8d470e 100644 >>> --- a/arch/arm/Kconfig >>> +++ b/arch/arm/Kconfig >>> @@ -294,6 +294,15 @@ config PGTABLE_LEVELS >>> default 3 if ARM_LPAE >>> default 2 >>> >>> +config ARCH_AARCH32_ES_SUPPORT >>> + def_bool n >>> + help >>> + The ARMv8 architecture supports 64-bit execution state, AArch64 >>> + and 32-bit execution state, AArch32, that is compatible with >>> + previous versions of the ARM architecture. >>> + >>> + Enable AArch32 execution state support for ARMv8 architecture. >> >> What's this supposed to do, exactly? I've been running 32-bit kernels on >> my Juno with very little issue (beyond a couple of DT tweaks, and some >> firmware hacks with a corresponding bit of A64 assembly tacked on the >> front of the zImage to switch into AArch32 state). > > Which arch/arm/mach-* platform are you using for Juno? I don't even know! :) I just start with a multi_v7_defconfig plus a few extra bits (LPAE, KVM, sil24, sky2, etc.) and it works. I guess it's the combination of mach-vexpress and mach-virt. Robin. > > Thanks, > Stuart >
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2016-09-23 15:30 +0200 |
| Subject | Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms |
| Message-ID | <skyIa-4aO-25@gated-at.bofh.it> |
| In reply to | #1490061 |
On Fri, Sep 23, 2016 at 8:18 AM, Robin Murphy <robin.murphy@arm.com> wrote: > On 23/09/16 14:13, Stuart Yoder wrote: >> >> >>> -----Original Message----- >>> From: Robin Murphy [mailto:robin.murphy@arm.com] >>> Sent: Friday, September 23, 2016 7:17 AM >>> To: Alison Wang <b18965@freescale.com>; shawnguo@kernel.org; kernel@pengutronix.de; Fabio Estevam >>> Estevam <fabio.estevam@nxp.com>; linux@armlinux.org.uk; linux-arm-kernel@lists.infradead.org; linux- >>> kernel@vger.kernel.org; Scott Wood <scott.wood@nxp.com>; Stuart Yoder <stuart.yoder@nxp.com>; Leo Li >>> <leoyang.li@nxp.com> >>> Cc: Jason Jin <jason.jin@nxp.com> >>> Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms >>> >>> Hi Alison, >>> >>> On 23/09/16 03:19, Alison Wang wrote: >>>> The ARMv8 architecture supports: >>>> 1. 64-bit execution state, AArch64. >>>> 2. 32-bit execution state, AArch32, that is compatible with previous >>>> versions of the ARM architecture. >>>> >>>> LayerScape platforms are compliant with ARMv8 architecture. This patch >>>> is to support running 32-bit Linux kernel for LayerScape platforms. >>>> >>>> Verified on LayerScape LS1043ARDB, LS1012ARDB, LS1046ARDB boards. >>>> >>>> Signed-off-by: Ebony Zhu <ebony.zhu@nxp.com> >>>> Signed-off-by: Alison Wang <alison.wang@nxp.com> >>>> --- >>>> arch/arm/Kconfig | 9 +++++++++ >>>> arch/arm/mach-imx/Kconfig | 14 ++++++++++++++ >>>> arch/arm/mach-imx/Makefile | 4 +++- >>>> arch/arm/mach-imx/mach-layerscape.c | 23 +++++++++++++++++++++++ >>>> 4 files changed, 49 insertions(+), 1 deletion(-) >>>> create mode 100644 arch/arm/mach-imx/mach-layerscape.c >>>> >>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig >>>> index f0c8068..e8d470e 100644 >>>> --- a/arch/arm/Kconfig >>>> +++ b/arch/arm/Kconfig >>>> @@ -294,6 +294,15 @@ config PGTABLE_LEVELS >>>> default 3 if ARM_LPAE >>>> default 2 >>>> >>>> +config ARCH_AARCH32_ES_SUPPORT >>>> + def_bool n >>>> + help >>>> + The ARMv8 architecture supports 64-bit execution state, AArch64 >>>> + and 32-bit execution state, AArch32, that is compatible with >>>> + previous versions of the ARM architecture. >>>> + >>>> + Enable AArch32 execution state support for ARMv8 architecture. >>> >>> What's this supposed to do, exactly? I've been running 32-bit kernels on >>> my Juno with very little issue (beyond a couple of DT tweaks, and some >>> firmware hacks with a corresponding bit of A64 assembly tacked on the >>> front of the zImage to switch into AArch32 state). >> >> Which arch/arm/mach-* platform are you using for Juno? > > I don't even know! :) I just start with a multi_v7_defconfig plus a few > extra bits (LPAE, KVM, sil24, sky2, etc.) and it works. I guess it's the > combination of mach-vexpress and mach-virt. I believe the answer is none. Enabling VExpress may enable other drivers, but obviously none of the code in mach-vexpress is needed since it is not used for 64-bit builds. Rob
[toc] | [prev] | [next] | [standalone]
| From | Sudeep Holla <sudeep.holla@arm.com> |
|---|---|
| Date | 2016-09-23 15:50 +0200 |
| Message-ID | <skz1w-4hK-39@gated-at.bofh.it> |
| In reply to | #1490061 |
On 23/09/16 14:18, Robin Murphy wrote: > On 23/09/16 14:13, Stuart Yoder wrote: >> >> [...] >> >> Which arch/arm/mach-* platform are you using for Juno? > > I don't even know! :) I just start with a multi_v7_defconfig plus a few > extra bits (LPAE, KVM, sil24, sky2, etc.) and it works. I guess it's the > combination of mach-vexpress and mach-virt. > It should be matching "arm,vexpress" and just using mach-vexpress/v2m.c as it's present as compatible in Juno DT but nothing else there. mach-virt was deleted and we just have "Generic DT based system" in arch/arm/kernel/devtree.c which IIUC doesn't require any compatible in the DT. So dropping "arm,vexpress" will make it use "Generic DT based system" I believe. -- Regards, Sudeep
[toc] | [prev] | [next] | [standalone]
| From | Robin Murphy <robin.murphy@arm.com> |
|---|---|
| Date | 2016-09-23 16:30 +0200 |
| Message-ID | <skzEe-4NF-15@gated-at.bofh.it> |
| In reply to | #1490061 |
On 23/09/16 15:01, Stuart Yoder wrote: > > >> -----Original Message----- >> From: Robin Murphy [mailto:robin.murphy@arm.com] >> Sent: Friday, September 23, 2016 8:19 AM >> To: Stuart Yoder <stuart.yoder@nxp.com>; Alison Wang <b18965@freescale.com>; shawnguo@kernel.org; >> kernel@pengutronix.de; Fabio Estevam Estevam <fabio.estevam@nxp.com>; linux@armlinux.org.uk; linux-arm- >> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Scott Wood <scott.wood@nxp.com>; Leo Li >> <leoyang.li@nxp.com> >> Cc: Jason Jin <jason.jin@nxp.com> >> Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms >> >> On 23/09/16 14:13, Stuart Yoder wrote: >>> >>> >>>> -----Original Message----- >>>> From: Robin Murphy [mailto:robin.murphy@arm.com] >>>> Sent: Friday, September 23, 2016 7:17 AM >>>> To: Alison Wang <b18965@freescale.com>; shawnguo@kernel.org; kernel@pengutronix.de; Fabio Estevam >>>> Estevam <fabio.estevam@nxp.com>; linux@armlinux.org.uk; linux-arm-kernel@lists.infradead.org; linux- >>>> kernel@vger.kernel.org; Scott Wood <scott.wood@nxp.com>; Stuart Yoder <stuart.yoder@nxp.com>; Leo Li >>>> <leoyang.li@nxp.com> >>>> Cc: Jason Jin <jason.jin@nxp.com> >>>> Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms >>>> >>>> Hi Alison, >>>> >>>> On 23/09/16 03:19, Alison Wang wrote: >>>>> The ARMv8 architecture supports: >>>>> 1. 64-bit execution state, AArch64. >>>>> 2. 32-bit execution state, AArch32, that is compatible with previous >>>>> versions of the ARM architecture. >>>>> >>>>> LayerScape platforms are compliant with ARMv8 architecture. This patch >>>>> is to support running 32-bit Linux kernel for LayerScape platforms. >>>>> >>>>> Verified on LayerScape LS1043ARDB, LS1012ARDB, LS1046ARDB boards. >>>>> >>>>> Signed-off-by: Ebony Zhu <ebony.zhu@nxp.com> >>>>> Signed-off-by: Alison Wang <alison.wang@nxp.com> >>>>> --- >>>>> arch/arm/Kconfig | 9 +++++++++ >>>>> arch/arm/mach-imx/Kconfig | 14 ++++++++++++++ >>>>> arch/arm/mach-imx/Makefile | 4 +++- >>>>> arch/arm/mach-imx/mach-layerscape.c | 23 +++++++++++++++++++++++ >>>>> 4 files changed, 49 insertions(+), 1 deletion(-) >>>>> create mode 100644 arch/arm/mach-imx/mach-layerscape.c >>>>> >>>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig >>>>> index f0c8068..e8d470e 100644 >>>>> --- a/arch/arm/Kconfig >>>>> +++ b/arch/arm/Kconfig >>>>> @@ -294,6 +294,15 @@ config PGTABLE_LEVELS >>>>> default 3 if ARM_LPAE >>>>> default 2 >>>>> >>>>> +config ARCH_AARCH32_ES_SUPPORT >>>>> + def_bool n >>>>> + help >>>>> + The ARMv8 architecture supports 64-bit execution state, AArch64 >>>>> + and 32-bit execution state, AArch32, that is compatible with >>>>> + previous versions of the ARM architecture. >>>>> + >>>>> + Enable AArch32 execution state support for ARMv8 architecture. >>>> >>>> What's this supposed to do, exactly? I've been running 32-bit kernels on >>>> my Juno with very little issue (beyond a couple of DT tweaks, and some >>>> firmware hacks with a corresponding bit of A64 assembly tacked on the >>>> front of the zImage to switch into AArch32 state). >>> >>> Which arch/arm/mach-* platform are you using for Juno? >> >> I don't even know! :) I just start with a multi_v7_defconfig plus a few >> extra bits (LPAE, KVM, sil24, sky2, etc.) and it works. I guess it's the >> combination of mach-vexpress and mach-virt. > > Thanks. A question about the switch into aarch32 state... our assumption > was that the kernel starts at EL2. In this proof of concept we're doing the > switch to aarch32/EL2 in firmware. And what I'm being told is that the > firmware aarch64 EL2 code cannot switch to aarch32 EL2 without some > assistance from EL3 firmware. This is leading us to invent a new > SMC call to do this. > > Did you face this? Yes, the only way to enter in Hyp is to have the firmware twiddle SCR_EL3.RW (I simply stuck a disgusting hack directly in ATF's exception handler, which my dodgy 64-bit header then calls). Otherwise you can always simply run your own shim at EL2 to drive an AArch32 EL1 (it'll need to trap and translate subsequent SMC calls for e.g. PSCI). > If there is such a requirement, it's something begging for standardization. > Doesn't make sense for multiple divergent approaches for switching from > aarch64/EL2 to aarch32/EL2. Perhaps - I did briefly look into how hard it would be to write a proper SMC service handler to do this (since ATF does have a framework for such things), but concluded it would be more than 10 minutes' work and just cheated instead. It's certainly something which could be raised with the firmware folks. Robin. > > Thanks, > Stuart >
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-09-23 16:50 +0200 |
| Subject | Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms |
| Message-ID | <skzXz-53e-23@gated-at.bofh.it> |
| In reply to | #1490166 |
On Friday, September 23, 2016 3:24:12 PM CEST Robin Murphy wrote: > On 23/09/16 15:01, Stuart Yoder wrote: > Otherwise you can > always simply run your own shim at EL2 to drive an AArch32 EL1 (it'll > need to trap and translate subsequent SMC calls for e.g. PSCI). > > > If there is such a requirement, it's something begging for standardization. > > Doesn't make sense for multiple divergent approaches for switching from > > aarch64/EL2 to aarch32/EL2. > > Perhaps - I did briefly look into how hard it would be to write a proper > SMC service handler to do this (since ATF does have a framework for such > things), but concluded it would be more than 10 minutes' work and just > cheated instead. It's certainly something which could be raised with the > firmware folks. If we end up allowing all arm64 platforms to be enabled in arch/arm, we could perhaps create a generic implementation that does both of those things, i.e. - Take the arm32 kernel Image or zImage file, wrap it inside of a binary that implements the arm64 boot protocol. - When that starts up, try to use the new PSCI call to jump into the arm32 kernel - If PSCI failed and we are running in EL2, implement the shim and start the arm32 kernel in EL1 mode Arnd
[toc] | [prev] | [next] | [standalone]
| From | Robin Murphy <robin.murphy@arm.com> |
|---|---|
| Date | 2016-09-23 17:20 +0200 |
| Message-ID | <skAqC-5wp-41@gated-at.bofh.it> |
| In reply to | #1490189 |
On 23/09/16 15:44, Arnd Bergmann wrote: > On Friday, September 23, 2016 3:24:12 PM CEST Robin Murphy wrote: >> On 23/09/16 15:01, Stuart Yoder wrote: >> Otherwise you can >> always simply run your own shim at EL2 to drive an AArch32 EL1 (it'll >> need to trap and translate subsequent SMC calls for e.g. PSCI). >> >>> If there is such a requirement, it's something begging for standardization. >>> Doesn't make sense for multiple divergent approaches for switching from >>> aarch64/EL2 to aarch32/EL2. >> >> Perhaps - I did briefly look into how hard it would be to write a proper >> SMC service handler to do this (since ATF does have a framework for such >> things), but concluded it would be more than 10 minutes' work and just >> cheated instead. It's certainly something which could be raised with the >> firmware folks. > > If we end up allowing all arm64 platforms to be enabled in arch/arm, > we could perhaps create a generic implementation that does both of > those things, i.e. > > - Take the arm32 kernel Image or zImage file, wrap it inside of a binary > that implements the arm64 boot protocol. > - When that starts up, try to use the new PSCI call to jump into > the arm32 kernel > - If PSCI failed and we are running in EL2, implement the shim > and start the arm32 kernel in EL1 mode Really, though, the firmware call thing is an incredibly niche use-case. Beyond development, the only real benefit of starting an AArch32 kernel in Hyp is that you can run AArch32 KVM guests, which you can do equally well (if not better) under an AArch64 kernel. The standalone EL2 shim probably has legs, though, if the one currently found in arch/arm64 is too heavyweight ;) My first version was essentially that, albeit implemented by a load of .inst directives in head.S. Robin. > > Arnd >
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-09-23 18:00 +0200 |
| Subject | Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms |
| Message-ID | <skB3j-5Jn-1@gated-at.bofh.it> |
| In reply to | #1490248 |
On Friday, September 23, 2016 4:13:30 PM CEST Robin Murphy wrote: > On 23/09/16 15:44, Arnd Bergmann wrote: > > On Friday, September 23, 2016 3:24:12 PM CEST Robin Murphy wrote: > >> On 23/09/16 15:01, Stuart Yoder wrote: > >> Otherwise you can > >> always simply run your own shim at EL2 to drive an AArch32 EL1 (it'll > >> need to trap and translate subsequent SMC calls for e.g. PSCI). > >> > >>> If there is such a requirement, it's something begging for standardization. > >>> Doesn't make sense for multiple divergent approaches for switching from > >>> aarch64/EL2 to aarch32/EL2. > >> > >> Perhaps - I did briefly look into how hard it would be to write a proper > >> SMC service handler to do this (since ATF does have a framework for such > >> things), but concluded it would be more than 10 minutes' work and just > >> cheated instead. It's certainly something which could be raised with the > >> firmware folks. > > > > If we end up allowing all arm64 platforms to be enabled in arch/arm, > > we could perhaps create a generic implementation that does both of > > those things, i.e. > > > > - Take the arm32 kernel Image or zImage file, wrap it inside of a binary > > that implements the arm64 boot protocol. > > - When that starts up, try to use the new PSCI call to jump into > > the arm32 kernel > > - If PSCI failed and we are running in EL2, implement the shim > > and start the arm32 kernel in EL1 mode > > Really, though, the firmware call thing is an incredibly niche use-case. > Beyond development, the only real benefit of starting an AArch32 kernel > in Hyp is that you can run AArch32 KVM guests, which you can do equally > well (if not better) under an AArch64 kernel. This was my question earlier in the thread, apparently Alison has another use case in mind, but I don't yet know what that is. If that use case is important enough, we could do it this way. The only use case I can think of at the moment is boot testing on kernelci.org, which could be used to check whether all the drivers work in 32-bit environments. Arnd
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-09-23 20:30 +0200 |
| Subject | Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms |
| Message-ID | <skDou-7lF-25@gated-at.bofh.it> |
| In reply to | #1490286 |
On Friday, September 23, 2016 4:09:29 PM CEST Stuart Yoder wrote: > > -----Original Message----- > > From: Arnd Bergmann [mailto:arnd@arndb.de] > > Sent: Friday, September 23, 2016 10:58 AM > > > Really, though, the firmware call thing is an incredibly niche use-case. > > > Beyond development, the only real benefit of starting an AArch32 kernel > > > in Hyp is that you can run AArch32 KVM guests, which you can do equally > > > well (if not better) under an AArch64 kernel. > > > > This was my question earlier in the thread, apparently Alison has > > another use case in mind, but I don't yet know what that is. If > > that use case is important enough, we could do it this way. > > > > The only use case I can think of at the moment is boot testing > > on kernelci.org, which could be used to check whether all the drivers > > work in 32-bit environments. > > The reason we want aarch32 kernel support is for specific customers that > have requirements for legacy 32-bit kernel drivers that function on ARMv7 > but for some reason are very problematic to port to a 64-bit kernel. So, > the way to ease the 64-bit transition is allow them to run an aarch32 kernel > and their driver on an ARMv8 SoC. I don't think we specifically care > whether the kernel starts at EL2 or EL1. Thanks for the explanation. Unfortunately I don't think that helps get this approach upstream, in particular I wouldn't want to add a platform specific hack just to help a third party not have to fix their out-of-tree drivers to be 64-bit clean. If your customer already has a chunk of downstream patches large enough to be problematic to rebuild for 64-bit, they should be able to also pick up these two patches, but of course what we really want is to get drivers upstream and fixed (presumably this would be an even larger task than just fixing them, so I don't set my hopes too high here). I'm still not opposed to making *all* 64-bit platforms available to 32-bit kernels for testing purposes though, and that would solve the customer problem too, as would the approach of encapsulating the kernel in hypervisor stub that implements the PSCI calls and using MACH_VIRT with the respective layerscape drivers enabled. Arnd
[toc] | [prev] | [next] | [standalone]
| From | Jason Jin <jason.jin@nxp.com> |
|---|---|
| Date | 2016-09-26 23:30 +0200 |
| Message-ID | <slLDk-A5-11@gated-at.bofh.it> |
| In reply to | #1490378 |
> Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape > platforms > > On Friday, September 23, 2016 4:09:29 PM CEST Stuart Yoder wrote: > > > -----Original Message----- > > > From: Arnd Bergmann [mailto:arnd@arndb.de] > > > Sent: Friday, September 23, 2016 10:58 AM > > > > > Really, though, the firmware call thing is an incredibly niche use-case. > > > > Beyond development, the only real benefit of starting an AArch32 > > > > kernel in Hyp is that you can run AArch32 KVM guests, which you > > > > can do equally well (if not better) under an AArch64 kernel. > > > > > > This was my question earlier in the thread, apparently Alison has > > > another use case in mind, but I don't yet know what that is. If that > > > use case is important enough, we could do it this way. > > > > > > The only use case I can think of at the moment is boot testing on > > > kernelci.org, which could be used to check whether all the drivers > > > work in 32-bit environments. > > > > The reason we want aarch32 kernel support is for specific customers > > that have requirements for legacy 32-bit kernel drivers that function > > on ARMv7 but for some reason are very problematic to port to a 64-bit > > kernel. So, the way to ease the 64-bit transition is allow them to run an > aarch32 kernel > > and their driver on an ARMv8 SoC. I don't think we specifically care > > whether the kernel starts at EL2 or EL1. > > Thanks for the explanation. Unfortunately I don't think that helps get this > approach upstream, in particular I wouldn't want to add a platform specific > hack just to help a third party not have to fix their out-of-tree drivers to be 64- > bit clean. > > If your customer already has a chunk of downstream patches large enough to > be problematic to rebuild for 64-bit, they should be able to also pick up these > two patches, but of course what we really want is to get drivers upstream and > fixed (presumably this would be an even larger task than just fixing them, so I > don't set my hopes too high here). > > I'm still not opposed to making *all* 64-bit platforms available to 32-bit kernels > for testing purposes though, and that would solve the customer problem too, > as would the approach of encapsulating the kernel in hypervisor stub that > implements the PSCI calls and using MACH_VIRT with the respective layerscape > drivers enabled. > [Jason] Thanks for all the comments regarding to the ARMv8 32bit kernel patches. I'd like to provide some comment from this thread. To run the 32bit kernel on ARMv8, we also provided some patches to u-boot. The same U-boot image will be used to boot up the 64bit and 32bit kernel. With u-boot patches, bootm will automatically identify the kernel image, if it's 32bit kernel image, u-boot will change the ES to AArch32 EL2 and boot up the 32bit kernel. So we do not need to wrap the 32bit image with 64bit bootup protocol. Our FW set the u-boot to EL2 and did not have the 'NEW' SMC call to switch the AArch64(EL2) to AArch32(EL2) at this moment, so this patch set did not rely on the FW and did not implement the PSCI for secondary core bootup. I agree with Robin that maybe it's not necessary to support the Hyp for ARMv8 AArch32, so we can boot up the 32bit kernel with EL1 directly. With this assumption, I think we can switch to FW and PSCI for SMP easily and drop the spin table patches. Thanks all for the suggestion. We'll try the "Generic DT based system" instead of introducing a new platform to support the 32bit kernel. And rely on the dtb built from ARM64 to bootup the system. Not sure at this moment if some minor update patches still needed for ARMv8. Jason > Arnd
[toc] | [prev] | [next] | [standalone]
| From | Stuart Yoder <stuart.yoder@nxp.com> |
|---|---|
| Date | 2016-09-23 21:50 +0200 |
| Message-ID | <skDou-7lF-27@gated-at.bofh.it> |
| In reply to | #1490286 |
> -----Original Message----- > From: Arnd Bergmann [mailto:arnd@arndb.de] > Sent: Friday, September 23, 2016 10:58 AM > To: Robin Murphy <robin.murphy@arm.com> > Cc: linux-arm-kernel@lists.infradead.org; Stuart Yoder <stuart.yoder@nxp.com>; Alison Wang > <b18965@freescale.com>; shawnguo@kernel.org; kernel@pengutronix.de; Fabio Estevam Estevam > <fabio.estevam@nxp.com>; linux@armlinux.org.uk; linux-kernel@vger.kernel.org; Scott Wood > <scott.wood@nxp.com>; Leo Li <leoyang.li@nxp.com>; Jason Jin <jason.jin@nxp.com> > Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms > > On Friday, September 23, 2016 4:13:30 PM CEST Robin Murphy wrote: > > On 23/09/16 15:44, Arnd Bergmann wrote: > > > On Friday, September 23, 2016 3:24:12 PM CEST Robin Murphy wrote: > > >> On 23/09/16 15:01, Stuart Yoder wrote: > > >> Otherwise you can > > >> always simply run your own shim at EL2 to drive an AArch32 EL1 (it'll > > >> need to trap and translate subsequent SMC calls for e.g. PSCI). > > >> > > >>> If there is such a requirement, it's something begging for standardization. > > >>> Doesn't make sense for multiple divergent approaches for switching from > > >>> aarch64/EL2 to aarch32/EL2. > > >> > > >> Perhaps - I did briefly look into how hard it would be to write a proper > > >> SMC service handler to do this (since ATF does have a framework for such > > >> things), but concluded it would be more than 10 minutes' work and just > > >> cheated instead. It's certainly something which could be raised with the > > >> firmware folks. > > > > > > If we end up allowing all arm64 platforms to be enabled in arch/arm, > > > we could perhaps create a generic implementation that does both of > > > those things, i.e. > > > > > > - Take the arm32 kernel Image or zImage file, wrap it inside of a binary > > > that implements the arm64 boot protocol. > > > - When that starts up, try to use the new PSCI call to jump into > > > the arm32 kernel > > > - If PSCI failed and we are running in EL2, implement the shim > > > and start the arm32 kernel in EL1 mode > > > > Really, though, the firmware call thing is an incredibly niche use-case. > > Beyond development, the only real benefit of starting an AArch32 kernel > > in Hyp is that you can run AArch32 KVM guests, which you can do equally > > well (if not better) under an AArch64 kernel. > > This was my question earlier in the thread, apparently Alison has > another use case in mind, but I don't yet know what that is. If > that use case is important enough, we could do it this way. > > The only use case I can think of at the moment is boot testing > on kernelci.org, which could be used to check whether all the drivers > work in 32-bit environments. The reason we want aarch32 kernel support is for specific customers that have requirements for legacy 32-bit kernel drivers that function on ARMv7 but for some reason are very problematic to port to a 64-bit kernel. So, the way to ease the 64-bit transition is allow them to run an aarch32 kernel and their driver on an ARMv8 SoC. I don't think we specifically care whether the kernel starts at EL2 or EL1. Stuart
[toc] | [prev] | [next] | [standalone]
| From | Stuart Yoder <stuart.yoder@nxp.com> |
|---|---|
| Date | 2016-09-23 21:40 +0200 |
| Message-ID | <skzEe-4NF-17@gated-at.bofh.it> |
| In reply to | #1490061 |
> -----Original Message----- > From: Robin Murphy [mailto:robin.murphy@arm.com] > Sent: Friday, September 23, 2016 8:19 AM > To: Stuart Yoder <stuart.yoder@nxp.com>; Alison Wang <b18965@freescale.com>; shawnguo@kernel.org; > kernel@pengutronix.de; Fabio Estevam Estevam <fabio.estevam@nxp.com>; linux@armlinux.org.uk; linux-arm- > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Scott Wood <scott.wood@nxp.com>; Leo Li > <leoyang.li@nxp.com> > Cc: Jason Jin <jason.jin@nxp.com> > Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms > > On 23/09/16 14:13, Stuart Yoder wrote: > > > > > >> -----Original Message----- > >> From: Robin Murphy [mailto:robin.murphy@arm.com] > >> Sent: Friday, September 23, 2016 7:17 AM > >> To: Alison Wang <b18965@freescale.com>; shawnguo@kernel.org; kernel@pengutronix.de; Fabio Estevam > >> Estevam <fabio.estevam@nxp.com>; linux@armlinux.org.uk; linux-arm-kernel@lists.infradead.org; linux- > >> kernel@vger.kernel.org; Scott Wood <scott.wood@nxp.com>; Stuart Yoder <stuart.yoder@nxp.com>; Leo Li > >> <leoyang.li@nxp.com> > >> Cc: Jason Jin <jason.jin@nxp.com> > >> Subject: Re: [PATCH 1/2] armv8: aarch32: Execute 32-bit Linux for LayerScape platforms > >> > >> Hi Alison, > >> > >> On 23/09/16 03:19, Alison Wang wrote: > >>> The ARMv8 architecture supports: > >>> 1. 64-bit execution state, AArch64. > >>> 2. 32-bit execution state, AArch32, that is compatible with previous > >>> versions of the ARM architecture. > >>> > >>> LayerScape platforms are compliant with ARMv8 architecture. This patch > >>> is to support running 32-bit Linux kernel for LayerScape platforms. > >>> > >>> Verified on LayerScape LS1043ARDB, LS1012ARDB, LS1046ARDB boards. > >>> > >>> Signed-off-by: Ebony Zhu <ebony.zhu@nxp.com> > >>> Signed-off-by: Alison Wang <alison.wang@nxp.com> > >>> --- > >>> arch/arm/Kconfig | 9 +++++++++ > >>> arch/arm/mach-imx/Kconfig | 14 ++++++++++++++ > >>> arch/arm/mach-imx/Makefile | 4 +++- > >>> arch/arm/mach-imx/mach-layerscape.c | 23 +++++++++++++++++++++++ > >>> 4 files changed, 49 insertions(+), 1 deletion(-) > >>> create mode 100644 arch/arm/mach-imx/mach-layerscape.c > >>> > >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > >>> index f0c8068..e8d470e 100644 > >>> --- a/arch/arm/Kconfig > >>> +++ b/arch/arm/Kconfig > >>> @@ -294,6 +294,15 @@ config PGTABLE_LEVELS > >>> default 3 if ARM_LPAE > >>> default 2 > >>> > >>> +config ARCH_AARCH32_ES_SUPPORT > >>> + def_bool n > >>> + help > >>> + The ARMv8 architecture supports 64-bit execution state, AArch64 > >>> + and 32-bit execution state, AArch32, that is compatible with > >>> + previous versions of the ARM architecture. > >>> + > >>> + Enable AArch32 execution state support for ARMv8 architecture. > >> > >> What's this supposed to do, exactly? I've been running 32-bit kernels on > >> my Juno with very little issue (beyond a couple of DT tweaks, and some > >> firmware hacks with a corresponding bit of A64 assembly tacked on the > >> front of the zImage to switch into AArch32 state). > > > > Which arch/arm/mach-* platform are you using for Juno? > > I don't even know! :) I just start with a multi_v7_defconfig plus a few > extra bits (LPAE, KVM, sil24, sky2, etc.) and it works. I guess it's the > combination of mach-vexpress and mach-virt. Thanks. A question about the switch into aarch32 state... our assumption was that the kernel starts at EL2. In this proof of concept we're doing the switch to aarch32/EL2 in firmware. And what I'm being told is that the firmware aarch64 EL2 code cannot switch to aarch32 EL2 without some assistance from EL3 firmware. This is leading us to invent a new SMC call to do this. Did you face this? If there is such a requirement, it's something begging for standardization. Doesn't make sense for multiple divergent approaches for switching from aarch64/EL2 to aarch32/EL2. Thanks, Stuart
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web