From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH v3 2/3] x86/boot: Move some __high_start code and data into init sections Date: Mon, 28 Apr 2014 15:55:45 +0100 Message-ID: <1398696945-31013-1-git-send-email-andrew.cooper3@citrix.com> References: <535E6A6C.40407@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <535E6A6C.40407@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 List-Id: xen-devel@lists.xenproject.org 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 'ingore_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 CC: Keir Fraser CC: Jan Beulich --- v3: Drop GLOBAL() for start_bsp. v2: Move data to .init.rodata. Add missing @progbits. --- xen/arch/x86/boot/x86_64.S | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index 8f92402..9652edb 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 ***/ -- 1.7.10.4