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-3.1-testing] hvm: Save/restore register state acros

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] hvm: Save/restore register state across hypercalls.
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 May 2007 13:10:26 -0700
Delivery-date: Wed, 09 May 2007 13:10:07 -0700
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 1178721175 -3600
# Node ID c00b2ab8af2ccbb043ba7bd8c965c0682f1c7f10
# Parent  97286205ee2631e3eb811d2001388892ddd1076c
hvm: Save/restore register state across hypercalls.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

xen-unstable changeset:   15022:8df600f56acd31b28ee7d514812605ef8e1862a4
xen-unstable date:        Wed May 09 15:31:37 2007 +0100
---
 xen/arch/x86/hvm/hvm.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff -r 97286205ee26 -r c00b2ab8af2c xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Tue May 08 13:39:52 2007 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Wed May 09 15:32:55 2007 +0100
@@ -778,14 +778,16 @@ static void __hvm_do_hypercall(struct cp
 
 #endif /* defined(__x86_64__) */
 
-int hvm_do_hypercall(struct cpu_user_regs *pregs)
+int hvm_do_hypercall(struct cpu_user_regs *regs)
 {
     int flush, preempted;
     unsigned long old_eip;
 
-    if ( unlikely(ring_3(pregs)) )
-    {
-        pregs->eax = -EPERM;
+    hvm_store_cpu_guest_regs(current, regs, NULL);
+
+    if ( unlikely(ring_3(regs)) )
+    {
+        regs->eax = -EPERM;
         return 0;
     }
 
@@ -794,16 +796,18 @@ int hvm_do_hypercall(struct cpu_user_reg
      * For now we also need to flush when pages are added, as qemu-dm is not
      * yet capable of faulting pages into an existing valid mapcache bucket.
      */
-    flush = ((uint32_t)pregs->eax == __HYPERVISOR_memory_op);
+    flush = ((uint32_t)regs->eax == __HYPERVISOR_memory_op);
 
     /* Check for preemption: RIP will be modified from this dummy value. */
-    old_eip = pregs->eip;
-    pregs->eip = 0xF0F0F0FF;
-
-    __hvm_do_hypercall(pregs);
-
-    preempted = (pregs->eip != 0xF0F0F0FF);
-    pregs->eip = old_eip;
+    old_eip = regs->eip;
+    regs->eip = 0xF0F0F0FF;
+
+    __hvm_do_hypercall(regs);
+
+    preempted = (regs->eip != 0xF0F0F0FF);
+    regs->eip = old_eip;
+
+    hvm_load_cpu_guest_regs(current, regs);
 
     return (preempted ? HVM_HCALL_preempted :
             flush ? HVM_HCALL_invalidate : HVM_HCALL_completed);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.1-testing] hvm: Save/restore register state across hypercalls., Xen patchbot-3.1-testing <=