Skip to content

Commit 63ccae7

Browse files
iamjpnmpe
authored andcommitted
KVM: PPC: Book3S HV nestedv2: Do not check msr on hcalls
The check for a hcall coming from userspace is done for KVM-PR. This is not supported for nestedv2 and the L0 will directly inject the necessary exception to the L2 if userspace performs a hcall. Avoid checking the MSR and thus avoid a H_GUEST_GET_STATE hcall in the L1. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231201132618.555031-4-vaibhav@linux.ibm.com
1 parent e0d4acb commit 63ccae7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/powerpc/kvm/book3s_hv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
16881688
{
16891689
int i;
16901690

1691-
if (unlikely(__kvmppc_get_msr_hv(vcpu) & MSR_PR)) {
1691+
if (!kvmhv_is_nestedv2() && unlikely(__kvmppc_get_msr_hv(vcpu) & MSR_PR)) {
16921692
/*
16931693
* Guest userspace executed sc 1. This can only be
16941694
* reached by the P9 path because the old path
@@ -4949,7 +4949,7 @@ static int kvmppc_vcpu_run_hv(struct kvm_vcpu *vcpu)
49494949
if (run->exit_reason == KVM_EXIT_PAPR_HCALL) {
49504950
accumulate_time(vcpu, &vcpu->arch.hcall);
49514951

4952-
if (WARN_ON_ONCE(__kvmppc_get_msr_hv(vcpu) & MSR_PR)) {
4952+
if (!kvmhv_is_nestedv2() && WARN_ON_ONCE(__kvmppc_get_msr_hv(vcpu) & MSR_PR)) {
49534953
/*
49544954
* These should have been caught reflected
49554955
* into the guest by now. Final sanity check:

0 commit comments

Comments
 (0)