From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH RFC 7/9] x86/boot: Drop pre-C IDT patching Date: Thu, 15 May 2014 10:48:17 +0100 Message-ID: <1400147299-31772-8-git-send-email-andrew.cooper3@citrix.com> References: <1400147299-31772-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1400147299-31772-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Keir Fraser , Jan Beulich , Tim Deegan List-Id: xen-devel@lists.xenproject.org It is not needed now that __start_xen sets itself up with complete trap handlers as its first action. This fixes a potential issue introduced in c/s 7e510a7b874 "x86/boot: move some __high_start code and data into init sections" which would leave ignore_int (in the .init section) patched into the reserved exceptions in all IDTs. Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich CC: Tim Deegan --- xen/arch/x86/boot/x86_64.S | 56 +------------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index 67dfef9..943f409 100644 --- a/xen/arch/x86/boot/x86_64.S +++ b/xen/arch/x86/boot/x86_64.S @@ -25,64 +25,15 @@ leaq 1f(%rip),%rax pushq %rax lretq -1: lidt idt_descr(%rip) - +1: test %ebx,%ebx jnz start_secondary - jmp start_bsp - - .section .init.text, "ax", @progbits - -start_bsp: - /* Initialise IDT with simple error defaults. */ - 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. */ mov multiboot_ptr(%rip),%edi call __start_xen ud2 /* Force a panic (invalid opcode). */ -/* This is the default interrupt handler. */ -ignore_int: - SAVE_ALL CLAC - movq %cr2,%rsi - leaq int_msg(%rip),%rdi - xorl %eax,%eax - call printk - movq %rsp,%rbp -0: movq (%rbp),%rsi - addq $8,%rbp - leaq hex_msg(%rip),%rdi - xorl %eax,%eax - call printk - testq $0xff8,%rbp - jnz 0b -1: hlt - jmp 1b - - .section .init.rodata, "a", @progbits - -int_msg: - .asciz "Unknown interrupt (cr2=%016lx)\n" -hex_msg: - .asciz " %016lx" - /*** DESCRIPTOR TABLES ***/ .data @@ -95,11 +46,6 @@ GLOBAL(gdt_descr) .word LAST_RESERVED_GDT_BYTE .quad boot_cpu_gdt_table - FIRST_RESERVED_GDT_BYTE - .word 0,0,0 -GLOBAL(idt_descr) - .word 256*16-1 - .quad idt_table - GLOBAL(stack_start) .quad cpu0_stack -- 1.7.10.4