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-unstable] [HVM] Fix calculation of address size in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM] Fix calculation of address size in long mode.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Jan 2007 19:35:09 -0800
Delivery-date: Mon, 15 Jan 2007 19:35:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1168876731 0
# Node ID ef23a0150abbfac85bf1c51d50c6acad1dd9f300
# Parent  0ba81aa56455be37c2d5c19920f3633ad267604c
[HVM] Fix calculation of address size in long mode.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/svm.c      |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c      |    7 +++----
 xen/arch/x86/mm/shadow/common.c |   11 +++--------
 3 files changed, 8 insertions(+), 14 deletions(-)

diff -r 0ba81aa56455 -r ef23a0150abb xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Mon Jan 15 15:43:20 2007 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c        Mon Jan 15 15:58:51 2007 +0000
@@ -482,8 +482,8 @@ static int svm_guest_x86_mode(struct vcp
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
 
-    if ( vmcb->efer & EFER_LMA )
-        return (vmcb->cs.attr.fields.l ? 8 : 4);
+    if ( (vmcb->efer & EFER_LMA) && vmcb->cs.attr.fields.l )
+        return 8;
 
     if ( svm_realmode(v) )
         return 2;
diff -r 0ba81aa56455 -r ef23a0150abb xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Mon Jan 15 15:43:20 2007 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Mon Jan 15 15:58:51 2007 +0000
@@ -491,8 +491,7 @@ static unsigned long vmx_get_segment_bas
     ASSERT(v == current);
 
 #ifdef __x86_64__
-    if ( vmx_long_mode_enabled(v) &&
-         (__vmread(GUEST_CS_AR_BYTES) & (1u<<13)) )
+    if ( vmx_long_mode_enabled(v) && (__vmread(GUEST_CS_AR_BYTES) & (1u<<13)) )
         long_mode = 1;
 #endif
 
@@ -667,8 +666,8 @@ static int vmx_guest_x86_mode(struct vcp
 
     cs_ar_bytes = __vmread(GUEST_CS_AR_BYTES);
 
-    if ( vmx_long_mode_enabled(v) )
-        return ((cs_ar_bytes & (1u<<13)) ? 8 : 4);
+    if ( vmx_long_mode_enabled(v) && (cs_ar_bytes & (1u<<13)) )
+        return 8;
 
     if ( vmx_realmode(v) )
         return 2;
diff -r 0ba81aa56455 -r ef23a0150abb xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Mon Jan 15 15:43:20 2007 +0000
+++ b/xen/arch/x86/mm/shadow/common.c   Mon Jan 15 15:58:51 2007 +0000
@@ -416,14 +416,9 @@ struct x86_emulate_ops *shadow_init_emul
     creg = hvm_get_seg_reg(x86_seg_cs, sh_ctxt);
 
     /* Work out the emulation mode. */
-    if ( hvm_long_mode_enabled(v) )
-    {
-        sh_ctxt->ctxt.addr_size = creg->attr.fields.l ? 64 : 32;
-        if ( (sh_ctxt->ctxt.sp_size = sh_ctxt->ctxt.addr_size) != 64 )
-        {
-            sreg = hvm_get_seg_reg(x86_seg_ss, sh_ctxt);
-            sh_ctxt->ctxt.sp_size = sreg->attr.fields.db ? 32 : 16;
-        }
+    if ( hvm_long_mode_enabled(v) && creg->attr.fields.l )
+    {
+        sh_ctxt->ctxt.addr_size = sh_ctxt->ctxt.sp_size = 64;
     }
     else if ( regs->eflags & X86_EFLAGS_VM )
     {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [HVM] Fix calculation of address size in long mode., Xen patchbot-unstable <=