Skip to content

Commit 90ff386

Browse files
Fuad Tabbawinzkh
authored andcommitted
BACKPORT: FROMGIT: KVM: arm64: Handle AIDR_EL1 and REVIDR_EL1 in host for protected VMs
A guest kernel running as a protected VM will fail to boot because it attempts to access the AIDR_EL1 register. Since commit 17efc1acee62 ("arm64: Expose AIDR_EL1 via sysfs"), upstream kernels read this register during early boot. Similar to MIDR_EL1, which is handled by the host for protected VMs, let the host handle AIDR_EL1 as well as REVIDR_EL1. However, unlike MIDR_EL1, AIDR_EL1 and REVIDR_EL1 are trapped by HCR_EL2.TID1. Therefore, we need to explicitly mark them as handled by the host in hyp for protected VMs, since pKVM always sets TID1, because it still need to trap access to SMIDR_EL1. Bug: 435160610 (cherry picked from commit eaa43934b412f0381598e308b6a25d6c9a5dce2d https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fixes) Signed-off-by: Fuad Tabba <[email protected]> [tabba@ changed SYS_REVIDR_EL1 to HOST_HANDLED) Change-Id: If162571e53ea4f0d68376e887436e2acbe7c3d25
1 parent c093e24 commit 90ff386

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/kvm/hyp/nvhe/sys_regs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static const struct sys_reg_desc pvm_sys_reg_descs[] = {
355355
RAZ_WI(SYS_OSDLR_EL1),
356356

357357
/* Group 1 ID registers */
358-
RAZ_WI(SYS_REVIDR_EL1),
358+
HOST_HANDLED(SYS_REVIDR_EL1),
359359

360360
/* AArch64 mappings of the AArch32 ID registers */
361361
/* CRm=1 */
@@ -445,6 +445,7 @@ static const struct sys_reg_desc pvm_sys_reg_descs[] = {
445445

446446
HOST_HANDLED(SYS_CCSIDR_EL1),
447447
HOST_HANDLED(SYS_CLIDR_EL1),
448+
HOST_HANDLED(SYS_AIDR_EL1),
448449
HOST_HANDLED(SYS_CSSELR_EL1),
449450
HOST_HANDLED(SYS_CTR_EL0),
450451

0 commit comments

Comments
 (0)