xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dongxiao Xu <dongxiao.xu@intel.com>
To: xen-devel@lists.xen.org
Cc: eddie.dong@intel.com, jun.nakajima@intel.com
Subject: [PATCH v5 10/11] nested vmx: fix interrupt delivery to L2 guest
Date: Thu,  6 Dec 2012 22:17:06 +0800	[thread overview]
Message-ID: <1354803427-18057-11-git-send-email-dongxiao.xu@intel.com> (raw)
In-Reply-To: <1354803427-18057-1-git-send-email-dongxiao.xu@intel.com>

While delivering interrupt into L2 guest, L0 hypervisor need to check
whether L1 hypervisor wants to own the interrupt, if not, directly inject
the interrupt into L2 guest.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/intr.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index 3961bc7..ef8b925 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -163,7 +163,7 @@ enum hvm_intblk nvmx_intr_blocked(struct vcpu *v)
 
 static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 {
-    u32 exit_ctrl;
+    u32 ctrl;
 
     if ( nvmx_intr_blocked(v) != hvm_intblk_none )
     {
@@ -176,11 +176,14 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
         if ( intack.source == hvm_intsrc_pic ||
                  intack.source == hvm_intsrc_lapic )
         {
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+            if ( !(ctrl & PIN_BASED_EXT_INTR_MASK) )
+                return 0;
+
             vmx_inject_extint(intack.vector);
 
-            exit_ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx,
-                            VM_EXIT_CONTROLS);
-            if ( exit_ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, VM_EXIT_CONTROLS);
+            if ( ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
             {
                 /* for now, duplicate the ack path in vmx_intr_assist */
                 hvm_vcpu_ack_pending_irq(v, intack);
-- 
1.7.1

  parent reply	other threads:[~2012-12-06 14:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06 14:16 [PATCH v5 00/11] nested vmx: bug fixes and feature enabling Dongxiao Xu
2012-12-06 14:16 ` [PATCH v5 01/11] nested vmx: emulate MSR bitmaps Dongxiao Xu
2012-12-06 14:16 ` [PATCH v5 02/11] nested vmx: use literal name instead of hard numbers Dongxiao Xu
2012-12-06 14:16 ` [PATCH v5 03/11] nested vmx: expose bit 55 of IA32_VMX_BASIC_MSR to guest VMM Dongxiao Xu
2012-12-06 14:17 ` [PATCH v5 04/11] nested vmx: fix rflags status in virtual vmexit Dongxiao Xu
2012-12-06 14:17 ` [PATCH v5 05/11] nested vmx: fix handling of RDTSC Dongxiao Xu
2012-12-06 14:17 ` [PATCH v5 06/11] nested vmx: fix DR access VM exit Dongxiao Xu
2012-12-06 14:17 ` [PATCH v5 07/11] nested vmx: enable IA32E mode while do VM entry Dongxiao Xu
2012-12-06 14:17 ` [PATCH v5 08/11] nested vmx: enable "Virtualize APIC accesses" feature for L1 VMM Dongxiao Xu
2012-12-06 14:17 ` [PATCH v5 09/11] nested vmx: enable PAUSE and RDPMC exiting " Dongxiao Xu
2012-12-06 14:17 ` Dongxiao Xu [this message]
2012-12-06 14:17 ` [PATCH v5 11/11] nested vmx: check host ability when intercept MSR read Dongxiao Xu

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=1354803427-18057-11-git-send-email-dongxiao.xu@intel.com \
    --to=dongxiao.xu@intel.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=xen-devel@lists.xen.org \
    /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).