aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/boot/x86_64.S
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2005-02-17 05:37:46 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2005-02-17 05:37:46 +0000
commitb9999b873293fc8b5fc20f74b20d62b167258449 (patch)
tree2a7f19da1af6d349763a30376036dd3f39f498af /xen/arch/x86/boot/x86_64.S
parenta6657b972719a2bf6042b3a3c3c227808e6339f6 (diff)
downloadxen-b9999b873293fc8b5fc20f74b20d62b167258449.tar.gz
xen-b9999b873293fc8b5fc20f74b20d62b167258449.tar.bz2
xen-b9999b873293fc8b5fc20f74b20d62b167258449.zip
bitkeeper revision 1.1215 (42142daa9YHoIs3M6QPvH1qZYBJO5g)
IDT fixes. Initialise IDT sanely on x86/64. On x86/32 try to keep per-cpu IDTs in sync better. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/boot/x86_64.S')
-rw-r--r--xen/arch/x86/boot/x86_64.S45
1 files changed, 27 insertions, 18 deletions
diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index 2b89d9caa4..ab729da994 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -148,15 +148,22 @@ __high_start:
rep stosb
/* Initialise IDT with simple error defaults. */
- lea ignore_int(%rip),%rdx
- mov $(__HYPERVISOR_CS64 << 16),%eax
- mov %dx,%ax /* selector = 0x0010 = cs */
- mov $0x8E00,%dx /* interrupt gate - dpl=0, present */
- lea idt_table(%rip),%rdi
- mov $256,%rcx
-1: mov %eax,(%rdi)
- mov %edx,4(%rdi)
- add $8,%rdi
+ leaq ignore_int(%rip),%rcx
+ movl %ecx,%eax
+ andl $0xFFFF0000,%eax
+ orl $0x00008E00,%eax
+ shlq $32,%rax
+ movl %ecx,%edx
+ andl $0x0000FFFF,%edx
+ orl $(__HYPERVISOR_CS64<<16),%edx
+ orq %rdx,%rax
+ shrq $32,%rcx
+ movl %ecx,%edx
+ leaq idt_table(%rip),%rdi
+ movl $256,%ecx
+1: movq %rax,(%rdi)
+ movq %rdx,8(%rdi)
+ addq $16,%rdi
loop 1b
/* Pass off the Multiboot info structure to C land. */
@@ -167,15 +174,6 @@ __high_start:
call __start_xen
ud2 /* Force a panic (invalid opcode). */
-/* This is the default interrupt handler. */
-int_msg:
- .asciz "Unknown interrupt\n"
-ignore_int:
- cld
- lea int_msg(%rip),%rdi
- call SYMBOL_NAME(printf)
-1: jmp 1b
-
.code32
.org 0x1e0
@@ -250,5 +248,16 @@ ENTRY(idle_pg_table_l2)
ENTRY(cpu0_stack)
.org 0x4000 + STACK_SIZE
+ .code64
ENTRY(stext)
ENTRY(_stext)
+
+/* This is the default interrupt handler. */
+int_msg:
+ .asciz "Unknown interrupt\n"
+ignore_int:
+ cld
+ leaq int_msg(%rip),%rdi
+ call SYMBOL_NAME(printf)
+1: jmp 1b
+