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 emulate: Correctly probe when we are

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvm emulate: Correctly probe when we are in 64-bit mode and set
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 03 Mar 2008 07:30:38 -0800
Delivery-date: Mon, 03 Mar 2008 07:32:35 -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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1204557579 0
# Node ID 7530c4dba8a5d8970d23f502369a342ee82a6541
# Parent  d0daf11fb35dab676e5e4ef9b1c02da649e4f9af
hvm emulate: Correctly probe when we are in 64-bit mode and set
address-size default appropriately.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/emulate.c      |   21 +++++++++++++++------
 xen/arch/x86/mm/shadow/common.c |    4 ----
 2 files changed, 15 insertions(+), 10 deletions(-)

diff -r d0daf11fb35d -r 7530c4dba8a5 xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c        Mon Mar 03 13:54:05 2008 +0000
+++ b/xen/arch/x86/hvm/emulate.c        Mon Mar 03 15:19:39 2008 +0000
@@ -673,14 +673,23 @@ int hvm_emulate_one(
     struct hvm_emulate_ctxt *hvmemul_ctxt)
 {
     struct cpu_user_regs *regs = hvmemul_ctxt->ctxt.regs;
+    struct vcpu *curr = current;
     uint32_t new_intr_shadow;
     unsigned long addr;
     int rc;
 
-    hvmemul_ctxt->ctxt.addr_size =
-        hvmemul_ctxt->seg_reg[x86_seg_cs].attr.fields.db ? 32 : 16;
-    hvmemul_ctxt->ctxt.sp_size =
-        hvmemul_ctxt->seg_reg[x86_seg_ss].attr.fields.db ? 32 : 16;
+    if ( hvm_long_mode_enabled(curr) &&
+         hvmemul_ctxt->seg_reg[x86_seg_cs].attr.fields.l )
+    {
+        hvmemul_ctxt->ctxt.addr_size = hvmemul_ctxt->ctxt.sp_size = 64;
+    }
+    else
+    {
+        hvmemul_ctxt->ctxt.addr_size =
+            hvmemul_ctxt->seg_reg[x86_seg_cs].attr.fields.db ? 32 : 16;
+        hvmemul_ctxt->ctxt.sp_size =
+            hvmemul_ctxt->seg_reg[x86_seg_ss].attr.fields.db ? 32 : 16;
+    }
 
     hvmemul_ctxt->insn_buf_eip = regs->eip;
     hvmemul_ctxt->insn_buf_bytes =
@@ -715,11 +724,11 @@ int hvm_emulate_one(
     if ( hvmemul_ctxt->intr_shadow != new_intr_shadow )
     {
         hvmemul_ctxt->intr_shadow = new_intr_shadow;
-        hvm_funcs.set_interrupt_shadow(current, new_intr_shadow);
+        hvm_funcs.set_interrupt_shadow(curr, new_intr_shadow);
     }
 
     if ( hvmemul_ctxt->ctxt.retire.flags.hlt &&
-         !hvm_local_events_need_delivery(current) )
+         !hvm_local_events_need_delivery(curr) )
     {
         hvm_hlt(regs->eflags);
     }
diff -r d0daf11fb35d -r 7530c4dba8a5 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Mon Mar 03 13:54:05 2008 +0000
+++ b/xen/arch/x86/mm/shadow/common.c   Mon Mar 03 15:19:39 2008 +0000
@@ -401,10 +401,6 @@ struct x86_emulate_ops *shadow_init_emul
     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 )
-    {
-        sh_ctxt->ctxt.addr_size = sh_ctxt->ctxt.sp_size = 16;
     }
     else
     {

_______________________________________________
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 emulate: Correctly probe when we are in 64-bit mode and set, Xen patchbot-unstable <=