Thread (24 messages) 24 messages, 6 authors, 2021-11-16

Re: [PATCH 4/5] KVM: x86: Use kvm_get_vcpu() instead of open-coded access

From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2021-11-16 16:49:35
Also in: kvm, kvmarm, linux-mips

On 11/16/21 17:07, Sean Christopherson wrote:
quoted
quoted
          if (!kvm_arch_has_assigned_device(kvm) ||
              !irq_remapping_cap(IRQ_POSTING_CAP) ||
-           !kvm_vcpu_apicv_active(kvm->vcpus[0]))
+           !irqchip_in_kernel(kvm) || !enable_apicv)
                  return 0;

          idx = srcu_read_lock(&kvm->irq_srcu);
What happens then if pi_pre_block is called and the IRTE denotes a posted
interrupt?

I might be wrong, but it seems to me that you have to change all of the
occurrences this way.  As soon as enable_apicv is set, you need to go
through the POSTED_INTR_WAKEUP_VECTOR just in case.
Sorry, I didn't grok that at all.  All occurences of what?
Of the !assigned-device || !VTd-PI || !kvm_vcpu_apicv_active(vcpu) 
checks.  This way, CPUs are woken up correctly even if you have 
!kvm_vcpu_apicv_active(vcpu) but the IRTE is a posted-interrupt one.

Paolo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help