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] Turn page-structure layout assertions into BUILD_BUG_ON(

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Turn page-structure layout assertions into BUILD_BUG_ON().
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 03 May 2006 08:32:08 +0000
Delivery-date: Wed, 03 May 2006 01:33:18 -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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 3f69d30f697d92b415092eba9e47f5ac57823785
# Parent  decf309fb47b3f4246540a5e1327663651d266fe
Turn page-structure layout assertions into BUILD_BUG_ON().
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r decf309fb47b -r 3f69d30f697d xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c  Tue May 02 17:23:21 2006 +0100
+++ b/xen/arch/x86/x86_32/mm.c  Wed May 03 07:44:20 2006 +0100
@@ -155,17 +155,10 @@ void subarch_init_memory(void)
      * 64-bit operations on them. Also, just for sanity, we assert the size
      * of the structure here.
      */
-    if ( (offsetof(struct page_info, u.inuse._domain) != 
-          (offsetof(struct page_info, count_info) + sizeof(u32))) ||
-         ((offsetof(struct page_info, count_info) & 7) != 0) ||
-         (sizeof(struct page_info) != 24) )
-    {
-        printk("Weird page_info layout (%ld,%ld,%d)\n",
-               offsetof(struct page_info, count_info),
-               offsetof(struct page_info, u.inuse._domain),
-               sizeof(struct page_info));
-        BUG();
-    }
+    BUILD_BUG_ON(offsetof(struct page_info, u.inuse._domain) != 
+                 (offsetof(struct page_info, count_info) + sizeof(u32)));
+    BUILD_BUG_ON((offsetof(struct page_info, count_info) & 7) != 0);
+    BUILD_BUG_ON(sizeof(struct page_info) != 24);
 
     /* M2P table is mappable read-only by privileged domains. */
     for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
diff -r decf309fb47b -r 3f69d30f697d xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c  Tue May 02 17:23:21 2006 +0100
+++ b/xen/arch/x86/x86_64/mm.c  Wed May 03 07:44:20 2006 +0100
@@ -145,19 +145,11 @@ void subarch_init_memory(void)
      * count_info and domain fields must be adjacent, as we perform atomic
      * 64-bit operations on them.
      */
-    if ( ((offsetof(struct page_info, u.inuse._domain) != 
-           (offsetof(struct page_info, count_info) + sizeof(u32)))) ||
-         ((offsetof(struct page_info, count_info) & 7) != 0) ||
-         (sizeof(struct page_info) !=
-          (32 + BITS_TO_LONGS(NR_CPUS)*sizeof(long))) )
-    {
-        printk("Weird page_info layout (%ld,%ld,%ld,%ld)\n",
-               offsetof(struct page_info, count_info),
-               offsetof(struct page_info, u.inuse._domain),
-               sizeof(struct page_info),
-               32 + BITS_TO_LONGS(NR_CPUS)*sizeof(long));
-        for ( ; ; ) ;
-    }
+    BUILD_BUG_ON(offsetof(struct page_info, u.inuse._domain) != 
+                 (offsetof(struct page_info, count_info) + sizeof(u32)));
+    BUILD_BUG_ON((offsetof(struct page_info, count_info) & 7) != 0);
+    BUILD_BUG_ON(sizeof(struct page_info) !=
+                 (32 + BITS_TO_LONGS(NR_CPUS)*sizeof(long)));
 
     /* M2P table is mappable read-only by privileged domains. */
     for ( v  = RDWR_MPT_VIRT_START; 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Turn page-structure layout assertions into BUILD_BUG_ON()., Xen patchbot -unstable <=