ia64/xen-unstable

changeset 8976:4f4625f80528

Rename XENFEAT_ring0_kernel to slightly more generic XENFEAT_supervisor_mode_kernel.
Add comments in public header version.h to explain what all the different
feature flags mean. Add a new flag XENFEAT_pae_pgdir_above_4gb to inform the guest
that its PAE page directories do not need to conform to the usual hardware
restriction.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Feb 23 11:59:27 2006 +0100 (2006-02-23)
parents ef31d088adeb
children f84d5cdd9895
files linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/segment.h xen/common/kernel.c xen/include/public/version.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S	Thu Feb 23 11:42:19 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S	Thu Feb 23 11:59:27 2006 +0100
     1.3 @@ -182,7 +182,7 @@ ENTRY(_stext)
     1.4  	.ascii  ",FEATURES=writable_page_tables"
     1.5  	.ascii	         "|writable_descriptor_tables"
     1.6  	.ascii	         "|auto_translated_physmap"
     1.7 -	.ascii	         "|ring0_kernel"
     1.8 +	.ascii	         "|supervisor_mode_kernel"
     1.9  #ifdef CONFIG_X86_PAE
    1.10  	.ascii	",PAE=yes"
    1.11  #else
     2.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c	Thu Feb 23 11:42:19 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c	Thu Feb 23 11:59:27 2006 +0100
     2.3 @@ -289,10 +289,11 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
     2.4  	unsigned long flags;
     2.5  
     2.6  	if (PTRS_PER_PMD > 1) {
     2.7 -		/* Ensure pgd resides below 4GB. */
     2.8 -		int rc = xen_create_contiguous_region(
     2.9 -			(unsigned long)pgd, 0, 32);
    2.10 -		BUG_ON(rc);
    2.11 +		if (!xen_feature(XENFEAT_pae_pgdir_above_4gb)) {
    2.12 +			int rc = xen_create_contiguous_region(
    2.13 +				(unsigned long)pgd, 0, 32);
    2.14 +			BUG_ON(rc);
    2.15 +		}
    2.16  		if (HAVE_SHARED_KERNEL_PMD)
    2.17  			memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
    2.18  			       swapper_pg_dir + USER_PTRS_PER_PGD,
     3.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/segment.h	Thu Feb 23 11:42:19 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/segment.h	Thu Feb 23 11:59:27 2006 +0100
     3.3 @@ -61,11 +61,11 @@
     3.4  
     3.5  #define GDT_ENTRY_KERNEL_CS		(GDT_ENTRY_KERNEL_BASE + 0)
     3.6  #define __KERNEL_CS (GDT_ENTRY_KERNEL_CS * 8)
     3.7 -#define GET_KERNEL_CS() (__KERNEL_CS | (xen_feature(XENFEAT_ring0_kernel)?0:1) )
     3.8 +#define GET_KERNEL_CS() (__KERNEL_CS | (xen_feature(XENFEAT_supervisor_mode_kernel)?0:1) )
     3.9  
    3.10  #define GDT_ENTRY_KERNEL_DS		(GDT_ENTRY_KERNEL_BASE + 1)
    3.11  #define __KERNEL_DS (GDT_ENTRY_KERNEL_DS * 8)
    3.12 -#define GET_KERNEL_DS() (__KERNEL_DS | (xen_feature(XENFEAT_ring0_kernel)?0:1) )
    3.13 +#define GET_KERNEL_DS() (__KERNEL_DS | (xen_feature(XENFEAT_supervisor_mode_kernel)?0:1) )
    3.14  
    3.15  #define GDT_ENTRY_TSS			(GDT_ENTRY_KERNEL_BASE + 4)
    3.16  #define GDT_ENTRY_LDT			(GDT_ENTRY_KERNEL_BASE + 5)
     4.1 --- a/xen/common/kernel.c	Thu Feb 23 11:42:19 2006 +0100
     4.2 +++ b/xen/common/kernel.c	Thu Feb 23 11:59:27 2006 +0100
     4.3 @@ -193,7 +193,8 @@ long do_xen_version(int cmd, void *arg)
     4.4              if ( shadow_mode_translate(current->domain) )
     4.5                  fi.submap |= 
     4.6                      (1U << XENFEAT_writable_page_tables) |
     4.7 -                    (1U << XENFEAT_auto_translated_physmap);
     4.8 +                    (1U << XENFEAT_auto_translated_physmap) |
     4.9 +                    (1U << XENFEAT_pae_pgdir_above_4gb);
    4.10              break;
    4.11          default:
    4.12              return -EINVAL;
     5.1 --- a/xen/include/public/version.h	Thu Feb 23 11:42:19 2006 +0100
     5.2 +++ b/xen/include/public/version.h	Thu Feb 23 11:59:27 2006 +0100
     5.3 @@ -48,10 +48,34 @@ typedef struct xen_feature_info {
     5.4      uint32_t     submap;        /* OUT: 32-bit submap */
     5.5  } xen_feature_info_t;
     5.6  
     5.7 +/*
     5.8 + * If set, the guest does not need to write-protect its pagetables, and can
     5.9 + * update them via direct writes.
    5.10 + */
    5.11  #define XENFEAT_writable_page_tables       0
    5.12 +
    5.13 +/*
    5.14 + * If set, the guest does not need to write-protect its segment descriptor
    5.15 + * tables, and can update them via direct writes.
    5.16 + */
    5.17  #define XENFEAT_writable_descriptor_tables 1
    5.18 +
    5.19 +/*
    5.20 + * If set, translation between the guest's 'pseudo-physical' address space
    5.21 + * and the host's machine address space are handled by the hypervisor. In this
    5.22 + * mode the guest does not need to perform phys-to/from-machine translations
    5.23 + * when performing page table operations.
    5.24 + */
    5.25  #define XENFEAT_auto_translated_physmap    2
    5.26 -#define XENFEAT_ring0_kernel               3
    5.27 +
    5.28 +/* If set, the guest is running in supervisor mode (e.g., x86 ring 0). */
    5.29 +#define XENFEAT_supervisor_mode_kernel     3
    5.30 +
    5.31 +/*
    5.32 + * If set, the guest does not need to allocate x86 PAE page directories
    5.33 + * below 4GB. This flag is usually implied by auto_translated_physmap.
    5.34 + */
    5.35 +#define XENFEAT_pae_pgdir_above_4gb        4
    5.36  
    5.37  #define XENFEAT_NR_SUBMAPS 1
    5.38