KVM: arm64: Skip instruction after emulating write to TCR_EL1
PATCH 1/1 KVM: arm64: Skip instruction after emulating write to TCR_EL1
Whelp, this is embarrassing. Since commit 082fdfd13841 ("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.
--- arch/arm64/kvm/hyp/include/hyp/switch.h | 1 + 1 file changed, 1 insertion(+)
arch/arm64/kvm/hyp/include/hyp/switch.h +1 -0
@@ -457,6 +457,7 @@ static bool handle_ampere1_tcr(struct kvm_vcpu *vcpu)*/ val &= ~(TCR_HD |TCR_HA );write_sysreg_el1 (val,SYS_TCR ); +__kvm_skip_instr (vcpu);return true; }
base-commit: 01b94b0f3922039f7d3e0d1eeb33b8891746b65f
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Quoted 8 lines · Oliver Upton
Whelp, this is embarrassing. Since commit
082fdfd13841("KVM: arm64:
Prevent guests from enabling HA/HD on Ampere1") KVM traps writes toTCR_EL1on 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.
Quoted 5 lines
Do the right thing and skip the MSR instruction after emulating the write.
Fixes 082fdfd13841 ("KVM: arm64: Prevent guests from enabling HA/HD on Ampere1")Signed-off-by Oliver Upton <[email protected]>
Oh hum... I think it is high time for a new PR to Paolo!
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
Quoted 10 lines · Marc Zyngier
Quoted 8 lines · Oliver Upton
Whelp, this is embarrassing. Since commit
082fdfd13841("KVM: arm64:
Prevent guests from enabling HA/HD on Ampere1") KVM traps writes toTCR_EL1on 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.
Quoted 7 lines
Quoted 5 lines
Do the right thing and skip the MSR instruction after emulating the write.
Fixes 082fdfd13841 ("KVM: arm64: Prevent guests from enabling HA/HD on Ampere1")Signed-off-by Oliver Upton <[email protected]>Oh hum... I think it is high time for a new PR to Paolo!
Definitely, now let's sweep this mess under the rug :)
Quoted 1 line
Acked-by Marc Zyngier <[email protected]>
Appreciated!
Signature · 2 lines
Thanks, Oliver
Oliver Upton
AppliedQuoted 8 lines · Oliver Upton
Whelp, this is embarrassing. Since commit
082fdfd13841("KVM: arm64:
Prevent guests from enabling HA/HD on Ampere1") KVM traps writes toTCR_EL1on 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.[...]
Applied to kvmarm/fixes, thanks!
[1/1] KVM: arm64: Skip instruction after emulating write to TCR_EL1
https://git.kernel.org/kvmarm/kvmarm/c/74158a8cad79
--
Best,
Oliver