Re: [PATCH 1/3] kvm: x86: check kvm_apic_sw_enabled() is enough

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ping...

On Mon, Apr 01, 2019 at 10:17:21AM +0800, Wei Yang wrote:
>On delivering irq to apic, we iterate on vcpu and do the check like
>this:
>
>    kvm_apic_present(vcpu)
>    kvm_lapic_enabled(vpu)
>        kvm_apic_present(vcpu) && kvm_apic_sw_enabled(vcpu->arch.apic)
>
>Since we have already checked kvm_apic_present(), it is reasonable to
>replace kvm_lapic_enabled() with kvm_apic_sw_enabled().
>
>Signed-off-by: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx>
>---
> arch/x86/kvm/irq_comm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c
>index 3cc3b2d130a0..188beb301cc5 100644
>--- a/arch/x86/kvm/irq_comm.c
>+++ b/arch/x86/kvm/irq_comm.c
>@@ -86,7 +86,7 @@ int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
> 			if (r < 0)
> 				r = 0;
> 			r += kvm_apic_set_irq(vcpu, irq, dest_map);
>-		} else if (kvm_lapic_enabled(vcpu)) {
>+		} else if (kvm_apic_sw_enabled(vcpu->arch.apic)) {
> 			if (!kvm_vector_hashing_enabled()) {
> 				if (!lowest)
> 					lowest = vcpu;
>-- 
>2.19.1

-- 
Wei Yang
Help you, Help me



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux