diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-10-16 22:17:58 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-10-17 13:02:21 -0400 |
commit | 080104cd0f708b6bb5a121922801867a29ad63fc (patch) | |
tree | 119f220c954dc731322ff759fcfb5ae0a8836a75 /arch/ia64/xen/xensetup.S | |
parent | c7fdaf338679f5e0343bfdfa7ae1e2fdb41ff0b1 (diff) |
ia64/pv_ops/xen: elf note based xen startup.
This patch enables elf note based xen startup for IA-64, which gives the
kernel an early hint for running on xen like x86 case.
In order to avoid the multi entry point, presumably extending booting
protocol(i.e. extending struct ia64_boot_param) would be necessary.
It probably means that elilo also needs modification.
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/xen/xensetup.S')
-rw-r--r-- | arch/ia64/xen/xensetup.S | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/arch/ia64/xen/xensetup.S b/arch/ia64/xen/xensetup.S new file mode 100644 index 000000000000..28fed1fcc079 --- /dev/null +++ b/arch/ia64/xen/xensetup.S | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Support routines for Xen | ||
3 | * | ||
4 | * Copyright (C) 2005 Dan Magenheimer <dan.magenheimer@hp.com> | ||
5 | */ | ||
6 | |||
7 | #include <asm/processor.h> | ||
8 | #include <asm/asmmacro.h> | ||
9 | #include <asm/pgtable.h> | ||
10 | #include <asm/system.h> | ||
11 | #include <asm/paravirt.h> | ||
12 | #include <asm/xen/privop.h> | ||
13 | #include <linux/elfnote.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <xen/interface/elfnote.h> | ||
16 | |||
17 | .section .data.read_mostly | ||
18 | .align 8 | ||
19 | .global xen_domain_type | ||
20 | xen_domain_type: | ||
21 | data4 XEN_NATIVE_ASM | ||
22 | .previous | ||
23 | |||
24 | __INIT | ||
25 | ENTRY(startup_xen) | ||
26 | // Calculate load offset. | ||
27 | // The constant, LOAD_OFFSET, can't be used because the boot | ||
28 | // loader doesn't always load to the LMA specified by the vmlinux.lds. | ||
29 | mov r9=ip // must be the first instruction to make sure | ||
30 | // that r9 = the physical address of startup_xen. | ||
31 | // Usually r9 = startup_xen - LOAD_OFFSET | ||
32 | movl r8=startup_xen | ||
33 | ;; | ||
34 | sub r9=r9,r8 // Usually r9 = -LOAD_OFFSET. | ||
35 | |||
36 | mov r10=PARAVIRT_HYPERVISOR_TYPE_XEN | ||
37 | movl r11=_start | ||
38 | ;; | ||
39 | add r11=r11,r9 | ||
40 | movl r8=hypervisor_type | ||
41 | ;; | ||
42 | add r8=r8,r9 | ||
43 | mov b0=r11 | ||
44 | ;; | ||
45 | st8 [r8]=r10 | ||
46 | br.cond.sptk.many b0 | ||
47 | ;; | ||
48 | END(startup_xen) | ||
49 | |||
50 | ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux") | ||
51 | ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz "2.6") | ||
52 | ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0") | ||
53 | ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, data8.ua startup_xen - LOAD_OFFSET) | ||
54 | |||
55 | #define isBP p3 // are we the Bootstrap Processor? | ||
56 | |||
57 | .text | ||
58 | |||
59 | GLOBAL_ENTRY(xen_setup_hook) | ||
60 | mov r8=XEN_PV_DOMAIN_ASM | ||
61 | (isBP) movl r9=xen_domain_type;; | ||
62 | (isBP) st4 [r9]=r8 | ||
63 | movl r10=xen_ivt;; | ||
64 | |||
65 | mov cr.iva=r10 | ||
66 | |||
67 | /* Set xsi base. */ | ||
68 | #define FW_HYPERCALL_SET_SHARED_INFO_VA 0x600 | ||
69 | (isBP) mov r2=FW_HYPERCALL_SET_SHARED_INFO_VA | ||
70 | (isBP) movl r28=XSI_BASE;; | ||
71 | (isBP) break 0x1000;; | ||
72 | |||
73 | /* setup pv_ops */ | ||
74 | (isBP) mov r4=rp | ||
75 | ;; | ||
76 | (isBP) br.call.sptk.many rp=xen_setup_pv_ops | ||
77 | ;; | ||
78 | (isBP) mov rp=r4 | ||
79 | ;; | ||
80 | |||
81 | br.ret.sptk.many rp | ||
82 | ;; | ||
83 | END(xen_setup_hook) | ||