diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-07-08 18:06:44 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-16 04:58:41 -0400 |
commit | 8c5e5ac32fe08793246709fbb94c055ec76a7c0e (patch) | |
tree | 1aaaa79ab8351f406d79f7e60fdf7991566dc5c4 | |
parent | c7b75947f89d45493562ede6d9ee7311dfa5c4ce (diff) |
xen64: add xen-head code to head_64.S
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>
-rw-r--r-- | arch/x86/kernel/asm-offsets_64.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/head_64.S | 1 | ||||
-rw-r--r-- | arch/x86/xen/xen-head.S | 15 |
3 files changed, 17 insertions, 2 deletions
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index bacf5deeec2d..0f7e1f09aa09 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c | |||
@@ -131,5 +131,8 @@ int main(void) | |||
131 | OFFSET(BP_loadflags, boot_params, hdr.loadflags); | 131 | OFFSET(BP_loadflags, boot_params, hdr.loadflags); |
132 | OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); | 132 | OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); |
133 | OFFSET(BP_version, boot_params, hdr.version); | 133 | OFFSET(BP_version, boot_params, hdr.version); |
134 | |||
135 | BLANK(); | ||
136 | DEFINE(PAGE_SIZE_asm, PAGE_SIZE); | ||
134 | return 0; | 137 | return 0; |
135 | } | 138 | } |
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 4b6bda21837f..2240f823676a 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -401,6 +401,7 @@ ENTRY(phys_base) | |||
401 | /* This must match the first entry in level2_kernel_pgt */ | 401 | /* This must match the first entry in level2_kernel_pgt */ |
402 | .quad 0x0000000000000000 | 402 | .quad 0x0000000000000000 |
403 | 403 | ||
404 | #include "../../x86/xen/xen-head.S" | ||
404 | 405 | ||
405 | .section .bss, "aw", @nobits | 406 | .section .bss, "aw", @nobits |
406 | .align L1_CACHE_BYTES | 407 | .align L1_CACHE_BYTES |
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S index a9cac9dc04be..63d49a523ed3 100644 --- a/arch/x86/xen/xen-head.S +++ b/arch/x86/xen/xen-head.S | |||
@@ -8,15 +8,21 @@ | |||
8 | 8 | ||
9 | #include <asm/boot.h> | 9 | #include <asm/boot.h> |
10 | #include <asm/asm.h> | 10 | #include <asm/asm.h> |
11 | #include <asm/page.h> | ||
11 | 12 | ||
12 | #include <xen/interface/elfnote.h> | 13 | #include <xen/interface/elfnote.h> |
13 | #include <asm/xen/interface.h> | 14 | #include <asm/xen/interface.h> |
14 | 15 | ||
15 | __INIT | 16 | __INIT |
16 | ENTRY(startup_xen) | 17 | ENTRY(startup_xen) |
17 | movl %esi,xen_start_info | ||
18 | cld | 18 | cld |
19 | movl $(init_thread_union+THREAD_SIZE),%esp | 19 | #ifdef CONFIG_X86_32 |
20 | mov %esi,xen_start_info | ||
21 | mov $init_thread_union+THREAD_SIZE,%esp | ||
22 | #else | ||
23 | mov %rsi,xen_start_info | ||
24 | mov $init_thread_union+THREAD_SIZE,%rsp | ||
25 | #endif | ||
20 | jmp xen_start_kernel | 26 | jmp xen_start_kernel |
21 | 27 | ||
22 | __FINIT | 28 | __FINIT |
@@ -30,7 +36,11 @@ ENTRY(hypercall_page) | |||
30 | ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux") | 36 | ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux") |
31 | ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz "2.6") | 37 | ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz "2.6") |
32 | ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0") | 38 | ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0") |
39 | #ifdef CONFIG_X86_32 | ||
33 | ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __PAGE_OFFSET) | 40 | ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __PAGE_OFFSET) |
41 | #else | ||
42 | ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __START_KERNEL_map) | ||
43 | #endif | ||
34 | ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, _ASM_PTR startup_xen) | 44 | ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, _ASM_PTR startup_xen) |
35 | ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page) | 45 | ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page) |
36 | ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "!writable_page_tables|pae_pgdir_above_4gb") | 46 | ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "!writable_page_tables|pae_pgdir_above_4gb") |
@@ -40,5 +50,6 @@ ENTRY(hypercall_page) | |||
40 | .quad _PAGE_PRESENT; .quad _PAGE_PRESENT) | 50 | .quad _PAGE_PRESENT; .quad _PAGE_PRESENT) |
41 | ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1) | 51 | ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1) |
42 | ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, _ASM_PTR __HYPERVISOR_VIRT_START) | 52 | ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, _ASM_PTR __HYPERVISOR_VIRT_START) |
53 | ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, _ASM_PTR 0) | ||
43 | 54 | ||
44 | #endif /*CONFIG_XEN */ | 55 | #endif /*CONFIG_XEN */ |