]> xenbits.xensource.com Git - people/aperard/xen-arm.git/commitdiff
nested vmx: fix handling of RDTSC
authorDongxiao Xu <dongxiao.xu@intel.com>
Thu, 6 Dec 2012 16:56:21 +0000 (16:56 +0000)
committerDongxiao Xu <dongxiao.xu@intel.com>
Thu, 6 Dec 2012 16:56:21 +0000 (16:56 +0000)
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@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vvmx.c
xen/include/asm-x86/hvm/vmx/vmx.h

index 3bb0d99a4b6335f490f323aa9a2dce96add60aeb..9fb9562031283fea911a9d7bd2b0ccec587d399e 100644 (file)
@@ -1555,7 +1555,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;
index d8b7ce58c7e6fc872a1cfe71822c2c9ad8b46c0e..dab955135898f03d4634cf3d859cec80aa0a6030 100644 (file)
@@ -1614,6 +1614,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
             tsc += __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
             regs->eax = (uint32_t)tsc;
             regs->edx = (uint32_t)(tsc >> 32);
+            update_guest_eip();
 
             return 1;
         }
index c4c2fe8b0cb1e78b47778a4a604aee02cdd221c9..aa5b0809d163903e71aca9221724cbac54a38c99 100644 (file)
@@ -399,6 +399,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)