Skip to content

Commit 2dcf37a

Browse files
Maxim Levitskybonzini
authored andcommitted
x86: KVM: SVM: add support for Invalid IPI Vector interception
In later revisions of AMD's APM, there is a new 'incomplete IPI' exit code: "Invalid IPI Vector - The vector for the specified IPI was set to an illegal value (VEC < 16)" Note that tests on Zen2 machine show that this VM exit doesn't happen and instead AVIC just does nothing. Add support for this exit code by doing nothing, instead of filling the kernel log with errors. Also replace an unthrottled 'pr_err()' if another unknown incomplete IPI exit happens with vcpu_unimpl() (e.g in case AMD adds yet another 'Invalid IPI' exit reason) Cc: <[email protected]> Signed-off-by: Maxim Levitsky <[email protected]> Reviewed-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent b65235f commit 2dcf37a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

arch/x86/include/asm/svm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ enum avic_ipi_failure_cause {
268268
AVIC_IPI_FAILURE_TARGET_NOT_RUNNING,
269269
AVIC_IPI_FAILURE_INVALID_TARGET,
270270
AVIC_IPI_FAILURE_INVALID_BACKING_PAGE,
271+
AVIC_IPI_FAILURE_INVALID_IPI_VECTOR,
271272
};
272273

273274
#define AVIC_PHYSICAL_MAX_INDEX_MASK GENMASK_ULL(8, 0)

arch/x86/kvm/svm/avic.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,11 @@ int avic_incomplete_ipi_interception(struct kvm_vcpu *vcpu)
529529
case AVIC_IPI_FAILURE_INVALID_BACKING_PAGE:
530530
WARN_ONCE(1, "Invalid backing page\n");
531531
break;
532+
case AVIC_IPI_FAILURE_INVALID_IPI_VECTOR:
533+
/* Invalid IPI with vector < 16 */
534+
break;
532535
default:
533-
pr_err("Unknown IPI interception\n");
536+
vcpu_unimpl(vcpu, "Unknown avic incomplete IPI interception\n");
534537
}
535538

536539
return 1;

0 commit comments

Comments
 (0)