kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yangminqiang <yangminqiang@huawei.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Cc: "gleb@redhat.com" <gleb@redhat.com>,
	"mtosatti@redhat.com" <mtosatti@redhat.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	"Luohao (brian)" <brian.luohao@huawei.com>,
	Haofeng <haofeng@huawei.com>
Subject: RE: [PATCH v10 7/7] KVM: VMX: Use posted interrupt to deliver virtual interrupt
Date: Fri, 26 Apr 2013 09:29:14 +0000	[thread overview]
Message-ID: <74961C475F61A9459FE12A5810EF11CE03304AD2@szxeml538-mbx.china.huawei.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E09A214E9@SHSMSX101.ccr.corp.intel.com>



> -----Original Message-----
> From: Zhang, Yang Z [mailto:yang.z.zhang@intel.com]
> Sent: Friday, April 26, 2013 1:10 PM
> To: Yangminqiang; kvm@vger.kernel.org
> Cc: gleb@redhat.com; mtosatti@redhat.com; Zhang, Xiantao; Nakajima, Jun;
> Luohao (brian); Haofeng
> Subject: RE: [PATCH v10 7/7] KVM: VMX: Use posted interrupt to deliver virtual
> interrupt
> 
> Yangminqiang wrote on 2013-04-26:
> > Hi Yang Zhang,
> >
> > Could you please let me know your CPU model or the CPU models which
> > supports apic-v which your patch requires()? So that I could try you
> > patches.
> >
> >   Intel Software Developer's Manualm, Volume 3C,
> >   System Programming Guide, Part 3. Ch29,
> >   APIC VIRTUALIZATION AND VIRTUAL INTERRUPTS
> > Or how can I know whether my hardware support those features listed in the
> > manual above?
> Ivytown or newer platform supported it.

Ivytown? Do you mean Ivy Bridge?

> 
> > Thanks,
> > Steven
> >
> > kvm-owner@vger.kernel.org wrote on 2013-04-11:
> >> Subject: [PATCH v10 7/7] KVM: VMX: Use posted interrupt to deliver virtual
> >> interrupt
> >>
> >> From: Yang Zhang <yang.z.zhang@Intel.com>
> >>
> >> If posted interrupt is avaliable, then uses it to inject virtual
> >> interrupt to guest.
> >>
> >> Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
> >> ---
> >>  arch/x86/kvm/lapic.c |   30 +++++++++++++++++++-----------
> >>  arch/x86/kvm/vmx.c   |    2 +-
> >>  arch/x86/kvm/x86.c   |    1 +
> >>  3 files changed, 21 insertions(+), 12 deletions(-)
> >> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> >> index dbf74c9..e29883c 100644
> >> --- a/arch/x86/kvm/lapic.c
> >> +++ b/arch/x86/kvm/lapic.c
> >> @@ -353,6 +353,7 @@ static inline int apic_find_highest_irr(struct
> kvm_lapic
> >> *apic)
> >>  	if (!apic->irr_pending)
> >>  		return -1;
> >> +	kvm_x86_ops->sync_pir_to_irr(apic->vcpu);
> >>  	result = apic_search_irr(apic);
> >>  	ASSERT(result == -1 || result >= 16);
> >> @@ -683,18 +684,25 @@ static int __apic_accept_irq(struct kvm_lapic
> *apic,
> >> int delivery_mode,
> >>  		if (dest_map)
> >>  			__set_bit(vcpu->vcpu_id, dest_map);
> >> -		result = !apic_test_and_set_irr(vector, apic);
> >> -		trace_kvm_apic_accept_irq(vcpu->vcpu_id, delivery_mode,
> >> -					  trig_mode, vector, !result);
> >> -		if (!result) {
> >> -			if (trig_mode)
> >> -				apic_debug("level trig mode repeatedly for "
> >> -						"vector %d", vector);
> >> -			break;
> >> -		}
> >> +		if (kvm_x86_ops->deliver_posted_interrupt) {
> >> +			result = 1;
> >> +			kvm_x86_ops->deliver_posted_interrupt(vcpu, vector);
> >> +		} else {
> >> +			result = !apic_test_and_set_irr(vector, apic);
> >>
> >> -		kvm_make_request(KVM_REQ_EVENT, vcpu);
> >> -		kvm_vcpu_kick(vcpu);
> >> +			if (!result) {
> >> +				if (trig_mode)
> >> +					apic_debug("level trig mode repeatedly "
> >> +						"for vector %d", vector);
> >> +				goto out;
> >> +			}
> >> +
> >> +			kvm_make_request(KVM_REQ_EVENT, vcpu);
> >> +			kvm_vcpu_kick(vcpu);
> >> +		}
> >> +out:
> >> +		trace_kvm_apic_accept_irq(vcpu->vcpu_id, delivery_mode,
> >> +				trig_mode, vector, !result);
> >>  		break;
> >>
> >>  	case APIC_DM_REMRD:
> >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> >> index 314b2ed..52b21da 100644
> >> --- a/arch/x86/kvm/vmx.c
> >> +++ b/arch/x86/kvm/vmx.c
> >> @@ -84,7 +84,7 @@ module_param(vmm_exclusive, bool, S_IRUGO);
> >>  static bool __read_mostly fasteoi = 1;
> >>  module_param(fasteoi, bool, S_IRUGO);
> >> -static bool __read_mostly enable_apicv;
> >> +static bool __read_mostly enable_apicv = 1;
> >>  module_param(enable_apicv, bool, S_IRUGO);
> >>
> >>  /*
> >> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> >> index 6147d24..628582f 100644
> >> --- a/arch/x86/kvm/x86.c
> >> +++ b/arch/x86/kvm/x86.c
> >> @@ -2685,6 +2685,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
> >>  static int kvm_vcpu_ioctl_get_lapic(struct kvm_vcpu *vcpu,
> 
> >>  struct kvm_lapic_state *s) { +	kvm_x86_ops->sync_pir_to_irr(vcpu);
> >>  	memcpy(s->regs, vcpu->arch.apic->regs, sizeof *s);
> >>
> >>  	return 0;
> >> --
> >> 1.7.1
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe kvm" in
> >> the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> Best regards,
> Yang
> 


  reply	other threads:[~2013-04-26  9:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 11:25 [PATCH v10 0/7] KVM: VMX: Add Posted Interrupt supporting Yang Zhang
2013-04-11 11:25 ` [PATCH v10 1/7] KVM: VMX: Enable acknowledge interupt on vmexit Yang Zhang
2013-04-11 11:25 ` [PATCH v10 2/7] KVM: VMX: Register a new IPI for posted interrupt Yang Zhang
2013-04-11 11:25 ` [PATCH v10 3/7] KVM: VMX: Check the posted interrupt capability Yang Zhang
2013-04-11 11:25 ` [PATCH v10 4/7] KVM: Call common update function when ioapic entry changed Yang Zhang
2013-04-11 11:25 ` [PATCH v10 5/7] KVM: Set TMR when programming ioapic entry Yang Zhang
2013-04-11 11:25 ` [PATCH v10 6/7] KVM: VMX: Add the algorithm of deliver posted interrupt Yang Zhang
2013-04-11 11:25 ` [PATCH v10 7/7] KVM: VMX: Use posted interrupt to deliver virtual interrupt Yang Zhang
2013-04-26  5:06   ` Yangminqiang
2013-04-26  5:09     ` Zhang, Yang Z
2013-04-26  9:29       ` Yangminqiang [this message]
2013-04-26 13:46         ` Nakajima, Jun
2013-05-03  2:44           ` Yangminqiang
2013-05-07  1:52             ` Zhang, Yang Z
2013-04-14  9:40 ` [PATCH v10 0/7] KVM: VMX: Add Posted Interrupt supporting Gleb Natapov
2013-04-16 21:17   ` Marcelo Tosatti

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=74961C475F61A9459FE12A5810EF11CE03304AD2@szxeml538-mbx.china.huawei.com \
    --to=yangminqiang@huawei.com \
    --cc=brian.luohao@huawei.com \
    --cc=gleb@redhat.com \
    --cc=haofeng@huawei.com \
    --cc=jun.nakajima@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).