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/
Home Products Support Community News


[Xen-devel] [PATCH] x86: change _PAGE_GNTTAB

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: change _PAGE_GNTTAB
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Wed, 24 Sep 2008 10:04:02 +0100
Delivery-date: Wed, 24 Sep 2008 02:03:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Since Linux started to use one of the 3 low available bits, _PAGE_IO
needed to be moved to a different one. Not remembering about
_PAGE_GNTTAB in debug hypervisors, I ended up assigning it to the same
bit, which made the kernel fail on the debug hypervisor. However,
rather than fixing the kernel it seems more appropriate for the
hypervisor to stay away from these bits, not the least because its
definition was anyway accompanied by a warning that this may be
incompatible with certain OSes.

While obviously the hypervisor has to use some bit (and it's therefore
unavoidable that there's some risk of collision), using one of the
high available bits seems to be the better choice over using one of the
three low ones. Since in 32-bit mode these bits are reserved, the patch
disables the functionality here. The only reasonable alternative I
would see is to disable the functionality by default, but add a command
line option to specify which bit to use.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2008-09-19/xen/include/asm-x86/page.h
--- 2008-09-19.orig/xen/include/asm-x86/page.h  2008-09-24 10:50:47.000000000 
+++ 2008-09-19/xen/include/asm-x86/page.h       2008-09-23 13:57:22.000000000 
@@ -302,9 +302,10 @@ unsigned long clone_idle_pagetable(struc
  * WARNING: This will need to be disabled to run OSes that use the spare PTE
  * bits themselves (e.g., *BSD).
-#ifndef NDEBUG
+#ifdef NDEBUG
+#undef _PAGE_GNTTAB
+#ifndef _PAGE_GNTTAB
 #define _PAGE_GNTTAB   0
Index: 2008-09-19/xen/include/asm-x86/x86_64/page.h
--- 2008-09-19.orig/xen/include/asm-x86/x86_64/page.h   2008-09-24 
10:50:47.000000000 +0200
+++ 2008-09-19/xen/include/asm-x86/x86_64/page.h        2008-09-23 
13:59:21.000000000 +0200
@@ -104,6 +104,9 @@ typedef l4_pgentry_t root_pgentry_t;
 #define _PAGE_NX_BIT (1U<<23)
 #define _PAGE_NX     (cpu_has_nx ? _PAGE_NX_BIT : 0U)
+/* Bit 22 of a 24-bit flag mask. This corresponds to bit 62 of a pte.*/
+#define _PAGE_GNTTAB (1U<<22)
  * Disallow unused flag bits plus PAT/PSE, PCD, PWT and GLOBAL.
  * Permit the NX bit if the hardware supports it.

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: change _PAGE_GNTTAB, Jan Beulich <=