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

[Xen-changelog] [xen-unstable] Remove no-pv-compat cmdline option.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1183986382 -3600
# Node ID ecb89c6ce615d1dab0036b36c0fdb5a3e1b3faf7
# Parent  231bfe08fdbf89a6db16cbe8c51dd4862a31976a
Remove no-pv-compat cmdline option.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/domain.c      |    2 
 xen/arch/x86/e820.c        |   34 -------------
 xen/arch/x86/x86_64/mm.c   |  113 ++++++++++++++++++++-------------------------
 xen/common/compat/kernel.c |    3 -
 xen/include/asm-x86/mm.h   |    3 -
 xen/include/xen/compat.h   |    2 
 6 files changed, 53 insertions(+), 104 deletions(-)

diff -r 231bfe08fdbf -r ecb89c6ce615 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Mon Jul 09 12:04:20 2007 +0100
+++ b/xen/arch/x86/domain.c     Mon Jul 09 14:06:22 2007 +0100
@@ -308,8 +308,6 @@ int switch_compat(struct domain *d)
 
     if ( d == NULL )
         return -EINVAL;
-    if ( compat_disabled )
-        return -ENOSYS;
     if ( !may_switch_mode(d) )
         return -EACCES;
     if ( is_pv_32on64_domain(d) )
diff -r 231bfe08fdbf -r ecb89c6ce615 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c       Mon Jul 09 12:04:20 2007 +0100
+++ b/xen/arch/x86/e820.c       Mon Jul 09 14:06:22 2007 +0100
@@ -342,39 +342,6 @@ static void __init clip_4gb(void)
 #define clip_4gb() ((void)0)
 #endif
 
-#ifdef CONFIG_COMPAT
-static void __init clip_compat(void)
-{
-    unsigned long long limit;
-    unsigned int i;
-
-    if ( compat_disabled )
-        return;
-    /* 32-bit guests restricted to 166 GB (with current memory allocator). */
-    limit = (unsigned long long)(MACH2PHYS_COMPAT_VIRT_END -
-                                 __HYPERVISOR_COMPAT_VIRT_START) << 10;
-    for ( i = 0; i < e820.nr_map; i++ )
-    {
-        if ( (e820.map[i].addr + e820.map[i].size) <= limit )
-            continue;
-        printk("WARNING: Only the first %Lu GB of the physical memory map "
-               "can be accessed\n"
-               "         by compatibility mode guests. "
-               "Truncating the memory map...\n",
-              limit >> 30);
-        if ( e820.map[i].addr >= limit )
-            e820.nr_map = i;
-        else
-        {
-            e820.map[i].size = limit - e820.map[i].addr;
-            e820.nr_map = i + 1;
-        }
-    }
-}
-#else
-#define clip_compat() ((void)0)
-#endif
-
 static void __init clip_mem(void)
 {
     int i;
@@ -408,7 +375,6 @@ static void __init machine_specific_memo
     *raw_nr = nr;
     (void)copy_e820_map(raw, nr);
     clip_4gb();
-    clip_compat();
     clip_mem();
 }
 
diff -r 231bfe08fdbf -r ecb89c6ce615 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c  Mon Jul 09 12:04:20 2007 +0100
+++ b/xen/arch/x86/x86_64/mm.c  Mon Jul 09 14:06:22 2007 +0100
@@ -145,47 +145,42 @@ void __init paging_init(void)
         l2_ro_mpt++;
     }
 
-#ifdef CONFIG_COMPAT
-    if ( !compat_disabled )
-    {
-        /* Create user-accessible L2 directory to map the MPT for 
compatibility guests. */
-        BUILD_BUG_ON(l4_table_offset(RDWR_MPT_VIRT_START) !=
-                     l4_table_offset(HIRO_COMPAT_MPT_VIRT_START));
-        l3_ro_mpt = 
l4e_to_l3e(idle_pg_table[l4_table_offset(HIRO_COMPAT_MPT_VIRT_START)]);
-        if ( (l2_pg = alloc_domheap_page(NULL)) == NULL )
+    /* Create user-accessible L2 directory to map the MPT for compat guests. */
+    BUILD_BUG_ON(l4_table_offset(RDWR_MPT_VIRT_START) !=
+                 l4_table_offset(HIRO_COMPAT_MPT_VIRT_START));
+    l3_ro_mpt = l4e_to_l3e(idle_pg_table[l4_table_offset(
+        HIRO_COMPAT_MPT_VIRT_START)]);
+    if ( (l2_pg = alloc_domheap_page(NULL)) == NULL )
+        goto nomem;
+    compat_idle_pg_table_l2 = l2_ro_mpt = page_to_virt(l2_pg);
+    clear_page(l2_ro_mpt);
+    l3e_write(&l3_ro_mpt[l3_table_offset(HIRO_COMPAT_MPT_VIRT_START)],
+              l3e_from_page(l2_pg, __PAGE_HYPERVISOR));
+    l2_ro_mpt += l2_table_offset(HIRO_COMPAT_MPT_VIRT_START);
+    /* Allocate and map the compatibility mode machine-to-phys table. */
+    mpt_size = (mpt_size >> 1) + (1UL << (L2_PAGETABLE_SHIFT - 1));
+    if ( mpt_size > RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START )
+        mpt_size = RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START;
+    mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
+    if ( m2p_compat_vstart + mpt_size < MACH2PHYS_COMPAT_VIRT_END )
+        m2p_compat_vstart = MACH2PHYS_COMPAT_VIRT_END - mpt_size;
+    for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
+    {
+        if ( (l1_pg = alloc_domheap_pages(NULL, PAGETABLE_ORDER, 0)) == NULL )
             goto nomem;
-        compat_idle_pg_table_l2 = l2_ro_mpt = page_to_virt(l2_pg);
-        clear_page(l2_ro_mpt);
-        l3e_write(&l3_ro_mpt[l3_table_offset(HIRO_COMPAT_MPT_VIRT_START)],
-                  l3e_from_page(l2_pg, __PAGE_HYPERVISOR));
-        l2_ro_mpt += l2_table_offset(HIRO_COMPAT_MPT_VIRT_START);
-        /*
-         * Allocate and map the compatibility mode machine-to-phys table.
-        */
-        mpt_size = (mpt_size >> 1) + (1UL << (L2_PAGETABLE_SHIFT - 1));
-        if ( mpt_size > RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START )
-            mpt_size = RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START;
-        mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
-        if ( m2p_compat_vstart + mpt_size < MACH2PHYS_COMPAT_VIRT_END )
-            m2p_compat_vstart = MACH2PHYS_COMPAT_VIRT_END - mpt_size;
-        for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
-        {
-            if ( (l1_pg = alloc_domheap_pages(NULL, PAGETABLE_ORDER, 0)) == 
NULL )
-                goto nomem;
-            map_pages_to_xen(
-                RDWR_COMPAT_MPT_VIRT_START + (i << L2_PAGETABLE_SHIFT),
-                page_to_mfn(l1_pg),
-                1UL << PAGETABLE_ORDER,
-                PAGE_HYPERVISOR);
-            memset((void *)(RDWR_COMPAT_MPT_VIRT_START + (i << 
L2_PAGETABLE_SHIFT)),
-                   0x55,
-                   1UL << L2_PAGETABLE_SHIFT);
-            /* NB. Cannot be GLOBAL as the pt entries get copied into per-VM 
space. */
-            l2e_write(l2_ro_mpt, l2e_from_page(l1_pg, 
_PAGE_PSE|_PAGE_PRESENT));
-            l2_ro_mpt++;
-        }
-    }
-#endif
+        map_pages_to_xen(
+            RDWR_COMPAT_MPT_VIRT_START + (i << L2_PAGETABLE_SHIFT),
+            page_to_mfn(l1_pg),
+            1UL << PAGETABLE_ORDER,
+            PAGE_HYPERVISOR);
+        memset((void *)(RDWR_COMPAT_MPT_VIRT_START +
+                        (i << L2_PAGETABLE_SHIFT)),
+               0x55,
+               1UL << L2_PAGETABLE_SHIFT);
+        /* NB. Cannot be GLOBAL as the ptes get copied into per-VM space. */
+        l2e_write(l2_ro_mpt, l2e_from_page(l1_pg, _PAGE_PSE|_PAGE_PRESENT));
+        l2_ro_mpt++;
+    }
 
     /* Set up linear page table mapping. */
     l4e_write(&idle_pg_table[l4_table_offset(LINEAR_PT_VIRT_START)],
@@ -255,30 +250,26 @@ void __init subarch_init_memory(void)
             share_xen_page_with_privileged_guests(page, XENSHARE_readonly);
         }
     }
-#ifdef CONFIG_COMPAT
-    if ( !compat_disabled )
-    {
-        for ( v  = RDWR_COMPAT_MPT_VIRT_START;
-              v != RDWR_COMPAT_MPT_VIRT_END;
-              v += 1 << L2_PAGETABLE_SHIFT )
+
+    for ( v  = RDWR_COMPAT_MPT_VIRT_START;
+          v != RDWR_COMPAT_MPT_VIRT_END;
+          v += 1 << L2_PAGETABLE_SHIFT )
+    {
+        l3e = l4e_to_l3e(idle_pg_table[l4_table_offset(v)])[
+            l3_table_offset(v)];
+        if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
+            continue;
+        l2e = l3e_to_l2e(l3e)[l2_table_offset(v)];
+        if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
+            continue;
+        m2p_start_mfn = l2e_get_pfn(l2e);
+
+        for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
         {
-            l3e = l4e_to_l3e(idle_pg_table[l4_table_offset(v)])[
-                l3_table_offset(v)];
-            if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
-                continue;
-            l2e = l3e_to_l2e(l3e)[l2_table_offset(v)];
-            if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
-                continue;
-            m2p_start_mfn = l2e_get_pfn(l2e);
-
-            for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
-            {
-                struct page_info *page = mfn_to_page(m2p_start_mfn + i);
-                share_xen_page_with_privileged_guests(page, XENSHARE_readonly);
-            }
+            struct page_info *page = mfn_to_page(m2p_start_mfn + i);
+            share_xen_page_with_privileged_guests(page, XENSHARE_readonly);
         }
     }
-#endif
 }
 
 long subarch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
diff -r 231bfe08fdbf -r ecb89c6ce615 xen/common/compat/kernel.c
--- a/xen/common/compat/kernel.c        Mon Jul 09 12:04:20 2007 +0100
+++ b/xen/common/compat/kernel.c        Mon Jul 09 14:06:22 2007 +0100
@@ -45,9 +45,6 @@ CHECK_TYPE(domain_handle);
 
 #include "../kernel.c"
 
-int compat_disabled = 0;
-boolean_param("no-pv-compat", compat_disabled);
-
 /*
  * Local variables:
  * mode: C
diff -r 231bfe08fdbf -r ecb89c6ce615 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h  Mon Jul 09 12:04:20 2007 +0100
+++ b/xen/include/asm-x86/mm.h  Mon Jul 09 14:06:22 2007 +0100
@@ -315,8 +315,7 @@ TYPE_SAFE(unsigned long,mfn);
 #ifdef CONFIG_COMPAT
 #define compat_machine_to_phys_mapping ((unsigned int 
*)RDWR_COMPAT_MPT_VIRT_START)
 #define set_gpfn_from_mfn(mfn, pfn) \
-    ((void)(compat_disabled || \
-            (mfn) >= (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) / 
4 || \
+    ((void)((mfn) >= (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) / 
4 || \
             (compat_machine_to_phys_mapping[(mfn)] = (unsigned int)(pfn))), \
      machine_to_phys_mapping[(mfn)] = (pfn))
 #else
diff -r 231bfe08fdbf -r ecb89c6ce615 xen/include/xen/compat.h
--- a/xen/include/xen/compat.h  Mon Jul 09 12:04:20 2007 +0100
+++ b/xen/include/xen/compat.h  Mon Jul 09 14:06:22 2007 +0100
@@ -165,8 +165,6 @@
                 [1 - (&((k xen_ ## n *)0)->f1.f2.f3 != \
                    &((k compat_ ## n *)0)->f1.f2.f3) * 2]
 
-extern int compat_disabled;
-
 int hypercall_xlat_continuation(unsigned int *id, unsigned int mask, ...);
 
 /* In-place translation functons: */

_______________________________________________
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®.