ia64/xen-unstable

changeset 18541:7750906b06b3

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@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Sep 24 10:23:51 2008 +0100 (2008-09-24)
parents 1eeb3aecea57
children 31f09a5e24cf
files xen/include/asm-x86/page.h xen/include/asm-x86/x86_64/page.h
line diff
     1.1 --- a/xen/include/asm-x86/page.h	Wed Sep 24 10:20:49 2008 +0100
     1.2 +++ b/xen/include/asm-x86/page.h	Wed Sep 24 10:23:51 2008 +0100
     1.3 @@ -302,9 +302,10 @@ unsigned long clone_idle_pagetable(struc
     1.4   * WARNING: This will need to be disabled to run OSes that use the spare PTE
     1.5   * bits themselves (e.g., *BSD).
     1.6   */
     1.7 -#ifndef NDEBUG
     1.8 -#define _PAGE_GNTTAB   _PAGE_AVAIL2
     1.9 -#else
    1.10 +#ifdef NDEBUG
    1.11 +#undef _PAGE_GNTTAB
    1.12 +#endif
    1.13 +#ifndef _PAGE_GNTTAB
    1.14  #define _PAGE_GNTTAB   0
    1.15  #endif
    1.16  
     2.1 --- a/xen/include/asm-x86/x86_64/page.h	Wed Sep 24 10:20:49 2008 +0100
     2.2 +++ b/xen/include/asm-x86/x86_64/page.h	Wed Sep 24 10:23:51 2008 +0100
     2.3 @@ -104,6 +104,9 @@ typedef l4_pgentry_t root_pgentry_t;
     2.4  #define _PAGE_NX_BIT (1U<<23)
     2.5  #define _PAGE_NX     (cpu_has_nx ? _PAGE_NX_BIT : 0U)
     2.6  
     2.7 +/* Bit 22 of a 24-bit flag mask. This corresponds to bit 62 of a pte.*/
     2.8 +#define _PAGE_GNTTAB (1U<<22)
     2.9 +
    2.10  /*
    2.11   * Disallow unused flag bits plus PAT/PSE, PCD, PWT and GLOBAL.
    2.12   * Permit the NX bit if the hardware supports it.