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] [XEN] don't emulate stack operations on s

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] don't emulate stack operations on shadowed pages
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Feb 2007 09:50:06 -0800
Delivery-date: Fri, 23 Feb 2007 09:49:33 -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 Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1172146889 0
# Node ID 0a970a431bbcbf91162698580f6cbd7578fe8114
# Parent  f62a052384a54a379580a95aa79a70e3fcf86a6d
[XEN] don't emulate stack operations on shadowed pages
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/shadow/multi.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletion(-)

diff -r f62a052384a5 -r 0a970a431bbc xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c    Wed Feb 21 18:38:11 2007 -0800
+++ b/xen/arch/x86/mm/shadow/multi.c    Thu Feb 22 12:21:29 2007 +0000
@@ -2902,7 +2902,23 @@ static int sh_page_fault(struct vcpu *v,
 
     if ( is_hvm_domain(d) )
         hvm_store_cpu_guest_regs(v, regs, NULL);
-    SHADOW_PRINTK("emulate: eip=%#lx\n", (unsigned long)regs->eip);
+    SHADOW_PRINTK("emulate: eip=%#lx esp=%#lx\n", 
+                  (unsigned long)regs->eip, (unsigned long)regs->esp);
+
+    /* Check whether this looks like a stack operation. */
+    if ( (va & PAGE_MASK) == (regs->esp & PAGE_MASK) )
+    {
+        /* Forcibly unshadow and return.  It's important to do this before
+         * we emulate: if the faulting stack operation was the guest handling
+         * an interrupt, then 
+         * (a) the instruction at %eip is irrelevant; and
+         * (b) we might inject some other fault and mask the real one */
+        gdprintk(XENLOG_DEBUG, "guest stack is on a shadowed frame: "
+                 "%%esp=%#lx, cr2=%#lx, mfn=%#lx\n", 
+                 (unsigned long)regs->esp, va, mfn_x(gmfn));
+        sh_remove_shadows(v, gmfn, 0 /* thorough */, 1 /* must succeed */);
+        goto done;
+    }
 
     emul_ops = shadow_init_emulation(&emul_ctxt, regs);
 

_______________________________________________
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] [XEN] don't emulate stack operations on shadowed pages, Xen patchbot-unstable <=