ia64/xen-unstable

changeset 18677:3ba06e8098cb

x86: Avoid dynamic memory allocation during AP startup.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Oct 21 11:39:22 2008 +0100 (2008-10-21)
parents 459f7ca6cf2a
children ecdbcd27490f
files xen/arch/x86/smpboot.c
line diff
     1.1 --- a/xen/arch/x86/smpboot.c	Tue Oct 21 10:04:40 2008 +0100
     1.2 +++ b/xen/arch/x86/smpboot.c	Tue Oct 21 11:39:22 2008 +0100
     1.3 @@ -473,13 +473,6 @@ static void construct_percpu_idt(unsigne
     1.4  {
     1.5  	unsigned char idt_load[10];
     1.6  
     1.7 -	/* If IDT table exists since last hotplug, reuse it */
     1.8 -	if (!idt_tables[cpu]) {
     1.9 -		idt_tables[cpu] = xmalloc_array(idt_entry_t, IDT_ENTRIES);
    1.10 -		memcpy(idt_tables[cpu], idt_table,
    1.11 -				IDT_ENTRIES*sizeof(idt_entry_t));
    1.12 -	}
    1.13 -
    1.14  	*(unsigned short *)(&idt_load[0]) = (IDT_ENTRIES*sizeof(idt_entry_t))-1;
    1.15  	*(unsigned long  *)(&idt_load[2]) = (unsigned long)idt_tables[cpu];
    1.16  	__asm__ __volatile__ ( "lidt %0" : "=m" (idt_load) );
    1.17 @@ -908,6 +901,12 @@ static int __devinit do_boot_cpu(int api
    1.18  	}
    1.19  #endif
    1.20  
    1.21 +	if (!idt_tables[cpu]) {
    1.22 +		idt_tables[cpu] = xmalloc_array(idt_entry_t, IDT_ENTRIES);
    1.23 +		memcpy(idt_tables[cpu], idt_table,
    1.24 +		       IDT_ENTRIES*sizeof(idt_entry_t));
    1.25 +	}
    1.26 +
    1.27  	/*
    1.28  	 * This grunge runs the startup process for
    1.29  	 * the targeted processor.