From: Andrew Cooper Date: Tue, 29 Apr 2014 13:18:39 +0000 (+0200) Subject: x86/boot: move some __high_start code and data into init sections X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5128 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7e510a7b874fa2bfd1cee4d74299a1ea81e5eb6a;p=xen.git x86/boot: move some __high_start code and data into init sections Half of __high_start is strictly for the BSP and will only be run once on boot. To complement 'start_secondary', create 'start_bsp' and move it into the init.text section. The interrupt handler 'ignore_int' is patched into the BSPs IDT, but fully replaced with real handlers early during boot. The BSPs IDT is used by APs until midway through start_secondary, but after the real handlers have been installed. Therefore, 'ignore_int' can move to init.text. Furthermore, its strings can move to init.rodata. Signed-off-by: Andrew Cooper --- diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index 8f92402982..9652edba66 100644 --- a/xen/arch/x86/boot/x86_64.S +++ b/xen/arch/x86/boot/x86_64.S @@ -29,7 +29,11 @@ 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 @@ -55,10 +59,6 @@ ud2 /* Force a panic (invalid opcode). */ /* This is the default interrupt handler. */ -int_msg: - .asciz "Unknown interrupt (cr2=%016lx)\n" -hex_msg: - .asciz " %016lx" ignore_int: SAVE_ALL movq %cr2,%rsi @@ -75,6 +75,12 @@ ignore_int: jnz 0b 1: jmp 1b + .section .init.rodata, "a", @progbits + +int_msg: + .asciz "Unknown interrupt (cr2=%016lx)\n" +hex_msg: + .asciz " %016lx" /*** DESCRIPTOR TABLES ***/