Message ID | F10A37DE-4F3B-4A18-BAB7-B95616516A2A@arm.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Xen Armv8-R booting protocol | expand |
On 15/04/2025 14:10, Luca Fancellu wrote: > Hi all, > > I’ve started this thread to talk about a possible Xen booting protocol when running on Armv8-R, > currently Xen uses the Linux boot protocol and some other requirements stated in docs/misc/arm/booting.txt. > > Unfortunately we don’t have anything already available for Armv8-R, the only implementation of a bootloader > is the boot-wrapper-aarch64 which keeps the MPU off, I/D cache off. > > So my proposal is to add additional requirements in our docs/misc/arm/booting.txt for the case where Xen is > started on Armv8-R, under "Firmware/bootloader requirements”. > > diff --git a/docs/misc/arm/booting.txt b/docs/misc/arm/booting.txt > index 21ae74837dcc..39f029153e38 100644 > --- a/docs/misc/arm/booting.txt > +++ b/docs/misc/arm/booting.txt > @@ -62,6 +62,14 @@ Xen relies on some settings the firmware has to configure in EL3 before starting > > * The bit SCR_EL3.HCE (resp. SCR.HCE for 32-bit ARM) must be set to 1. > > +When Xen runs on Armv8-R, the highest exception level is EL2 and the only > +available mode is secure, hence the above requirements needs to be adjusted to I think in Arm docs, this is called state, i.e. secure/non-secure state. Also, s/needs/need/ > +this case: > + > +* Xen must be entered in S EL2 mode. > + > +* Xen must be entered with MPU off and data cache disabled (SCTLR_EL2.M bit and > + SCTLR_EL2.C set to 0). > > [1] linux/Documentation/arm/booting.rst > Latest version: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arch/arm/booting.rst > > Please let me know your thoughts. I think we need to have a place for boot assumptions for Armv8-R, so this is a good start. MPU work is Experimental for now, so we can treat it as a living doc (MPU part) for now. ~Michal
On 15/04/2025 13:10, Luca Fancellu wrote: > Hi all, Hi Luca, > > I’ve started this thread to talk about a possible Xen booting protocol when running on Armv8-R, > currently Xen uses the Linux boot protocol and some other requirements stated in docs/misc/arm/booting.txt. > > Unfortunately we don’t have anything already available for Armv8-R, the only implementation of a bootloader > is the boot-wrapper-aarch64 which keeps the MPU off, I/D cache off. > > So my proposal is to add additional requirements in our docs/misc/arm/booting.txt for the case where Xen is > started on Armv8-R, under "Firmware/bootloader requirements”. This makes sense. > > diff --git a/docs/misc/arm/booting.txt b/docs/misc/arm/booting.txt > index 21ae74837dcc..39f029153e38 100644 > --- a/docs/misc/arm/booting.txt > +++ b/docs/misc/arm/booting.txt > @@ -62,6 +62,14 @@ Xen relies on some settings the firmware has to configure in EL3 before starting > > * The bit SCR_EL3.HCE (resp. SCR.HCE for 32-bit ARM) must be set to 1. > > +When Xen runs on Armv8-R, the highest exception level is EL2 and the only > +available mode is secure, hence the above requirements needs to be adjusted to > +this case: > + > +* Xen must be entered in S EL2 mode. Refer ARM DDI 0568A.c ID110520 A1.3.1 Armv8-R (AArch32) only supports a single Security state, Non-secure. I see that it differs from Armv8-R (AArch64) ARM DDI 0600A.d ID120821, A1.3 The PE is always in Secure state. Probably you can mention both. > + > +* Xen must be entered with MPU off and data cache disabled (SCTLR_EL2.M bit and > + SCTLR_EL2.C set to 0). > > [1] linux/Documentation/arm/booting.rst > Latest version: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arch/arm/booting.rst > > Please let me know your thoughts. A question, Do you know if u-boot (or any other bootloader) is supported on Armv8-R ? Because someone needs to pass the DTB address in r2/x0. - Ayan > > Cheers, > Luca >
Hi Ayan, > On 15 Apr 2025, at 14:06, Ayan Kumar Halder <ayankuma@amd.com> wrote: > > > On 15/04/2025 13:10, Luca Fancellu wrote: >> Hi all, > Hi Luca, >> >> I’ve started this thread to talk about a possible Xen booting protocol when running on Armv8-R, >> currently Xen uses the Linux boot protocol and some other requirements stated in docs/misc/arm/booting.txt. >> >> Unfortunately we don’t have anything already available for Armv8-R, the only implementation of a bootloader >> is the boot-wrapper-aarch64 which keeps the MPU off, I/D cache off. >> >> So my proposal is to add additional requirements in our docs/misc/arm/booting.txt for the case where Xen is >> started on Armv8-R, under "Firmware/bootloader requirements”. > This makes sense. >> >> diff --git a/docs/misc/arm/booting.txt b/docs/misc/arm/booting.txt >> index 21ae74837dcc..39f029153e38 100644 >> --- a/docs/misc/arm/booting.txt >> +++ b/docs/misc/arm/booting.txt >> @@ -62,6 +62,14 @@ Xen relies on some settings the firmware has to configure in EL3 before starting >> * The bit SCR_EL3.HCE (resp. SCR.HCE for 32-bit ARM) must be set to 1. >> +When Xen runs on Armv8-R, the highest exception level is EL2 and the only >> +available mode is secure, hence the above requirements needs to be adjusted to >> +this case: >> + >> +* Xen must be entered in S EL2 mode. > > Refer ARM DDI 0568A.c ID110520 A1.3.1 > > Armv8-R (AArch32) only supports a single Security state, Non-secure. > > I see that it differs from Armv8-R (AArch64) ARM DDI 0600A.d ID120821, A1.3 > > The PE is always in Secure state. > > Probably you can mention both. ok, then it should be S/NS EL2. > >> + >> +* Xen must be entered with MPU off and data cache disabled (SCTLR_EL2.M bit and >> + SCTLR_EL2.C set to 0). >> [1] linux/Documentation/arm/booting.rst >> Latest version: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arch/arm/booting.rst >> >> Please let me know your thoughts. > > A question, Do you know if u-boot (or any other bootloader) is supported on Armv8-R ? Because someone needs to pass the DTB address in r2/x0. As far as I know, no other boot loader is supported, we had patches for u-boot enabling MPU at EL2 but they were not merged. I’m currently building Xen with the device tree embedded. Cheers, Luca
diff --git a/docs/misc/arm/booting.txt b/docs/misc/arm/booting.txt index 21ae74837dcc..39f029153e38 100644 --- a/docs/misc/arm/booting.txt +++ b/docs/misc/arm/booting.txt @@ -62,6 +62,14 @@ Xen relies on some settings the firmware has to configure in EL3 before starting * The bit SCR_EL3.HCE (resp. SCR.HCE for 32-bit ARM) must be set to 1. +When Xen runs on Armv8-R, the highest exception level is EL2 and the only +available mode is secure, hence the above requirements needs to be adjusted to +this case: + +* Xen must be entered in S EL2 mode. + +* Xen must be entered with MPU off and data cache disabled (SCTLR_EL2.M bit and + SCTLR_EL2.C set to 0). [1] linux/Documentation/arm/booting.rst Latest version: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arch/arm/booting.rst