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] Tighten up the assertion conditions in the GUEST_MODE()

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Tighten up the assertion conditions in the GUEST_MODE() macro.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 07 Mar 2006 14:42:07 +0000
Delivery-date: Tue, 07 Mar 2006 14:42:47 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 51c59d5d76b05dc5ce849e8e983f1683d7096881
# Parent  583d01868d17c622b1dff036ebac353192b02611
Tighten up the assertion conditions in the GUEST_MODE() macro.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 583d01868d17 -r 51c59d5d76b0 xen/include/asm-x86/regs.h
--- a/xen/include/asm-x86/regs.h        Mon Mar  6 22:50:30 2006
+++ b/xen/include/asm-x86/regs.h        Tue Mar  7 13:40:23 2006
@@ -36,10 +36,12 @@
     unsigned long diff = (char *)guest_cpu_user_regs() - (char *)(r);         \
     /* Frame pointer must point into current CPU stack. */                    \
     ASSERT(diff < STACK_SIZE);                                                \
-    /* If a guest frame, it must not be a ring 0 frame (unless HVM guest). */ \
-    ASSERT((diff != 0) || VM86_MODE(r) || !RING_0(r) || HVM_DOMAIN(current)); \
-    /* If not a guest frame, it must be a ring 0 frame. */                    \
-    ASSERT((diff == 0) || (!VM86_MODE(r) && RING_0(r)));                      \
+    /* If a guest frame, it must be have guest privs (unless HVM guest).   */ \
+    /* We permit CS==0 which can come from an uninitialised trap entry. */    \
+    ASSERT((diff != 0) || VM86_MODE(r) || ((r->cs&3) >= GUEST_KERNEL_RPL) ||  \
+           (r->cs == 0) || HVM_DOMAIN(current));                              \
+    /* If not a guest frame, it must be a hypervisor frame. */                \
+    ASSERT((diff == 0) || (!VM86_MODE(r) && (r->cs == __HYPERVISOR_CS)));     \
     /* Return TRUE if it's a guest frame. */                                  \
     (diff == 0);                                                              \
 })

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Tighten up the assertion conditions in the GUEST_MODE() macro., Xen patchbot -unstable <=