All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Shan, Haitao" <haitao.shan@intel.com>,
	"mtosatti@redhat.com" <mtosatti@redhat.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>,
	"Tian, Kevin" <kevin.tian@intel.com>
Subject: Re: [PATCH v12 3/3] x86, apicv: add virtual interrupt delivery support
Date: Thu, 24 Jan 2013 16:26:30 +0200	[thread overview]
Message-ID: <20130124142630.GA18762@redhat.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E3180FD@SHSMSX101.ccr.corp.intel.com>

On Thu, Jan 24, 2013 at 01:47:34PM +0000, Zhang, Yang Z wrote:
> Gleb Natapov wrote on 2013-01-24:
> > On Wed, Jan 23, 2013 at 10:47:26PM +0800, Yang Zhang wrote:
> >> From: Yang Zhang <yang.z.zhang@Intel.com>
> >> 
> >> Virtual interrupt delivery avoids KVM to inject vAPIC interrupts
> >> manually, which is fully taken care of by the hardware. This needs
> >> some special awareness into existing interrupr injection path:
> >> 
> >> - for pending interrupt, instead of direct injection, we may need
> >>   update architecture specific indicators before resuming to guest.
> >> - A pending interrupt, which is masked by ISR, should be also
> >>   considered in above update action, since hardware will decide
> >>   when to inject it at right time. Current has_interrupt and
> >>   get_interrupt only returns a valid vector from injection p.o.v.
> >> Signed-off-by: Kevin Tian <kevin.tian@intel.com>
> >> Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
> >> ---
> >>  arch/ia64/kvm/lapic.h           |    6 ++
> >>  arch/x86/include/asm/kvm_host.h |    7 ++ arch/x86/include/asm/vmx.h  
> >>     |   11 +++ arch/x86/kvm/irq.c              |   56 +++++++++++++++--
> >>  arch/x86/kvm/lapic.c            |  106 ++++++++++++++++++++++++-------
> >>  arch/x86/kvm/lapic.h            |   27 ++++++++ arch/x86/kvm/svm.c    
> >>           |   31 +++++++++ arch/x86/kvm/vmx.c              |  133
> >>  ++++++++++++++++++++++++++++++++++++--- arch/x86/kvm/x86.c            
> >>   |   11 +++- include/linux/kvm_host.h        |    3 +
> >>  virt/kvm/ioapic.c               |   39 +++++++++++ virt/kvm/ioapic.h  
> >>              |    4 + virt/kvm/irq_comm.c             |   25 +++++++
> >>  virt/kvm/kvm_main.c             |    5 ++ 14 files changed, 425
> >>  insertions(+), 39 deletions(-)
> >>
> >> +static void vmx_hwapic_vector_intercept_on_eoi(struct kvm_vcpu *vcpu,
> >> +					u32 vector, u64 *eoi_exit_bitmap)
> >> +{
> >> +	BUG_ON(vector > 255);
> >> +	__set_bit(vector, (unsigned long *)eoi_exit_bitmap);
> >Nothing that warrants this to be vmx callback is here.
> >> +}
> >> +
> >> +static void vmx_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)
> >> +{
> >> +	vmcs_write64(EOI_EXIT_BITMAP0, eoi_exit_bitmap[0]);
> >> +	vmcs_write64(EOI_EXIT_BITMAP1, eoi_exit_bitmap[1]);
> >> +	vmcs_write64(EOI_EXIT_BITMAP2, eoi_exit_bitmap[2]);
> >> +	vmcs_write64(EOI_EXIT_BITMAP3, eoi_exit_bitmap[3]);
> >> +}
> >> +
> >> +static void vmx_update_eoi_exitmap(struct kvm_vcpu *vcpu)
> >> +{
> >> +	u64 eoi_exit_bitmap[4];
> >> +
> >> +	/* clear eoi exit bitmap */
> >> +	memset(eoi_exit_bitmap, 0, 32);
> >> +
> >> +	kvm_ioapic_calculate_eoi_exitmap(vcpu, eoi_exit_bitmap);
> >> +	vmx_load_eoi_exitmap(vcpu, eoi_exit_bitmap);
> >> +}
> >Same as above. Why is this vmx callback?
> Why this callback is redundant? We can remove vmx_hwapic_vector_intercept_on_eoi, but this callback is necessary.
> 
We try to put only necessary things in to the callback and generic
things into common code. vmx_load_eoi_exitmap() is the only thing that
is vmx specific, so make load_eoi_exitmap() callback please that does
just that.

--
			Gleb.

  reply	other threads:[~2013-01-24 14:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 14:47 [PATCH v12 0/3] x86, apicv: Add APIC virtualization support Yang Zhang
2013-01-23 14:47 ` [PATCH v12 1/3] x86, apicv: add APICv register " Yang Zhang
2013-01-23 14:47 ` [PATCH v12 2/3] x86, apicv: add virtual x2apic support Yang Zhang
2013-01-24  7:46   ` Gleb Natapov
2013-01-24  8:09     ` Zhang, Yang Z
2013-01-23 14:47 ` [PATCH v12 3/3] x86, apicv: add virtual interrupt delivery support Yang Zhang
2013-01-24  8:30   ` Gleb Natapov
2013-01-24  8:42     ` Zhang, Yang Z
2013-01-24 13:47     ` Zhang, Yang Z
2013-01-24 14:26       ` Gleb Natapov [this message]
2013-01-24 14:28         ` Zhang, Yang Z
2013-01-24  0:05 ` [PATCH v12 0/3] x86, apicv: Add APIC virtualization support Marcelo Tosatti
2013-01-24  0:08 ` Marcelo Tosatti
2013-01-24  0:26   ` Zhang, Yang Z
2013-01-24 19:56     ` Chegu Vinod

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=20130124142630.GA18762@redhat.com \
    --to=gleb@redhat.com \
    --cc=haitao.shan@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=xiantao.zhang@intel.com \
    --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 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.