diff mbox series

[v2,3/4] x86/vvmx: don't enable interrupt window when using virt intr delivery

Message ID 20200203121919.15748-4-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/vvmx: fixes to interrupt injection | expand

Commit Message

Roger Pau Monne Feb. 3, 2020, 12:19 p.m. UTC
If virtual interrupt delivery is used to inject the interrupt to the
guest the interrupt window shouldn't be enabled, as the interrupt is
already injected using the GUEST_INTR_STATUS vmcs field.

Reported-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/arch/x86/hvm/vmx/intr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tian, Kevin Feb. 4, 2020, 1:40 a.m. UTC | #1
> From: Roger Pau Monne <roger.pau@citrix.com>
> Sent: Monday, February 3, 2020 8:19 PM
> 
> If virtual interrupt delivery is used to inject the interrupt to the
> guest the interrupt window shouldn't be enabled, as the interrupt is
> already injected using the GUEST_INTR_STATUS vmcs field.
> 
> Reported-by: Kevin Tian <kevin.tian@intel.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index 2eaf3f8d36..49a1295f09 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -209,7 +209,7 @@  static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
                 if ( unlikely(intack.source != hvm_intsrc_none) )
                     vmx_enable_intr_window(v, intack);
             }
-            else
+            else if ( !cpu_has_vmx_virtual_intr_delivery )
                 vmx_enable_intr_window(v, intack);
 
             return 1;