OSDN Git Service

hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel
authorFabian Vogt <fvogt@suse.de>
Fri, 15 Sep 2023 14:36:59 +0000 (15:36 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 21 Sep 2023 13:45:57 +0000 (14:45 +0100)
commit32b214384e1e1472ddfa875196c57f6620172301
tree9342a1a244c1916b14c8e00df295043f33b1894d
parente8d684508efa5c438c89a351b601108a37d08698
hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel

Just like d7ef5e16a17c sets SCR_EL3.HXEn for FEAT_HCX, this commit
handles SCR_EL3.FGTEn for FEAT_FGT:

When we direct boot a kernel on a CPU which emulates EL3, we need to
set up the EL3 system registers as the Linux kernel documentation
specifies:
    https://www.kernel.org/doc/Documentation/arm64/booting.rst

> For CPUs with the Fine Grained Traps (FEAT_FGT) extension present:
> - If EL3 is present and the kernel is entered at EL2:
>   - SCR_EL3.FGTEn (bit 27) must be initialised to 0b1.

Cc: qemu-stable@nongnu.org
Signed-off-by: Fabian Vogt <fvogt@suse.de>
Message-id: 4831384.GXAFRqVoOG@linux-e202.suse.de
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/boot.c