jmp __start
.align 4
-/*** MULTIBOOT HEADER ****/
+multiboot1_header_start: /*** MULTIBOOT1 HEADER ****/
#define MULTIBOOT_HEADER_FLAGS (MULTIBOOT_HEADER_MODS_ALIGNED | \
MULTIBOOT_HEADER_WANT_MEMORY)
/* Magic number indicating a Multiboot header. */
.long MULTIBOOT_HEADER_FLAGS
/* Checksum: must be the negated sum of the first two fields. */
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
+multiboot1_header_end:
.section .init.rodata, "a", @progbits
.align 4
#include "trampoline.S"
GLOBAL(trampoline_end)
- .text
-__high_start:
#include "x86_64.S"
-
- .section .data.page_aligned, "aw", @progbits
- .p2align PAGE_SHIFT
-/*
- * Mapping of first 2 megabytes of memory. This is mapped with 4kB mappings
- * to avoid type conflicts with fixed-range MTRRs covering the lowest megabyte
- * of physical memory. In any case the VGA hole should be mapped with type UC.
- */
-GLOBAL(l1_identmap)
- pfn = 0
- .rept L1_PAGETABLE_ENTRIES
- /* VGA hole (0xa0000-0xc0000) should be mapped UC. */
- .if pfn >= 0xa0 && pfn < 0xc0
- .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR_NOCACHE | MAP_SMALL_PAGES
- .else
- .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | MAP_SMALL_PAGES
- .endif
- .long 0
- pfn = pfn + 1
- .endr
- .size l1_identmap, . - l1_identmap
+ .text
.code64
+ENTRY(__high_start)
/* Install relocated data selectors. */
lgdt gdt_descr(%rip)
mov $(__HYPERVISOR_DS64),%ecx
.align PAGE_SIZE, 0
GLOBAL(__page_tables_start)
+/*
+ * Mapping of first 2 megabytes of memory. This is mapped with 4kB mappings
+ * to avoid type conflicts with fixed-range MTRRs covering the lowest megabyte
+ * of physical memory. In any case the VGA hole should be mapped with type UC.
+ */
+GLOBAL(l1_identmap)
+ pfn = 0
+ .rept L1_PAGETABLE_ENTRIES
+ /* VGA hole (0xa0000-0xc0000) should be mapped UC. */
+ .if pfn >= 0xa0 && pfn < 0xc0
+ .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR_NOCACHE | MAP_SMALL_PAGES
+ .else
+ .long (pfn << PAGE_SHIFT) | PAGE_HYPERVISOR | MAP_SMALL_PAGES
+ .endif
+ .long 0
+ pfn = pfn + 1
+ .endr
+ .size l1_identmap, . - l1_identmap
/* Mapping of first 16 megabytes of memory. */
GLOBAL(l2_identmap)
if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count == 0) )
panic("dom0 kernel not specified. Check bootloader configuration.");
- if ( ((unsigned long)cpu0_stack & (STACK_SIZE-1)) != 0 )
- panic("Misaligned CPU0 stack.");
-
if ( efi_enabled )
{
set_pdx_range(xen_phys_start >> PAGE_SHIFT,
. = __XEN_VIRT_START;
__image_base__ = .;
#endif
- . = __XEN_VIRT_START + 0x100000;
+ . = __XEN_VIRT_START + MB(1);
_start = .;
.text : {
_stext = .; /* Text and read-only data */
/* Trick the linker into setting the image size to exactly 16Mb. */
. = ALIGN(__section_alignment__);
.pad : {
- . = ALIGN(0x1000000);
+ . = ALIGN(MB(16));
} :text
#else
efi = .;
_end <= XEN_VIRT_END - NR_CPUS * PAGE_SIZE,
"Xen image overlaps stubs area")
ASSERT(kexec_reloc_size - kexec_reloc <= PAGE_SIZE, "kexec_reloc is too large")
+ASSERT((cpu0_stack & (STACK_SIZE - 1)) == 0, "cpu0_stack misaligned")