diff options
| author | Fuad Tabba <fuad.tabba@linux.dev> | 2026-08-27 19:59:37 +0100 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-09-03 13:03:23 +0000 |
| commit | 5445d64199626974269fcdf347769ad44b0bb53b (patch) | |
| tree | 6d70deab471b714b185a8d85e4f50dfa8e39a220 /scripts/Makefile.thinlto | |
| parent | 5541432e09dc2031978188f3e8a00b9fc78cf097 (diff) | |
| download | linux-5445d64199626974269fcdf347769ad44b0bb53b.tar.gz linux-5445d64199626974269fcdf347769ad44b0bb53b.zip | |
arm64: Don't read GMID_EL1 when MTE is disabled
__cpuinfo_store_cpu() gates the GMID_EL1 read on the raw
ID_AA64PFR1_EL1, so it reads the register even when the kernel has
disabled MTE (CONFIG_ARM64_MTE=n or arm64.nomte). KVM sets HCR_EL2.TID5
in that case, and pKVM injects an UNDEF the host cannot handle:
Internal error: Oops - Undefined instruction: 0000000002000000 [#1] SMP
pc : __cpuinfo_store_cpu+0xf4/0x264
Kernel panic - not syncing: Attempted to kill the idle task!
Only pKVM reaches it, and only after a CPU is offlined and brought back
online: its CPU_ON relay sets the host HCR before the CPU enters EL1,
while plain nVHE sets it at CPUHP_AP_KVM_ONLINE.
Gate the read on the CPU's own ID_AA64PFR1_EL1 with the command-line
override applied, and on CONFIG_ARM64_MTE, which no register reflects.
The boot CPU stores its registers before init_cpu_features() strips an
unsafe override, so clamp against the hardware value here too.
Fixes: f35abcbb8a084 ("KVM: arm64: Trap MTE access and discovery when MTE is disabled")
Cc: stable@vger.kernel.org
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
