[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.2-testing] x86: change _PAGE_GNTTAB



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224177379 -3600
# Node ID 7c0934ea1fe546f3d7c02b30d03cd30d3d9cad91
# Parent  25004bebfcd52ed11f0f22c390722826ff80d6df
x86: change _PAGE_GNTTAB

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>
xen-unstable changeset:   18538:7750906b06b3
xen-unstable date:        Wed Sep 24 10:23:51 2008 +0100
---
 xen/include/asm-x86/page.h        |    7 ++++---
 xen/include/asm-x86/x86_64/page.h |    3 +++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff -r 25004bebfcd5 -r 7c0934ea1fe5 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h        Thu Oct 16 18:15:00 2008 +0100
+++ b/xen/include/asm-x86/page.h        Thu Oct 16 18:16:19 2008 +0100
@@ -315,9 +315,10 @@ void setup_idle_pagetable(void);
  * WARNING: This will need to be disabled to run OSes that use the spare PTE
  * bits themselves (e.g., *BSD).
  */
-#ifndef NDEBUG
-#define _PAGE_GNTTAB   _PAGE_AVAIL2
-#else
+#ifdef NDEBUG
+#undef _PAGE_GNTTAB
+#endif
+#ifndef _PAGE_GNTTAB
 #define _PAGE_GNTTAB   0
 #endif
 
diff -r 25004bebfcd5 -r 7c0934ea1fe5 xen/include/asm-x86/x86_64/page.h
--- a/xen/include/asm-x86/x86_64/page.h Thu Oct 16 18:15:00 2008 +0100
+++ b/xen/include/asm-x86/x86_64/page.h Thu Oct 16 18:16:19 2008 +0100
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.