[boot-wrapper v3 2/4] aarch64: Enable Armv8-R EL2 boot

Mark Rutland mark.rutland at arm.com
Thu Oct 17 02:30:03 PDT 2024


On Mon, Oct 14, 2024 at 07:25:04PM +0100, Luca Fancellu wrote:
> Hi Mark,
> 
> >> #define HCR_EL2_RES1 BIT(1)
> >> +#define HCR_EL2_APK_NOTRAP BIT(40)
> >> +#define HCR_EL2_API_NOTRAP BIT(41)
> >> +#define HCR_EL2_FIEN_NOTRAP BIT(47)
> >> +#define HCR_EL2_ENSCXT_NOTRAP BIT(53)
> >
> > These can drop the '_NOTRAP' suffix; that's only used on some of the
> > MDSCR definitions because it's an enumerated value for a field (which
> > the architecture doesn't name), whereas these should just be the
> > architected names as with their SCR_EL3 counterparts, i.e.
> >
> > #define HCR_EL2_APK BIT(40)
> > #define HCR_EL2_API BIT(41)
> > #define HCR_EL2_FIEN BIT(47)
> > #define HCR_EL2_EnSCXT BIT(53)
> >
> > That said, we don't set SCR_EL3.{FIEN,EnSCXT} today for A-class; and
> > Linux doesn't currently care -- is that something you're actually using
> > on R-class?
> 
> I see EnSCXT is set currently in TF-A:
> https://review.trustedfirmware.org/plugins/gitiles/TF-A/trusted-firmware-a/+/refs/heads/master/lib/el3_runtime/aarch64/context_mgmt.c#253
> 
> and FIEN as well provided that ENABLE_FEAT_RAS=1:
> https://review.trustedfirmware.org/plugins/gitiles/TF-A/trusted-firmware-a/+/refs/heads/master/lib/el3_runtime/aarch64/context_mgmt.c#408
> 
> Said so, I’ve done a run without disabling the trap for them and Linux is booting fine, so what do you
> prefer here?

Sorry for not being clear; please keep them for now, with the renaming
above.

For consistency we should update the A-class code to configure the
relevant EL3 controls, but I'm happy for that to happen later.

Mark.



More information about the linux-arm-kernel mailing list