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] vmx realmode: Emulate writes to control r

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vmx realmode: Emulate writes to control registers.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Nov 2007 22:40:17 -0800
Delivery-date: Mon, 26 Nov 2007 22:41:31 -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 1196099723 0
# Node ID 4d6f92fa1014101fff9f01bb3998ca57b139c9b5
# Parent  f676c0dacbb95c69ad5a3e18ed0ea242a52366f7
vmx realmode: Emulate writes to control registers.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/realmode.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+)

diff -r f676c0dacbb9 -r 4d6f92fa1014 xen/arch/x86/hvm/vmx/realmode.c
--- a/xen/arch/x86/hvm/vmx/realmode.c   Mon Nov 26 17:54:54 2007 +0000
+++ b/xen/arch/x86/hvm/vmx/realmode.c   Mon Nov 26 17:55:23 2007 +0000
@@ -338,6 +338,36 @@ realmode_read_cr(
     return X86EMUL_OKAY;
 }
 
+static int
+realmode_write_cr(
+    unsigned int reg,
+    unsigned long val,
+    struct x86_emulate_ctxt *ctxt)
+{
+    switch ( reg )
+    {
+    case 0:
+        if ( !hvm_set_cr0(val) )
+            return X86EMUL_UNHANDLEABLE;
+        break;
+    case 2:
+        current->arch.hvm_vcpu.guest_cr[2] = val;
+        break;
+    case 3:
+        if ( !hvm_set_cr3(val) )
+            return X86EMUL_UNHANDLEABLE;
+        break;
+    case 4:
+        if ( !hvm_set_cr4(val) )
+            return X86EMUL_UNHANDLEABLE;
+        break;
+    default:
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    return X86EMUL_OKAY;
+}
+
 static int realmode_write_rflags(
     unsigned long val,
     struct x86_emulate_ctxt *ctxt)
@@ -412,6 +442,7 @@ static struct x86_emulate_ops realmode_e
     .read_io       = realmode_read_io,
     .write_io      = realmode_write_io,
     .read_cr       = realmode_read_cr,
+    .write_cr      = realmode_write_cr,
     .write_rflags  = realmode_write_rflags,
     .wbinvd        = realmode_wbinvd,
     .cpuid         = realmode_cpuid,

_______________________________________________
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] vmx realmode: Emulate writes to control registers., Xen patchbot-unstable <=