All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <wanpeng.li@hotmail.com>,
	Steve Rutherford <srutherford@google.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH v3 3/4] KVM: x86: Add EOI exit bitmap inference
Date: Mon, 08 Jun 2015 16:15:03 +0200	[thread overview]
Message-ID: <5575A367.1060803@redhat.com> (raw)
In-Reply-To: <BLU436-SMTP236C4B4413A76BF251B434380BF0@phx.gbl>



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

  reply	other threads:[~2015-06-08 14:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 23:51 [PATCH v3 1/4] KVM: x86: Split the APIC from the rest of IRQCHIP Steve Rutherford
2015-06-02 23:51 ` [PATCH v3 2/4] KVM: x86: Add KVM exit for IOAPIC EOIs Steve Rutherford
2015-06-03  9:16   ` Paolo Bonzini
2015-06-02 23:51 ` [PATCH v3 3/4] KVM: x86: Add EOI exit bitmap inference Steve Rutherford
2015-06-03  9:16   ` Paolo Bonzini
2015-06-04 20:39     ` Steve Rutherford
2015-06-08 10:33   ` Wanpeng Li
2015-06-08 14:15     ` Paolo Bonzini [this message]
2015-06-09  2:16       ` Wanpeng Li
2015-06-17  8:14         ` Paolo Bonzini
2015-06-02 23:51 ` [PATCH v3 4/4] KVM: x86: Add support for local interrupt requests from userspace Steve Rutherford
2015-06-03  9:38   ` Paolo Bonzini
2015-06-04 20:21     ` Steve Rutherford
2015-06-20  0:41     ` Steve Rutherford
2015-06-21 20:10       ` Paolo Bonzini
2015-06-26  0:26     ` Steve Rutherford
2015-06-26  8:49       ` Paolo Bonzini
2015-06-03  8:54 ` [PATCH v3 1/4] KVM: x86: Split the APIC from the rest of IRQCHIP Paolo Bonzini
2015-06-04 20:38   ` Steve Rutherford
2015-06-05  7:19     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5575A367.1060803@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=srutherford@google.com \
    --cc=wanpeng.li@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.