All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/apicv: enhance posted-interrupt processing
@ 2017-02-17  9:37 Xuquan (Quan Xu)
  2017-02-17  8:49 ` Chao Gao
  0 siblings, 1 reply; 22+ messages in thread
From: Xuquan (Quan Xu) @ 2017-02-17  9:37 UTC (permalink / raw)
  To: xen-devel
  Cc: yang.zhang.wz, Tian, Kevin, quan.xu0, Jan Beulich, Andrew Cooper,
	Jun Nakajima, Gao, Chao

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]

>From a589074281cc22a30ed75a5bccba60e83d2312a6 Mon Sep 17 00:00:00 2001
From: Quan Xu <xuquan8@huawei.com>
Date: Sat, 18 Feb 2017 09:27:37 +0800
Subject: [PATCH] x86/apicv: enhance posted-interrupt processing

If guest is already in non-root mode, an posted interrupt will
be directly delivered to guest (leaving softirq being set w/o
actually incurring a VM-Exit - breaking desired softirq behavior).
Then further posted interrupts will skip the IPI, stay in PIR and
not noted until another VM-Exit happens.

Remove the softirq set. Actually since it's an optimization for
less IPIs, check softirq_pending(cpu) directly instead of sticking
to one bit only.

Signed-off-by: Quan Xu <xuquan8@huawei.com>
---
 xen/arch/x86/hvm/vmx/vmx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 61925cf..3887c32 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1846,8 +1846,7 @@ static void __vmx_deliver_posted_interrupt(struct vcpu *v)
     {
         unsigned int cpu = v->processor;

-        if ( !test_and_set_bit(VCPU_KICK_SOFTIRQ, &softirq_pending(cpu))
-             && (cpu != smp_processor_id()) )
+        if ( !softirq_pending(cpu) && (cpu != smp_processor_id()) )
             send_IPI_mask(cpumask_of(cpu), posted_intr_vector);
     }
 }
--
1.8.3.1

[-- Attachment #2: 0001-x86-apicv-enhance-posted-interrupt-processing.patch --]
[-- Type: application/octet-stream, Size: 1366 bytes --]

From a589074281cc22a30ed75a5bccba60e83d2312a6 Mon Sep 17 00:00:00 2001
From: Quan Xu <xuquan8@huawei.com>
Date: Sat, 18 Feb 2017 09:27:37 +0800
Subject: [PATCH] x86/apicv: enhance posted-interrupt processing

If guest is already in non-root mode, an posted interrupt will
be directly delivered to guest (leaving softirq being set w/o
actually incurring a VM-Exit - breaking desired softirq behavior).
Then further posted interrupts will skip the IPI, stay in PIR and
not noted until another VM-Exit happens.

Remove the softirq set. Actually since it's an optimization for
less IPIs, check softirq_pending(cpu) directly instead of sticking
to one bit only.

Signed-off-by: Quan Xu <xuquan8@huawei.com>
---
 xen/arch/x86/hvm/vmx/vmx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 61925cf..3887c32 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1846,8 +1846,7 @@ static void __vmx_deliver_posted_interrupt(struct vcpu *v)
     {
         unsigned int cpu = v->processor;
 
-        if ( !test_and_set_bit(VCPU_KICK_SOFTIRQ, &softirq_pending(cpu))
-             && (cpu != smp_processor_id()) )
+        if ( !softirq_pending(cpu) && (cpu != smp_processor_id()) )
             send_IPI_mask(cpumask_of(cpu), posted_intr_vector);
     }
 }
-- 
1.8.3.1


[-- Attachment #3: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-02-27  8:00 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17  9:37 [PATCH] x86/apicv: enhance posted-interrupt processing Xuquan (Quan Xu)
2017-02-17  8:49 ` Chao Gao
2017-02-17 16:32   ` Jan Beulich
2017-02-20 11:25     ` Xuquan (Quan Xu)
2017-02-20  8:24       ` Chao Gao
2017-02-21  2:49         ` Xuquan (Quan Xu)
2017-02-21  3:07           ` Tian, Kevin
2017-02-21  4:11             ` Xuquan (Quan Xu)
2017-02-20 21:54               ` Chao Gao
2017-02-21  6:19                 ` Xuquan (Quan Xu)
2017-02-21  9:08                   ` Jan Beulich
2017-02-21  9:44               ` Tian, Kevin
2017-02-23  9:28     ` Xuquan (Quan Xu)
2017-02-23  9:59       ` Jan Beulich
2017-02-23 10:53         ` Xuquan (Quan Xu)
2017-02-23 11:01           ` Jan Beulich
2017-02-23 11:55             ` Xuquan (Quan Xu)
2017-02-23  8:37               ` Chao Gao
2017-02-27  8:00                 ` Xuquan (Quan Xu)
2017-02-23 12:26               ` Jan Beulich
2017-02-24  8:02                 ` Xuquan (Quan Xu)
2017-02-24  8:20                   ` Jan Beulich

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.