WARNING - OLD ARCHIVES

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

xen-changelog

[Xen-changelog] [xen-3.0-testing] x86/64 Linux: destroy entire init memo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0-testing] x86/64 Linux: destroy entire init memory mapping beyond kernel image.
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 07 Jun 2006 19:15:21 +0000
Delivery-date: Wed, 07 Jun 2006 12:17:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID b8aa9f40d67a5f94577957b9cc9578fd8e75fb53
# Parent  89ba6c7b4804bb30ecd95a478a4be6e6decec2e7
x86/64 Linux: destroy entire init memory mapping beyond kernel image.
Avoids overlap with modules mapping area.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
xen-unstable changeset:   10287:ec903b8e6612eba5c90451fcb1bbb25d34cd88e4
xen-unstable date:        Wed Jun  7 11:24:44 2006 +0100
---
 linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c |   16 ------------
 linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c      |   26 ++++++++++++++++----
 2 files changed, 21 insertions(+), 21 deletions(-)

diff -r 89ba6c7b4804 -r b8aa9f40d67a 
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Tue Jun 06 
10:45:21 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Wed Jun 07 
11:25:31 2006 +0100
@@ -823,14 +823,6 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_XEN
        {
                int i, j, k, fpp;
-               unsigned long va;
-
-               /* 'Initial mapping' of initrd must be destroyed. */
-               for (va = xen_start_info->mod_start;
-                    va < (xen_start_info->mod_start+xen_start_info->mod_len);
-                    va += PAGE_SIZE) {
-                       HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0);
-               }
 
                if (!xen_feature(XENFEAT_auto_translated_physmap)) {
                        /* Make sure we have a large enough P->M table. */
@@ -845,14 +837,6 @@ void __init setup_arch(char **cmdline_p)
                                __pa(xen_start_info->mfn_list),
                                PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
                                                sizeof(unsigned long))));
-
-                       /* Destroyed 'initial mapping' of old p2m table. */
-                       for (va = xen_start_info->mfn_list;
-                            va < (xen_start_info->mfn_list +
-                                  (xen_start_info->nr_pages*sizeof(unsigned 
long)));
-                            va += PAGE_SIZE) {
-                               HYPERVISOR_update_va_mapping(va, __pte_ma(0), 
0);
-                       }
 
                        /*
                         * Initialise the list of the frames that specify the
diff -r 89ba6c7b4804 -r b8aa9f40d67a 
linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c    Tue Jun 06 10:45:21 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c    Wed Jun 07 11:25:31 
2006 +0100
@@ -661,13 +661,29 @@ void __meminit init_memory_mapping(unsig
        }
 
        if (!after_bootmem) {
-               BUG_ON(start_pfn != table_start + (tables_space >> PAGE_SHIFT));
-               /*
-                * Destroy the temporary mappings created above. Prevents
+               BUG_ON(start_pfn != table_start + (tables_space>>PAGE_SHIFT));
+
+               /* Re-vector virtual addresses pointing into the initial
+                  mapping to the just-established permanent ones. */
+               xen_start_info = __va(__pa(xen_start_info));
+               xen_start_info->pt_base = (unsigned long)
+                       __va(__pa(xen_start_info->pt_base));
+               if (!xen_feature(XENFEAT_auto_translated_physmap)) {
+                       phys_to_machine_mapping =
+                               __va(__pa(xen_start_info->mfn_list));
+                       xen_start_info->mfn_list = (unsigned long)
+                               phys_to_machine_mapping;
+               }
+               if (xen_start_info->mod_start)
+                       xen_start_info->mod_start = (unsigned long)
+                               __va(__pa(xen_start_info->mod_start));
+
+               /* Destroy the Xen-created mappings beyond the kernel image as
+                * well as the temporary mappings created above. Prevents
                 * overlap with modules area (if init mapping is very big).
                 */
-               start = __START_KERNEL_map + (table_start << PAGE_SHIFT);
-               end   = start + tables_space;
+               start = PAGE_ALIGN((unsigned long)_end);
+               end   = __START_KERNEL_map + (start_pfn << PAGE_SHIFT);
                for (; start < end; start += PAGE_SIZE)
                        WARN_ON(HYPERVISOR_update_va_mapping(
                                start, __pte_ma(0), 0));

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0-testing] x86/64 Linux: destroy entire init memory mapping beyond kernel image., Xen patchbot-3 . 0-testing <=