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

Lai Jiangshan
2021-11-29T02:52:48Z

On Fri, Nov 26, 2021 at 3:44 PM <isaku.yamahata@intel.com> wrote:

> static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu)
> {
> return vcpu->run->request_interrupt_window &&
> + !vcpu->kvm->arch.irq_injection_disallowed &&
> likely(!pic_in_kernel(vcpu->kvm));
> }

Just judged superficially by the function names, it seems that the
logic is better to be put in kvm_cpu_accept_dm_intr() or some deeper
function nested in kvm_cpu_accept_dm_intr().

The function name will tell us that the interrupt is not injected
because the CPU doesn't accept it. And it will also have an effect
that vcpu->run->ready_for_interrupt_injection will always be false
which I think is better to have for TDX.

>
> --
> 2.25.1
>