[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/30] hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel
From: |
Peter Maydell |
Subject: |
[PULL 03/30] hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel |
Date: |
Thu, 21 Sep 2023 18:36:53 +0100 |
From: Fabian Vogt <fvogt@suse.de>
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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 720f22531a6..24fa1690600 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -761,6 +761,10 @@ static void do_cpu_reset(void *opaque)
if (cpu_isar_feature(aa64_hcx, cpu)) {
env->cp15.scr_el3 |= SCR_HXEN;
}
+ if (cpu_isar_feature(aa64_fgt, cpu)) {
+ env->cp15.scr_el3 |= SCR_FGTEN;
+ }
+
/* AArch64 kernels never boot in secure mode */
assert(!info->secure_boot);
/* This hook is only supported for AArch32 currently:
--
2.34.1
- [PULL 00/30] target-arm queue, Peter Maydell, 2023/09/21
- [PULL 02/30] docs/devel/loads-stores: Fix git grep regexes, Peter Maydell, 2023/09/21
- [PULL 01/30] target/m68k: Add URL to semihosting spec, Peter Maydell, 2023/09/21
- [PULL 07/30] target/arm: Update AArch64 ID register field definitions, Peter Maydell, 2023/09/21
- [PULL 11/30] target/arm: Don't skip MTE checks for LDRT/STRT at EL0, Peter Maydell, 2023/09/21
- [PULL 09/30] target/arm: Implement FEAT_HBC, Peter Maydell, 2023/09/21
- [PULL 04/30] linux-user/elfload.c: Correct SME feature names reported in cpuinfo, Peter Maydell, 2023/09/21
- [PULL 03/30] hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel,
Peter Maydell <=
- [PULL 08/30] target/arm: Update user-mode ID reg mask values, Peter Maydell, 2023/09/21
- [PULL 10/30] target/arm: Remove unused allocation_tag_mem() argument, Peter Maydell, 2023/09/21
- [PULL 12/30] target/arm: Implement FEAT_MOPS enable bits, Peter Maydell, 2023/09/21
- [PULL 14/30] target/arm: Define syndrome function for MOPS exceptions, Peter Maydell, 2023/09/21
- [PULL 17/30] target/arm: Implement the SET* instructions, Peter Maydell, 2023/09/21
- [PULL 05/30] linux-user/elfload.c: Add missing arm and arm64 hwcap values, Peter Maydell, 2023/09/21
- [PULL 19/30] target/arm: Implement the SETG* instructions, Peter Maydell, 2023/09/21
- [PULL 20/30] target/arm: Implement MTE tag-checking functions for FEAT_MOPS copies, Peter Maydell, 2023/09/21
- [PULL 16/30] target/arm: Implement MTE tag-checking functions for FEAT_MOPS, Peter Maydell, 2023/09/21
- [PULL 13/30] target/arm: Pass unpriv bool to get_a64_user_mem_index(), Peter Maydell, 2023/09/21