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] With this patch, 32-bit binary can work on 64-bit VMX gu

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] With this patch, 32-bit binary can work on 64-bit VMX guest.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 10 Sep 2005 14:26:15 +0000
Delivery-date: Sat, 10 Sep 2005 14:24:55 +0000
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID aa1adbeecfcdafeb2cea4d4991368ff168a9329b
# Parent  20b6be0e1fa1feaf7942fdde976efa0bbac5c22d
With this patch, 32-bit binary can work on 64-bit VMX guest.

Signed-off-by: Chengyuan Li <chengyuan.li@xxxxxxxxx>
Signed-off-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>
Signed-off-by: Asit Mallick <asit.k.mallick@xxxxxxxxx>

diff -r 20b6be0e1fa1 -r aa1adbeecfcd xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c        Sat Sep 10 14:22:12 2005
+++ b/xen/arch/x86/vmx.c        Sat Sep 10 14:24:39 2005
@@ -1394,21 +1394,20 @@
 
 static inline void vmx_do_msr_read(struct cpu_user_regs *regs)
 {
+    u64 msr_content = 0;
+
     VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read: ecx=%lx, eax=%lx, edx=%lx",
                 (unsigned long)regs->ecx, (unsigned long)regs->eax, 
                 (unsigned long)regs->edx);
     switch (regs->ecx) {
         case MSR_IA32_SYSENTER_CS:
-            __vmread(GUEST_SYSENTER_CS, &regs->eax);
-            regs->edx = 0;
-            break;
-        case MSR_IA32_SYSENTER_ESP:    
-             __vmread(GUEST_SYSENTER_ESP, &regs->eax);
-             regs->edx = 0;
-            break;
-        case MSR_IA32_SYSENTER_EIP:            
-            __vmread(GUEST_SYSENTER_EIP, &regs->eax);
-            regs->edx = 0;
+            __vmread(GUEST_SYSENTER_CS, (u32 *)&msr_content);
+            break;
+        case MSR_IA32_SYSENTER_ESP:
+             __vmread(GUEST_SYSENTER_ESP, &msr_content);
+            break;
+        case MSR_IA32_SYSENTER_EIP:
+            __vmread(GUEST_SYSENTER_EIP, &msr_content);
             break;
         default:
             if(long_mode_do_msr_read(regs))
@@ -1417,6 +1416,9 @@
             break;
     }
 
+    regs->eax = msr_content & 0xFFFFFFFF;
+    regs->edx = msr_content >> 32;
+
     VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read returns: "
                 "ecx=%lx, eax=%lx, edx=%lx",
                 (unsigned long)regs->ecx, (unsigned long)regs->eax,
@@ -1425,18 +1427,23 @@
 
 static inline void vmx_do_msr_write(struct cpu_user_regs *regs)
 {
+    u64 msr_content;
+
     VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_write: ecx=%lx, eax=%lx, edx=%lx",
                 (unsigned long)regs->ecx, (unsigned long)regs->eax, 
                 (unsigned long)regs->edx);
+
+    msr_content = (regs->eax & 0xFFFFFFFF) | ((u64)regs->edx << 32);
+
     switch (regs->ecx) {
         case MSR_IA32_SYSENTER_CS:
-            __vmwrite(GUEST_SYSENTER_CS, regs->eax);
-            break;
-        case MSR_IA32_SYSENTER_ESP:    
-             __vmwrite(GUEST_SYSENTER_ESP, regs->eax);
-            break;
-        case MSR_IA32_SYSENTER_EIP:            
-            __vmwrite(GUEST_SYSENTER_EIP, regs->eax);
+            __vmwrite(GUEST_SYSENTER_CS, msr_content);
+            break;
+        case MSR_IA32_SYSENTER_ESP:
+             __vmwrite(GUEST_SYSENTER_ESP, msr_content);
+            break;
+        case MSR_IA32_SYSENTER_EIP:
+            __vmwrite(GUEST_SYSENTER_EIP, msr_content);
             break;
         default:
             long_mode_do_msr_write(regs);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] With this patch, 32-bit binary can work on 64-bit VMX guest., Xen patchbot -unstable <=