Skip to content

Commit 74158a8

Browse files
committed
KVM: arm64: Skip instruction after emulating write to TCR_EL1
Whelp, this is embarrassing. Since commit 082fdfd ("KVM: arm64: Prevent guests from enabling HA/HD on Ampere1") KVM traps writes to TCR_EL1 on AmpereOne to work around an erratum in the unadvertised HAFDBS implementation, preventing the guest from enabling the feature. Unfortunately, I failed virtualization 101 when working on that change, and forgot to advance PC after instruction emulation. Do the right thing and skip the MSR instruction after emulating the write. Fixes: 082fdfd ("KVM: arm64: Prevent guests from enabling HA/HD on Ampere1") Acked-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230728000824.3848025-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent 01b94b0 commit 74158a8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm64/kvm/hyp/include/hyp/switch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ static bool handle_ampere1_tcr(struct kvm_vcpu *vcpu)
457457
*/
458458
val &= ~(TCR_HD | TCR_HA);
459459
write_sysreg_el1(val, SYS_TCR);
460+
__kvm_skip_instr(vcpu);
460461
return true;
461462
}
462463

0 commit comments

Comments
 (0)