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] x86_64: Ensure frame-table compression le

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86_64: Ensure frame-table compression leaves MAX_ORDER aligned
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 03 Sep 2010 09:50:36 -0700
Delivery-date: Fri, 03 Sep 2010 09:52:07 -0700
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 1283332669 -3600
# Node ID 972d90ff31349816cc8c785a8b2defb2f70ed441
# Parent  0eb89b465e46cbc688bcce5f451e125c1650b353
x86_64: Ensure frame-table compression leaves MAX_ORDER aligned
contiguous ranges of page_info structs. This allows page-pointer
arithmetic in places like our buddy allocator.

This restriction was already implicitly guaranteed, but it is good to
make it explicit in the pdx-related initialisation.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/x86_64/mm.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff -r 0eb89b465e46 -r 972d90ff3134 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c  Wed Sep 01 10:17:29 2010 +0100
+++ b/xen/arch/x86/x86_64/mm.c  Wed Sep 01 10:17:49 2010 +0100
@@ -163,9 +163,15 @@ void *do_page_walk(struct vcpu *v, unsig
 
 void __init pfn_pdx_hole_setup(unsigned long mask)
 {
-    unsigned int i, j, bottom_shift, hole_shift;
-
-    for ( hole_shift = bottom_shift = j = 0; ; )
+    unsigned int i, j, bottom_shift = 0, hole_shift = 0;
+
+    /*
+     * We skip the first MAX_ORDER bits, as we never want to compress them.
+     * This guarantees that page-pointer arithmetic remains valid within
+     * contiguous aligned ranges of 2^MAX_ORDER pages. Among others, our
+     * buddy allocator relies on this assumption.
+     */
+    for ( j = MAX_ORDER-1; ; )
     {
         i = find_next_zero_bit(&mask, BITS_PER_LONG, j);
         j = find_next_bit(&mask, BITS_PER_LONG, i);

_______________________________________________
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] x86_64: Ensure frame-table compression leaves MAX_ORDER aligned, Xen patchbot-unstable <=