public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>
Cc: Gleb Natapov <gleb@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Shan, Haitao" <haitao.shan@intel.com>,
	"Tian, Kevin" <kevin.tian@intel.com>
Subject: Re: [PATCH v8 2/3] x86, apicv: add virtual interrupt delivery support
Date: Tue, 8 Jan 2013 11:40:20 -0200	[thread overview]
Message-ID: <20130108134020.GA15222@amt.cnet> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E2F341F@SHSMSX101.ccr.corp.intel.com>

On Tue, Jan 08, 2013 at 12:43:22AM +0000, Zhang, Yang Z wrote:
> Marcelo Tosatti wrote on 2013-01-08:
> > On Mon, Jan 07, 2013 at 07:48:43PM +0200, Gleb Natapov wrote:
> >>> ioapic_write (or any other ioapic update)
> >>> lock()
> >>> perform update
> >>> make_all_vcpus_request(KVM_REQ_UPDATE_EOI_BITMAP) (*)
> >>> unlock()
> >>> 
> >>> (*) Similarly to TLB flush.
> >>> 
> >>> The advantage is that all work becomes vcpu local. The end result
> >>> is much simpler code.
> >> What complexity will it remove?
> > 
> > Synchronization between multiple CPUs (except the KVM_REQ_ bit
> > processing, which is infrastructure shared by other parts of KVM).
> > 
> > We agreed that performance is non issue here.
> The current logic is this:
> ioapic_write
> lock()
> perform update
> make request on each vcpu
> kick each vcpu
> unlock()
> 
> The only difference is the way to make the request. And the complex part is performing update. With your suggestion, we still need to do the update. Why you think it is much simpler?

The update should be local, because there is no reason to make it
remote.

       kvm_for_each_vcpu(index, vcpu, kvm)
               kvm_x86_ops->update_exitmap_start(vcpu);

       for (index = 0; index < IOAPIC_NUM_PINS; index++) {
               e = &ioapic->redirtbl[index];
               if (!e->fields.mask)
                       ioapic_update_eoi_exitmap_one(ioapic, index);
       }

       kvm_for_each_vcpu(index, vcpu, kvm) {
               kvm_x86_ops->update_exitmap_end(vcpu);
               kvm_vcpu_kick(vcpu);
       }

No need for start, end, etc calls into vcpus. All ioapic updater does
is set a request bit, similar to a remote TLB flush. Update is then
entirely done vcpu local.


  reply	other threads:[~2013-01-08 13:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07  2:02 [PATCH v8 0/3] x86, apicv: Add APIC virtualization support Yang Zhang
2013-01-07  2:02 ` [PATCH v8 1/3] x86, apicv: add APICv register " Yang Zhang
2013-01-07  2:02 ` [PATCH v8 2/3] x86, apicv: add virtual interrupt delivery support Yang Zhang
2013-01-07  7:51   ` Gleb Natapov
2013-01-07 13:04     ` Zhang, Yang Z
2013-01-07 13:52   ` Marcelo Tosatti
2013-01-07 17:48     ` Gleb Natapov
2013-01-07 21:32       ` Marcelo Tosatti
2013-01-08  0:43         ` Zhang, Yang Z
2013-01-08 13:40           ` Marcelo Tosatti [this message]
2013-01-08 10:03         ` Gleb Natapov
2013-01-08 12:57           ` Zhang, Yang Z
2013-01-08 13:57             ` Marcelo Tosatti
2013-01-08 15:43               ` Gleb Natapov
2013-01-09  8:07                 ` Zhang, Yang Z
2013-01-09 15:10                   ` Marcelo Tosatti
2013-01-10  0:22                     ` Zhang, Yang Z
2013-01-08 13:53           ` Marcelo Tosatti
2013-01-07  2:02 ` [PATCH v8 3/3] x86, apicv: add virtual x2apic support Yang Zhang
2013-01-07  6:46   ` Gleb Natapov
2013-01-07  6:58     ` Zhang, Yang Z
2013-01-07  7:07       ` Gleb Natapov

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=20130108134020.GA15222@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=gleb@redhat.com \
    --cc=haitao.shan@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=yang.z.zhang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox