[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.2-testing] nested vmx: fix handling of RDTSC


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-4.2-testing <patchbot@xxxxxxx>
  • Date: Thu, 20 Dec 2012 04:33:10 +0000
  • Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
# Date 1355918145 -3600
# Node ID b11d8dcf1da5abe11c6aa7ad62aa508a4e667349
# Parent  0fb41420450f583e522a4bf22d3259c5fbd28943
nested vmx: fix handling of RDTSC

If L0 is to handle the TSC access, then we need to update guest EIP by
calling update_guest_eip().

Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
xen-unstable changeset: 26253:a09150b57ace
xen-unstable date: Thu Dec  6 16:56:21 UTC 2012
---


diff -r 0fb41420450f -r b11d8dcf1da5 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Wed Dec 19 12:55:45 2012 +0100
@@ -1595,7 +1595,7 @@ static int get_instruction_length(void)
     return len;
 }
 
-static void update_guest_eip(void)
+void update_guest_eip(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long x;
diff -r 0fb41420450f -r b11d8dcf1da5 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c       Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c       Wed Dec 19 12:55:45 2012 +0100
@@ -1558,6 +1558,7 @@ int nvmx_n2_vmexit_handler(struct cpu_us
             tsc += __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
             regs->eax = (uint32_t)tsc;
             regs->edx = (uint32_t)(tsc >> 32);
+            update_guest_eip();
 
             return 1;
         }
diff -r 0fb41420450f -r b11d8dcf1da5 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h Wed Dec 19 12:55:45 2012 +0100
@@ -394,6 +394,8 @@ void ept_p2m_init(struct p2m_domain *p2m
 void ept_walk_table(struct domain *d, unsigned long gfn);
 void setup_ept_dump(void);
 
+void update_guest_eip(void);
+
 /* EPT violation qualifications definitions */
 #define _EPT_READ_VIOLATION         0
 #define EPT_READ_VIOLATION          (1UL<<_EPT_READ_VIOLATION)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.