]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86: change default load address from 1 MiB to 2 MiB
authorDaniel Kiper <daniel.kiper@oracle.com>
Fri, 7 Apr 2017 11:35:32 +0000 (13:35 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Apr 2017 11:35:32 +0000 (13:35 +0200)
Subsequent patches introducing relocatable early boot code play with
page tables using 2 MiB huge pages. If load address is not aligned at
2 MiB then code touching such page tables must have special cases for
start and end of Xen image memory region. So, let's make life easier
and move default load address from 1 MiB to 2 MiB. This way page table
code will be nice and easy. Hence, there is a chance that it will be
less error prone too... :-)))

Additionally, drop first 2 MiB mapping from Xen image mapping.
It is no longer needed.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
xen/arch/x86/Makefile
xen/arch/x86/Rules.mk
xen/arch/x86/boot/head.S
xen/arch/x86/boot/x86_64.S
xen/arch/x86/setup.c
xen/arch/x86/xen.lds.S

index 23312469232e48e5320b23a55d7a27c5087548c5..a1494c33c8be307e931c10acb73e52abe907e706 100644 (file)
@@ -94,7 +94,7 @@ syms-warn-dup-y := --warn-dup
 syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) :=
 
 $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
-       ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) 0x100000 \
+       ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) $(XEN_IMG_OFFSET) \
                       `$(NM) $(TARGET)-syms | sed -ne 's/^\([^ ]*\) . __2M_rwdata_end$$/0x\1/p'`
 
 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS)
index 72be8b2e4bee83427965a29db5b05a78d601c302..568657ee52b0cfaa1a4cb9bcf30184cea3e271b6 100644 (file)
@@ -1,9 +1,12 @@
 ########################################
 # x86-specific definitions
 
+XEN_IMG_OFFSET := 0x200000
+
 CFLAGS += -I$(BASEDIR)/include
 CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
 CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
+CFLAGS += -DXEN_IMG_OFFSET=$(XEN_IMG_OFFSET)
 CFLAGS += '-D__OBJECT_LABEL__=$(subst /,$$,$(subst -,_,$(subst $(BASEDIR)/,,$(CURDIR))/$@))'
 
 # Prevent floating-point variables from creeping into Xen.
index a2177c3d211fcaacda2816850db1ad27633492f3..b5d9ec873bc15af8cf4144335c4b1fc7f448ba70 100644 (file)
@@ -524,14 +524,6 @@ trampoline_setup:
         mov     %eax,sym_phys(boot_tsc_stamp)
         mov     %edx,sym_phys(boot_tsc_stamp+4)
 
-        /*
-         * During boot, hook 4kB mappings of first 2MB of memory into L2.
-         * This avoids mixing cachability for the legacy VGA region, and is
-         * corrected when Xen relocates itself.
-         */
-        mov     $sym_phys(l1_identmap)+__PAGE_HYPERVISOR,%edi
-        mov     %edi,sym_phys(l2_xenmap)
-
         /* Apply relocations to bootstrap trampoline. */
         mov     sym_phys(trampoline_phys),%edx
         mov     $sym_phys(__trampoline_rel_start),%edi
index 4d507fbd960af4740c79056cde809cdec857a709..f9d1022ef8c0b63d7422460645e7b4b71aba937a 100644 (file)
@@ -121,8 +121,9 @@ GLOBAL(l2_identmap)
  * page.
  */
 GLOBAL(l2_xenmap)
-        idx = 0
-        .rept 8
+        .quad 0
+        idx = 1
+        .rept 7
         .quad sym_phys(__image_base__) + (idx << L2_PAGETABLE_SHIFT) + (PAGE_HYPERVISOR | _PAGE_PSE)
         idx = idx + 1
         .endr
index be10a4f32e065f47bd578a2aa8abd94965b51788..e5690b3ec069724a4006bbeda8040d43b7033167 100644 (file)
@@ -1007,7 +1007,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
              * Undo the temporary-hooking of the l1_identmap.  __2M_text_start
              * is contained in this PTE.
              */
-            BUG_ON(l2_table_offset((unsigned long)_erodata) ==
+            BUG_ON(using_2M_mapping() &&
+                   l2_table_offset((unsigned long)_erodata) ==
                    l2_table_offset((unsigned long)_stext));
             *pl2e++ = l2e_from_pfn(xen_phys_start >> PAGE_SHIFT,
                                    PAGE_HYPERVISOR_RX | _PAGE_PSE);
index 1462194603789b705e4cd9348157d0593d794a9f..8289a1bf0972aac53f844dd2ac387158e7ea3d3f 100644 (file)
@@ -54,7 +54,7 @@ SECTIONS
   __2M_text_start = .;         /* Start of 2M superpages, mapped RX. */
 #endif
 
-  . = __XEN_VIRT_START + MB(1);
+  . = __XEN_VIRT_START + XEN_IMG_OFFSET;
   _start = .;
   .text : {
         _stext = .;            /* Text and read-only data */