diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2021-04-12 11:48:44 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-04-12 13:36:24 +1000 |
commit | 946cf44ac6ce61378ea02386d39394a06d502f28 (patch) | |
tree | d43d41283f20b0de4035430f554e81549423dbb7 /arch/powerpc/kvm/book3s_hv_nested.c | |
parent | da487a5d1bee6a30798a8db15986d3d028c8ac92 (diff) | |
download | linux-stable-946cf44ac6ce61378ea02386d39394a06d502f28.tar.gz linux-stable-946cf44ac6ce61378ea02386d39394a06d502f28.tar.bz2 linux-stable-946cf44ac6ce61378ea02386d39394a06d502f28.zip |
KVM: PPC: Book3S HV: Ensure MSR[ME] is always set in guest MSR
Rather than add the ME bit to the MSR at guest entry, make it clear
that the hypervisor does not allow the guest to clear the bit.
The ME set is kept in guest entry for now, but a future patch will
warn if it's not present.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Acked-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210412014845.1517916-12-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_nested.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_nested.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_nested.c b/arch/powerpc/kvm/book3s_hv_nested.c index d14fe32f167b..fb03085c902b 100644 --- a/arch/powerpc/kvm/book3s_hv_nested.c +++ b/arch/powerpc/kvm/book3s_hv_nested.c @@ -343,7 +343,9 @@ long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu) vcpu->arch.nested = l2; vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token; vcpu->arch.regs = l2_regs; - vcpu->arch.shregs.msr = vcpu->arch.regs.msr; + + /* Guest must always run with ME enabled. */ + vcpu->arch.shregs.msr = vcpu->arch.regs.msr | MSR_ME; sanitise_hv_regs(vcpu, &l2_hv); restore_hv_regs(vcpu, &l2_hv); |