WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.4-testing] x86 vmx: Update EIP when appropriate d

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] x86 vmx: Update EIP when appropriate during task switch
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 03 Sep 2009 05:10:31 -0700
Delivery-date: Thu, 03 Sep 2009 05:15:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1251968454 -3600
# Node ID 088834c1abfb1ef787b170092ef0ec1433910825
# Parent  7a57911ff09efb2b2e5fe7811e0495adc5884a29
x86 vmx: Update EIP when appropriate during task switch

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   20097:1cdf9f96e3c1
xen-unstable date:        Thu Aug 20 13:32:31 2009 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff -r 7a57911ff09e -r 088834c1abfb xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Thu Aug 20 08:30:24 2009 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Thu Sep 03 10:00:54 2009 +0100
@@ -2446,14 +2446,21 @@ asmlinkage void vmx_vmexit_handler(struc
     case EXIT_REASON_TASK_SWITCH: {
         const enum hvm_task_switch_reason reasons[] = {
             TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int };
-        int32_t errcode = -1;
+        int32_t ecode = -1, source;
         exit_qualification = __vmread(EXIT_QUALIFICATION);
-        if ( (idtv_info & INTR_INFO_VALID_MASK) &&
-             (idtv_info & INTR_INFO_DELIVER_CODE_MASK) )
-            errcode = __vmread(IDT_VECTORING_ERROR_CODE);
-        hvm_task_switch((uint16_t)exit_qualification,
-                        reasons[(exit_qualification >> 30) & 3],
-                        errcode);
+        source = (exit_qualification >> 30) & 3;
+        inst_len = __get_instruction_length(); /* Safe: See SDM 3B 23.2.4 */
+        if ( (source == 3) && (idtv_info & INTR_INFO_VALID_MASK) )
+        {
+            /* ExtInt, NMI, HWException: no instruction to skip over. */
+            if ( !(idtv_info & (1u<<10)) ) /* 0 <= IntrType <= 3? */
+                inst_len = 0;
+            /* If there's an error code then we pass it along. */
+            if ( idtv_info & INTR_INFO_DELIVER_CODE_MASK )
+                ecode = __vmread(IDT_VECTORING_ERROR_CODE);
+        }
+        regs->eip += inst_len;
+        hvm_task_switch((uint16_t)exit_qualification, reasons[source], ecode);
         break;
     }
     case EXIT_REASON_CPUID:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] x86 vmx: Update EIP when appropriate during task switch, Xen patchbot-3.4-testing <=