xen64: add xen-head code to head_64.S
authorJeremy Fitzhardinge <jeremy@goop.org>
Tue, 8 Jul 2008 22:06:44 +0000 (15:06 -0700)
committerIngo Molnar <mingo@elte.hu>
Wed, 16 Jul 2008 08:58:41 +0000 (10:58 +0200)
Add the Xen entrypoint and ELF notes to head_64.S.  Adapts xen-head.S
to compile either 32-bit or 64-bit.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/asm-offsets_64.c
arch/x86/kernel/head_64.S
arch/x86/xen/xen-head.S

index bacf5deeec2d13a16a675e2b6bc44e8f53ed232c..0f7e1f09aa09b8aa3f6fb9f1210f4c10b6717cd9 100644 (file)
@@ -131,5 +131,8 @@ int main(void)
        OFFSET(BP_loadflags, boot_params, hdr.loadflags);
        OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
        OFFSET(BP_version, boot_params, hdr.version);
+
+       BLANK();
+       DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
        return 0;
 }
index 4b6bda21837f988d2e9bffd09fd39ebadd5a5d6e..2240f823676a73ecbae3d3eb78fd007a8215ddc2 100644 (file)
@@ -401,6 +401,7 @@ ENTRY(phys_base)
        /* This must match the first entry in level2_kernel_pgt */
        .quad   0x0000000000000000
 
+#include "../../x86/xen/xen-head.S"
        
        .section .bss, "aw", @nobits
        .align L1_CACHE_BYTES
index a9cac9dc04be2ecaf31a9fdc2cf9727970020a27..63d49a523ed307f9407e805ca507bf293ad0dfca 100644 (file)
@@ -8,15 +8,21 @@
 
 #include <asm/boot.h>
 #include <asm/asm.h>
+#include <asm/page.h>
 
 #include <xen/interface/elfnote.h>
 #include <asm/xen/interface.h>
 
        __INIT
 ENTRY(startup_xen)
-       movl %esi,xen_start_info
        cld
-       movl $(init_thread_union+THREAD_SIZE),%esp
+#ifdef CONFIG_X86_32
+       mov %esi,xen_start_info
+       mov $init_thread_union+THREAD_SIZE,%esp
+#else
+       mov %rsi,xen_start_info
+       mov $init_thread_union+THREAD_SIZE,%rsp
+#endif
        jmp xen_start_kernel
 
        __FINIT
@@ -30,7 +36,11 @@ ENTRY(hypercall_page)
        ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
        ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
        ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
+#ifdef CONFIG_X86_32
        ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      _ASM_PTR __PAGE_OFFSET)
+#else
+       ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      _ASM_PTR __START_KERNEL_map)
+#endif
        ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
        ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
        ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb")
@@ -40,5 +50,6 @@ ENTRY(hypercall_page)
                .quad _PAGE_PRESENT; .quad _PAGE_PRESENT)
        ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
        ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW,   _ASM_PTR __HYPERVISOR_VIRT_START)
+       ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   _ASM_PTR 0)
 
 #endif /*CONFIG_XEN */