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

[Xen-changelog] [xen-unstable] vmx: Fix 64-bit asm stub for VM entry/exit.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1190280709 -3600
# Node ID c2d65181174119bc262da42e9d484b351dd0a7ef
# Parent  1902a21dd1ae11f72f377a81fe87035080d37570
vmx: Fix 64-bit asm stub for VM entry/exit.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/x86_64/exits.S |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 1902a21dd1ae -r c2d651811741 xen/arch/x86/hvm/vmx/x86_64/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_64/exits.S       Thu Sep 20 10:13:25 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/x86_64/exits.S       Thu Sep 20 10:31:49 2007 +0100
@@ -25,8 +25,8 @@
 
 #define VMRESUME     .byte 0x0f,0x01,0xc3
 #define VMLAUNCH     .byte 0x0f,0x01,0xc2
-#define VMREAD(off)  .byte 0x0f,0x78,0x44,0x24,off
-#define VMWRITE(off) .byte 0x0f,0x79,0x44,0x24,off
+#define VMREAD(off)  .byte 0x0f,0x78,0x47,((off)-UREGS_rip)
+#define VMWRITE(off) .byte 0x0f,0x79,0x47,((off)-UREGS_rip)
 
 /* VMCS field encodings */
 #define GUEST_RSP    0x681c
@@ -77,8 +77,10 @@ ENTRY(vmx_asm_vmexit_handler)
 ENTRY(vmx_asm_vmexit_handler)
         HVM_SAVE_ALL_NOSEGREGS
 
+        leaq UREGS_rip(%rsp),%rdi
         movl $GUEST_RIP,%eax
-        VMREAD(UREGS_rip)
+        /*VMREAD(UREGS_rip)*/
+        .byte 0x0f,0x78,0x07  /* vmread %rax,(%rdi) */
         movl $GUEST_RSP,%eax
         VMREAD(UREGS_rsp)
         movl $GUEST_RFLAGS,%eax
@@ -110,8 +112,10 @@ ENTRY(vmx_asm_do_vmentry)
         movq %rax,%cr2
         call vmx_trace_vmentry
 
+        leaq UREGS_rip(%rsp),%rdi
         movl $GUEST_RIP,%eax
-        VMWRITE(UREGS_rip)
+        /*VMWRITE(UREGS_rip)*/
+        .byte 0x0f,0x79,0x07  /* vmwrite (%rdi),%rax */
         movl $GUEST_RSP,%eax
         VMWRITE(UREGS_rsp)
         movl $GUEST_RFLAGS,%eax

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.