]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
KVM: PPC: Book3S HV: Initialise vcpu MSR with MSR_ME
authorNicholas Piggin <npiggin@gmail.com>
Wed, 11 Aug 2021 16:00:35 +0000 (02:00 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 25 Aug 2021 06:37:17 +0000 (16:37 +1000)
It is possible to create a VCPU without setting the MSR before running
it, which results in a warning in kvmhv_vcpu_entry_p9() that MSR_ME is
not set. This is pretty harmless because the MSR_ME bit is added to
HSRR1 before HRFID to guest, and a normal qemu guest doesn't hit it.

Initialise the vcpu MSR with MSR_ME set.

Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210811160134.904987-2-npiggin@gmail.com
arch/powerpc/kvm/book3s_hv.c

index 085fb8ecbf6884f91a2a0473ce223cf8595bccfe..c402eb0276b0a37d31adc2fd5253016a9d5405cf 100644 (file)
@@ -2684,6 +2684,7 @@ static int kvmppc_core_vcpu_create_hv(struct kvm_vcpu *vcpu)
        spin_lock_init(&vcpu->arch.vpa_update_lock);
        spin_lock_init(&vcpu->arch.tbacct_lock);
        vcpu->arch.busy_preempt = TB_NIL;
+       vcpu->arch.shregs.msr = MSR_ME;
        vcpu->arch.intr_msr = MSR_SF | MSR_ME;
 
        /*