ia64/xen-unstable

view stubdom/grub/boot-x86_64.S @ 18026:f454f2cac170

x86 hvm: New boot option 'softtsc' to cause RDTSC to be trapped-and-emulated.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jul 10 15:45:18 2008 +0100 (2008-07-10)
parents c8d9ade45781
children
line source
1 #include <os.h>
2 #include <arch_limits.h>
3 #include <xen/arch-x86_64.h>
5 /* For simplicity, we keep all of this into just one data page */
6 .data
7 .globl _boot_page
8 _boot_page:
9 .align __PAGE_SIZE
11 /*
12 * The following data is initialized from C code
13 */
15 /* Pte of this page */
16 .globl _boot_page_entry
17 _boot_page_entry:
18 .quad 0
20 /* mmuext_op structure */
21 /* Set new page directory */
22 _boot_mmuext:
23 /* Op # */
24 .long MMUEXT_NEW_BASEPTR
25 .long 0 /* pad */
27 /* MFN of target page table directory */
28 .globl _boot_pdmfn
29 _boot_pdmfn:
30 .quad 0
32 /* Unused */
33 .quad 0
35 /* Unpin old page directory */
36 /* Op # */
37 .long MMUEXT_UNPIN_TABLE
38 .long 0 /* pad */
40 /* MFN of old page table directory */
41 .globl _boot_oldpdmfn
42 _boot_oldpdmfn:
43 .quad 0
45 /* Unused */
46 .quad 0
48 /* Target stack address, also target virtual address of this page */
49 .globl _boot_stack
50 _boot_stack:
51 .quad 0
52 .globl _boot_target
53 _boot_target:
54 .quad 0
56 /* Target start info */
57 .globl _boot_start_info
58 _boot_start_info:
59 .quad 0
61 /* Target start address */
62 .globl _boot_start
63 _boot_start:
64 .quad 0
66 /*
67 * Boot target OS, does not return
68 */
69 .globl _boot
70 _boot:
71 /* Project ourselves at the target place. */
72 movq _boot_target, %rdi
73 movq _boot_page_entry, %rsi
74 movq $2, %rdx /* UVMF_INVLPG */
75 movq $__HYPERVISOR_update_va_mapping, %rax
76 syscall
77 testq %rax, %rax
78 jz 0f
79 ud2
81 0:
82 /* Go there. */
83 movq $(0f - _boot_page), %rax
84 movq _boot_target, %rbx
85 addq %rbx, %rax
86 jmpq *%rax
87 0:
89 /* Load target page table and unpin old page table. */
90 /* We shouldn't have any problem since in the new page table our page is
91 mapped at the same place. */
92 leaq _boot_mmuext(%rip), %rdi
93 movq $2, %rsi
94 xorq %rdx, %rdx
95 movq $0x7FF0, %r10 /* DOMID_SELF */
96 movq $__HYPERVISOR_mmuext_op, %rax
97 syscall
98 testq %rax, %rax
99 jns 0f
100 ud2
102 0:
103 /* Initialize registers. */
104 movq _boot_stack(%rip), %rsp
105 movq _boot_start_info(%rip), %rsi
107 /* Jump! */
108 jmpq *_boot_start(%rip)