diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-05-26 20:33:31 +0000 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-05-26 20:33:31 +0000 |
commit | eba5dac1e080105a7c64969d10dce992a3a38814 (patch) | |
tree | 2e8863cb610d584c2c93934c59a82f80cd29babb | |
parent | aacaa43ac874eb7dbdf7d851d17b7cc67e1b4fcb (diff) | |
download | xen-eba5dac1e080105a7c64969d10dce992a3a38814.tar.gz xen-eba5dac1e080105a7c64969d10dce992a3a38814.tar.bz2 xen-eba5dac1e080105a7c64969d10dce992a3a38814.zip |
bitkeeper revision 1.1569 (4296329bfi2iosJzMmIh7KglSdchjQ)
Clean up SMP bootstrap, and fix uniprocessor/APIC-less booting.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | .rootkeys | 1 | ||||
-rw-r--r-- | xen/arch/x86/setup.c | 3 | ||||
-rw-r--r-- | xen/arch/x86/smpboot.c | 44 | ||||
-rw-r--r-- | xen/include/asm-x86/mach-default/smpboot_hooks.h | 44 |
4 files changed, 30 insertions, 62 deletions
@@ -1329,7 +1329,6 @@ 427fa2d093fDS2gOBLcl7Yndzl7HmA xen/include/asm-x86/mach-default/mach_ipi.h 427fa2d0Y7bD35d-FvDAeiJDIdRw2A xen/include/asm-x86/mach-default/mach_mpparse.h 427fa2d0OfglYyfpDTD5DII4M0uZRw xen/include/asm-x86/mach-default/mach_wakecpu.h -427fa2d1EKnA8zCq2QLHiGOUqOgszg xen/include/asm-x86/mach-default/smpboot_hooks.h 4294b5eeTwL8TeEI5pEzxvGD5obZsA xen/include/asm-x86/mach-es7000/mach_apic.h 4294b5efhhBHJ81dsuLfJxWuN9PcDQ xen/include/asm-x86/mach-es7000/mach_apicdef.h 4294b5efvb29X4mFAhUBdeGUPTFoBw xen/include/asm-x86/mach-es7000/mach_ipi.h diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 5c52b175c2..1a8ff62933 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -211,6 +211,9 @@ static void __init start_of_day(void) for_each_cpu ( i ) cpu_set(i, cpu_present_map); + /* Sanity: We ought to be taking interrupts by now. */ + local_irq_enable(); + initialize_keytable(); serial_init_stage2(); diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index b4a1ffb894..9249b88117 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -47,7 +47,6 @@ #include <asm/msr.h> #include <mach_apic.h> #include <mach_wakecpu.h> -#include <smpboot_hooks.h> static int _foo; #define set_kernel_exec(x,y) (_foo=0) @@ -803,7 +802,13 @@ static int __init do_boot_cpu(int apicid) store_NMI_vector(&nmi_high, &nmi_low); - smpboot_setup_warm_reset_vector(start_eip); + CMOS_WRITE(0xa, 0xf); + local_flush_tlb(); + Dprintk("1.\n"); + *((volatile unsigned short *) TRAMPOLINE_HIGH) = start_eip >> 4; + Dprintk("2.\n"); + *((volatile unsigned short *) TRAMPOLINE_LOW) = start_eip & 0xf; + Dprintk("3.\n"); /* * Starting actual IPI sequence... @@ -947,7 +952,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) */ if (!smp_found_config && !acpi_lapic) { printk(KERN_NOTICE "SMP motherboard not detected.\n"); - smpboot_clear_io_apic_irqs(); + init_uniprocessor: phys_cpu_present_map = physid_mask_of_physid(0); if (APIC_init_uniprocessor()) printk(KERN_NOTICE "Local APIC not detected." @@ -973,10 +978,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) && !cpu_has_apic) { printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", boot_cpu_physical_apicid); - printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n"); - smpboot_clear_io_apic_irqs(); - phys_cpu_present_map = physid_mask_of_physid(0); - return; + goto init_uniprocessor; } verify_local_APIC(); @@ -984,13 +986,8 @@ static void __init smp_boot_cpus(unsigned int max_cpus) /* * If SMP should be disabled, then really disable it! */ - if (!max_cpus) { - smp_found_config = 0; - printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n"); - smpboot_clear_io_apic_irqs(); - phys_cpu_present_map = physid_mask_of_physid(0); - return; - } + if (!max_cpus) + goto init_uniprocessor; connect_bsp_APIC(); setup_local_APIC(); @@ -1030,9 +1027,17 @@ static void __init smp_boot_cpus(unsigned int max_cpus) } /* - * Cleanup possible dangling ends... + * Install writable page 0 entry to set BIOS data area. */ - smpboot_restore_warm_reset_vector(); + local_flush_tlb(); + + /* + * Paranoid: Set warm reset code and vector here back + * to default values. + */ + CMOS_WRITE(0, 0xf); + + *((volatile long *) phys_to_virt(0x467)) = 0; #ifdef BOGOMIPS /* @@ -1103,7 +1108,12 @@ static void __init smp_boot_cpus(unsigned int max_cpus) if (nmi_watchdog == NMI_LOCAL_APIC) check_nmi_watchdog(); - smpboot_setup_io_apic(); + /* + * Here we can be sure that there is an IO-APIC in the system. Let's + * go and set it up: + */ + if (!skip_ioapic_setup && nr_ioapics) + setup_IO_APIC(); setup_boot_APIC_clock(); diff --git a/xen/include/asm-x86/mach-default/smpboot_hooks.h b/xen/include/asm-x86/mach-default/smpboot_hooks.h deleted file mode 100644 index 7f45f63110..0000000000 --- a/xen/include/asm-x86/mach-default/smpboot_hooks.h +++ /dev/null @@ -1,44 +0,0 @@ -/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws - * which needs to alter them. */ - -static inline void smpboot_clear_io_apic_irqs(void) -{ - io_apic_irqs = 0; -} - -static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) -{ - CMOS_WRITE(0xa, 0xf); - local_flush_tlb(); - Dprintk("1.\n"); - *((volatile unsigned short *) TRAMPOLINE_HIGH) = start_eip >> 4; - Dprintk("2.\n"); - *((volatile unsigned short *) TRAMPOLINE_LOW) = start_eip & 0xf; - Dprintk("3.\n"); -} - -static inline void smpboot_restore_warm_reset_vector(void) -{ - /* - * Install writable page 0 entry to set BIOS data area. - */ - local_flush_tlb(); - - /* - * Paranoid: Set warm reset code and vector here back - * to default values. - */ - CMOS_WRITE(0, 0xf); - - *((volatile long *) phys_to_virt(0x467)) = 0; -} - -static inline void smpboot_setup_io_apic(void) -{ - /* - * Here we can be sure that there is an IO-APIC in the system. Let's - * go and set it up: - */ - if (!skip_ioapic_setup && nr_ioapics) - setup_IO_APIC(); -} |