Skip to content

Commit 8cf4040

Browse files
Fuad Tabbawinzkh
authored andcommitted
ANDROID: KVM: arm64: Read REVIDR_EL1 and AIDR_EL1 for protected VMs
Access to REVIDR_EL1 and AIDR_EL1 is implementation defined. Revert the behavior of reading REVIDR_EL1 to RAZ/WI, and do the same for AIDR_EL1, instead of being handled by the host. In older kernels, handling by the host of accesses to REVIDR_EL1 and AIDR_EL1 is broken, since the sysreg configuration information wasn't being populated for them. This has been fixed upstream in commit 4cd48565b0e5 ("KVM: arm64: Set HCR_EL2.TID1 unconditionally"). However, that fix is rather invasive, and could potentially cause a change to the values existing protected guests would see for these register, since up until recently, these registers have either been handled as RAZ, or not exposed to protected guests to begin with. Fixes: 81d453debbb2 ("BACKPORT: FROMGIT: KVM: arm64: Handle AIDR_EL1 and REVIDR_EL1 in host for protected VMs") Bug: 446864228 Bug: 446746493 Change-Id: Iec63c748b0561ab58563b92cc8ea4c2950c31aef Signed-off-by: Fuad Tabba <[email protected]>
1 parent c5f0231 commit 8cf4040

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

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

358358
/* Group 1 ID registers */
359-
HOST_HANDLED(SYS_REVIDR_EL1),
359+
RAZ_WI(SYS_REVIDR_EL1),
360360

361361
/* AArch64 mappings of the AArch32 ID registers */
362362
/* CRm=1 */
@@ -446,7 +446,7 @@ static const struct sys_reg_desc pvm_sys_reg_descs[] = {
446446

447447
HOST_HANDLED(SYS_CCSIDR_EL1),
448448
HOST_HANDLED(SYS_CLIDR_EL1),
449-
HOST_HANDLED(SYS_AIDR_EL1),
449+
RAZ_WI(SYS_AIDR_EL1),
450450
HOST_HANDLED(SYS_CSSELR_EL1),
451451
HOST_HANDLED(SYS_CTR_EL0),
452452

0 commit comments

Comments
 (0)