Message ID | E0A769A898ADB6449596C41F51EF62C6ADC34E@SZXEMI506-MBX.china.huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 04.01.17 at 13:21, <xuquan8@huawei.com> wrote: > --- a/xen/arch/x86/hvm/vmx/intr.c > +++ b/xen/arch/x86/hvm/vmx/intr.c > @@ -312,13 +312,14 @@ void vmx_intr_assist(void) > unsigned int i, n; > > /* > - * Set eoi_exit_bitmap for periodic timer interrup to cause EOI-induced VM > - * exit, then pending periodic time interrups have the chance to be injected > - * for compensation > + * intack.vector is the highest priority vector. So we set eoi_exit_bitmap > + * for intack.vector - give a chance to post periodic time interrupts when > + * periodic time interrupts become the highest one > */ > - if (pt_vector != -1) > - vmx_set_eoi_exit_bitmap(v, pt_vector); > - > + if ( pt_vector != -1 ) { I would have said I'll fix the coding style violation here while committing, but ... > @@ -334,7 +335,8 @@ void vmx_intr_assist(void) > __vmwrite(EOI_EXIT_BITMAP(i), v->arch.hvm_vmx.eoi_exit_bitmap[i]); > } > > - pt_intr_post(v, intack); > + if ( intack.vector == pt_vector ) > + pt_intr_post(v, intack); ... this change doesn't appear to be mentioned in the description at all, and I can't see why it is needed considering the is_pt_irq() check (under lock) early on in pt_intr_post(). Jan
> From: Jan Beulich [mailto:JBeulich@suse.com] > Sent: Wednesday, January 04, 2017 8:57 PM > > >>> On 04.01.17 at 13:21, <xuquan8@huawei.com> wrote: > > --- a/xen/arch/x86/hvm/vmx/intr.c > > +++ b/xen/arch/x86/hvm/vmx/intr.c > > @@ -312,13 +312,14 @@ void vmx_intr_assist(void) > > unsigned int i, n; > > > > /* > > - * Set eoi_exit_bitmap for periodic timer interrup to cause EOI-induced VM > > - * exit, then pending periodic time interrups have the chance to be injected > > - * for compensation > > + * intack.vector is the highest priority vector. So we set eoi_exit_bitmap > > + * for intack.vector - give a chance to post periodic time interrupts when > > + * periodic time interrupts become the highest one > > */ > > - if (pt_vector != -1) > > - vmx_set_eoi_exit_bitmap(v, pt_vector); > > - > > + if ( pt_vector != -1 ) { > > I would have said I'll fix the coding style violation here while committing, > but ... > > > @@ -334,7 +335,8 @@ void vmx_intr_assist(void) > > __vmwrite(EOI_EXIT_BITMAP(i), v->arch.hvm_vmx.eoi_exit_bitmap[i]); > > } > > > > - pt_intr_post(v, intack); > > + if ( intack.vector == pt_vector ) > > + pt_intr_post(v, intack); > > ... this change doesn't appear to be mentioned in the description at > all, and I can't see why it is needed considering the is_pt_irq() check > (under lock) early on in pt_intr_post(). yes, duplicated check here. Thanks Kevin
On January 05, 2017 10:38 AM, Tian, Kevin wrote: >> From: Jan Beulich [mailto:JBeulich@suse.com] >> Sent: Wednesday, January 04, 2017 8:57 PM >> >> >>> On 04.01.17 at 13:21, <xuquan8@huawei.com> wrote: >> > --- a/xen/arch/x86/hvm/vmx/intr.c >> > +++ b/xen/arch/x86/hvm/vmx/intr.c >> > @@ -334,7 +335,8 @@ void vmx_intr_assist(void) >> > __vmwrite(EOI_EXIT_BITMAP(i), >v->arch.hvm_vmx.eoi_exit_bitmap[i]); >> > } >> > >> > - pt_intr_post(v, intack); >> > + if ( intack.vector == pt_vector ) >> > + pt_intr_post(v, intack); >> >> ... this change doesn't appear to be mentioned in the description at >> all, and I can't see why it is needed considering the is_pt_irq() >> check (under lock) early on in pt_intr_post(). > >yes, duplicated check here. > Agreed, drop it in next v6. Quan
diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c index 639a705..4d60eec 100644 --- a/xen/arch/x86/hvm/vmx/intr.c +++ b/xen/arch/x86/hvm/vmx/intr.c @@ -312,13 +312,14 @@ void vmx_intr_assist(void) unsigned int i, n; /* - * Set eoi_exit_bitmap for periodic timer interrup to cause EOI-induced VM - * exit, then pending periodic time interrups have the chance to be injected - * for compensation + * intack.vector is the highest priority vector. So we set eoi_exit_bitmap + * for intack.vector - give a chance to post periodic time interrupts when + * periodic time interrupts become the highest one */ - if (pt_vector != -1) - vmx_set_eoi_exit_bitmap(v, pt_vector); - + if ( pt_vector != -1 ) { + ASSERT(intack.vector >= pt_vector); + vmx_set_eoi_exit_bitmap(v, intack.vector); + } /* we need update the RVI field */ __vmread(GUEST_INTR_STATUS, &status); status &= ~VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK; @@ -334,7 +335,8 @@ void vmx_intr_assist(void) __vmwrite(EOI_EXIT_BITMAP(i), v->arch.hvm_vmx.eoi_exit_bitmap[i]); } - pt_intr_post(v, intack); + if ( intack.vector == pt_vector ) + pt_intr_post(v, intack); } else {