Re: [PATCH v3 3/4] KVM: x86: Add EOI exit bitmap inference

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

 




On 08/06/2015 12:33, Wanpeng Li wrote:
>> +        if (kvm_check_request(KVM_REQ_SCAN_IOAPIC, vcpu)) {
>> +            if (irqchip_split(vcpu->kvm)) {
>> +                memset(vcpu->arch.eoi_exit_bitmaps, 0, 32);
>> +                kvm_scan_ioapic_routes(
>> +                    vcpu, vcpu->arch.eoi_exit_bitmaps);
>> +                kvm_x86_ops->load_eoi_exitmap(
>> +                    vcpu, vcpu->arch.eoi_exit_bitmaps);
> 
> How about introduce a handler to fold above just like vcpu_scan_ioapic() ?

Or just move the "if" inside the existing vcpu_scan_ioapic().  This is a
good suggestion because it raises more question:

1) should the

        if (!kvm_apic_hw_enabled(vcpu->arch.apic))
                return;

of vcpu_scan_ioapic apply to the "split irqchip" case too?

2) the "non-split irqchip" can also use vcpu->arch.eoi_exit_bitmaps
instead of the local eoi_exit_bitmap variable of vcpu_scan_ioapic.

So in the end the patched vcpu_scan_ioapic becomes

	if (kvm_apic_hw_enabled(vcpu->arch.apic))
                return;

	memset(vcpu->arch.eoi_exit_bitmaps, 0, 32);
	if (irqchip_split)
		scan_ioapic_routes(...)
	else {
		memset(tmr, 0, 32)
		kvm_ioapic_scan_entry(...)
		kvm_apic_update_tmr(vcpu, tmr);
	}
	kvm_x86_ops->load_eoi_exitmap(vcpu,
				      vcpu->arch.eoi_exit_bitmaps);

A FIXME/TODO comment about TMR in the split-irqchip case is probably in
order too.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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