@@ -5266,6 +5266,21 @@ get_pi_vcpu_info(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e,
return -1;
}
+ switch (irq.delivery_mode) {
+ case dest_Fixed:
+ case dest_LowestPrio:
+ break;
+ default:
+ /*
+ * For non-trivial interrupt events, we need to go
+ * through the full KVM IRQ code, so refuse to take
+ * any direct PI assignments here.
+ */
+ pr_debug("SVM: %s: use legacy intr mode for non-std irq %u\n",
+ __func__, irq.vector);
+ return -1;
+ }
+
pr_debug("SVM: %s: use GA mode for irq %u\n", __func__,
irq.vector);
*svm = to_svm(vcpu);
@@ -5314,6 +5329,7 @@ static int svm_update_pi_irte(struct kvm *kvm, unsigned int host_irq,
* 1. When cannot target interrupt to a specific vcpu.
* 2. Unsetting posted interrupt.
* 3. APIC virtialization is disabled for the vcpu.
+ * 4. IRQ has extended delivery mode (SMI, INIT, etc)
*/
if (!get_pi_vcpu_info(kvm, e, &vcpu_info, &svm) && set &&
kvm_vcpu_apicv_active(&svm->vcpu)) {