Re: [RFC PATCH v3 16/59] KVM: x86: Add per-VM flag to disable direct IRQ injection

From: Thomas Gleixner
Date: Thu Nov 25 2021 - 14:33:35 EST


On Wed, Nov 24 2021 at 16:19, isaku yamahata wrote:
> From: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
>
> Add a flag to disable IRQ injection, which is not supported by TDX.
...
> @@ -4506,7 +4506,8 @@ static int kvm_vcpu_ready_for_interrupt_injection(struct kvm_vcpu *vcpu)
> static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
> struct kvm_interrupt *irq)
> {
> - if (irq->irq >= KVM_NR_INTERRUPTS)
> + if (irq->irq >= KVM_NR_INTERRUPTS ||
> + vcpu->kvm->arch.irq_injection_disallowed)
> return -EINVAL;

That's required here because you forgot to copy & pasta the protect
guest condition muck into that ioctl, right?