summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_hv_builtin.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2021-04-12 11:48:45 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2021-04-12 13:36:24 +1000
commit732f21a3053cf279eb6b85d19b7818a8f1dd2071 (patch)
tree5ecb631fe70e129c58af8986cafbb6d17acbe91c /arch/powerpc/kvm/book3s_hv_builtin.c
parent946cf44ac6ce61378ea02386d39394a06d502f28 (diff)
downloadlinux-732f21a3053cf279eb6b85d19b7818a8f1dd2071.tar.bz2
KVM: PPC: Book3S HV: Ensure MSR[HV] is always clear in guest MSR
Rather than clear the HV bit from the MSR at guest entry, make it clear that the hypervisor does not allow the guest to set the bit. The HV clear is kept in guest entry for now, but a future patch will warn if it is set. Signed-off-by: Nicholas Piggin <npiggin@gmail.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-13-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_builtin.c')
-rw-r--r--arch/powerpc/kvm/book3s_hv_builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c
index 41cb03d0bde4..7a0e33a9c980 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -662,8 +662,8 @@ static void kvmppc_end_cede(struct kvm_vcpu *vcpu)
void kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 msr)
{
- /* Guest must always run with ME enabled. */
- msr = msr | MSR_ME;
+ /* Guest must always run with ME enabled, HV disabled. */
+ msr = (msr | MSR_ME) & ~MSR_HV;
/*
* Check for illegal transactional state bit combination