Merge branches 'irq/sparseirq', 'x86/quirks' and 'x86/reboot' into cpus4096
authorIngo Molnar <mingo@elte.hu>
Fri, 12 Dec 2008 12:49:17 +0000 (13:49 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 12 Dec 2008 12:49:24 +0000 (13:49 +0100)
We merge the irq/sparseirq, x86/quirks and x86/reboot trees into the
cpus4096 tree because the io-apic changes in the sparseirq change
conflict with the cpumask changes in the cpumask tree, and we
want to resolve those.

1  2  3  4 
arch/x86/Kconfig
arch/x86/kernel/process.c
arch/x86/kernel/reboot.c
arch/x86/kernel/setup.c
init/main.c

diff --combined arch/x86/Kconfig
index c7235e643affe5aae1b73b058671de2d7e285194,8943c13502c69b2e1956524527f7005da8252fb8,705e72e954b43e207498c8ea55011360daecb010,ebcad15ccf35b701894e49def15f5c52f96d97b6..d99eeb7915c6b8523320064c2c6a4212e8931019
@@@@@ -29,14 -29,11 -29,11 -29,11 +29,14 @@@@@ config X8
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FUNCTION_TRACER
 +++    select HAVE_FUNCTION_GRAPH_TRACER
 +++    select HAVE_FUNCTION_TRACE_MCOUNT_TEST
        select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
        select HAVE_ARCH_KGDB if !X86_VOYAGER
        select HAVE_ARCH_TRACEHOOK
        select HAVE_GENERIC_DMA_COHERENT if X86_32
        select HAVE_EFFICIENT_UNALIGNED_ACCESS
 +++    select USER_STACKTRACE_SUPPORT
    
    config ARCH_DEFCONFIG
        string
@@@@@ -170,12 -167,12 -167,12 -167,9 +170,12 @@@@@ config GENERIC_PENDING_IR
    config X86_SMP
        bool
        depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
   -    select USE_GENERIC_SMP_HELPERS
        default y
    
   +config USE_GENERIC_SMP_HELPERS
   +    def_bool y
   +    depends on SMP
   +
    config X86_32_SMP
        def_bool y
        depends on X86_32 && SMP
@@@@@ -241,6 -238,16 -238,6 -235,6 +241,16 @@@@@ config X86_HAS_BOOT_CPU_I
        def_bool y
        depends on X86_VOYAGER
    
+ ++config SPARSE_IRQ
+ ++    bool "Support sparse irq numbering"
+ ++    depends on (PCI_MSI || HT_IRQ) && SMP
+ ++    default y
+ ++    help
+ ++      This enables support for sparse irq, esp for msi/msi-x. You may need
+ ++      if you have lots of cards supports msi-x installed.
+ ++
+ ++      If you don't know what to do here, say Y.
+ ++
    config X86_FIND_SMP_CONFIG
        def_bool y
        depends on X86_MPPARSE || X86_VOYAGER
@@@@@ -370,10 -377,10 -367,10 -364,10 +380,10 @@@@@ config X86_RDC321
          as R-8610-(G).
          If you don't have one of these chips, you should say N here.
    
 ---config SCHED_NO_NO_OMIT_FRAME_POINTER
 +++config SCHED_OMIT_FRAME_POINTER
        def_bool y
        prompt "Single-depth WCHAN output"
 ---    depends on X86_32
 +++    depends on X86
        help
          Calculate simpler /proc/<PID>/wchan values. If this option
          is disabled then wchan values will recurse back to the
@@@@@ -468,10 -475,10 -465,6 -462,10 +478,6 @@@@@ config X86_CYCLONE_TIME
        def_bool y
        depends on X86_GENERICARCH
    
-- -config ES7000_CLUSTERED_APIC
-- -    def_bool y
-- -    depends on SMP && X86_ES7000 && MPENTIUMIII
-- -
    source "arch/x86/Kconfig.cpu"
    
    config HPET_TIMER
@@@@@ -1635,13 -1642,13 -1628,13 -1629,6 +1641,6 @@@@@ config APM_ALLOW_INT
          many of the newer IBM Thinkpads.  If you experience hangs when you
          suspend, try setting this to Y.  Otherwise, say N.
    
--- config APM_REAL_MODE_POWER_OFF
---     bool "Use real mode APM BIOS call to power off"
---     help
---       Use real mode APM BIOS calls to switch off the computer. This is
---       a work-around for a number of buggy BIOSes. Switch this option on if
---       your computer crashes instead of powering off properly.
--- 
    endif # APM
    
    source "arch/x86/kernel/cpu/cpufreq/Kconfig"
index c27af49a4ede1b525daece26f937b8bfaa6560b5,c622772744d86fcb0dcd3e6c46a6de5323508c40,c622772744d86fcb0dcd3e6c46a6de5323508c40,a4da7c4b31294782fe42143a6dcd07c5203bb137..95d811a9594fda74e35b926fa8ff4777a750e37c
@@@@@ -7,8 -7,7 -7,7 -7,8 +7,9 @@@@@
    #include <linux/module.h>
    #include <linux/pm.h>
    #include <linux/clockchips.h>
 +++#include <linux/ftrace.h>
    #include <asm/system.h>
+++ #include <asm/apic.h>
    
    unsigned long idle_halt;
    EXPORT_SYMBOL(idle_halt);
@@@@@ -101,9 -100,6 -100,6 -101,6 +102,9 @@@@@ static inline int hlt_use_halt(void
    void default_idle(void)
    {
        if (hlt_use_halt()) {
 +++            struct power_trace it;
 +++
 +++            trace_power_start(&it, POWER_CSTATE, 1);
                current_thread_info()->status &= ~TS_POLLING;
                /*
                 * TS_POLLING-cleared state must be visible before we
                else
                        local_irq_enable();
                current_thread_info()->status |= TS_POLLING;
 +++            trace_power_end(&it);
        } else {
                local_irq_enable();
                /* loop is done by the caller */
    EXPORT_SYMBOL(default_idle);
    #endif
    
+++ void stop_this_cpu(void *dummy)
+++ {
+++     local_irq_disable();
+++     /*
+++      * Remove this CPU:
+++      */
+++     cpu_clear(smp_processor_id(), cpu_online_map);
+++     disable_local_APIC();
+++ 
+++     for (;;) {
+++             if (hlt_works(smp_processor_id()))
+++                     halt();
+++     }
+++ }
+++ 
    static void do_nothing(void *unused)
    {
    }
@@@@@ -159,31 -154,24 -154,24 -170,24 +175,31 @@@@@ EXPORT_SYMBOL_GPL(cpu_idle_wait)
     */
    void mwait_idle_with_hints(unsigned long ax, unsigned long cx)
    {
 +++    struct power_trace it;
 +++
 +++    trace_power_start(&it, POWER_CSTATE, (ax>>4)+1);
        if (!need_resched()) {
                __monitor((void *)&current_thread_info()->flags, 0, 0);
                smp_mb();
                if (!need_resched())
                        __mwait(ax, cx);
        }
 +++    trace_power_end(&it);
    }
    
    /* Default MONITOR/MWAIT with no hints, used for default C1 state */
    static void mwait_idle(void)
    {
 +++    struct power_trace it;
        if (!need_resched()) {
 +++            trace_power_start(&it, POWER_CSTATE, 1);
                __monitor((void *)&current_thread_info()->flags, 0, 0);
                smp_mb();
                if (!need_resched())
                        __sti_mwait(0, 0);
                else
                        local_irq_enable();
 +++            trace_power_end(&it);
        } else
                local_irq_enable();
    }
     */
    static void poll_idle(void)
    {
 +++    struct power_trace it;
 +++
 +++    trace_power_start(&it, POWER_CSTATE, 0);
        local_irq_enable();
        while (!need_resched())
                cpu_relax();
 +++    trace_power_end(&it);
    }
    
    /*
diff --combined arch/x86/kernel/reboot.c
index cc5a2545dd41c0ce42b96eafffe85230773162e4,cc5a2545dd41c0ce42b96eafffe85230773162e4,cc5a2545dd41c0ce42b96eafffe85230773162e4,bb387ab0eea80285e5d5ee2f952eb1f11c2611e7..0e3dbc7b2bdbbce7a2eb33ef146ed0dc2a262117
@@@@@ -36,7 -36,7 -36,7 -36,10 +36,10 @@@@@ int reboot_force
    static int reboot_cpu = -1;
    #endif
    
--- /* reboot=b[ios] | s[mp] | t[riple] | k[bd] | e[fi] [, [w]arm | [c]old]
+++ /* This is set by the PCI code if either type 1 or type 2 PCI is detected */
+++ bool port_cf9_safe = false;
+++ 
+++ /* reboot=b[ios] | s[mp] | t[riple] | k[bd] | e[fi] [, [w]arm | [c]old] | p[ci]
       warm   Don't set the cold reboot flag
       cold   Set the cold reboot flag
       bios   Reboot by jumping through the BIOS (only for X86_32)
       kbd    Use the keyboard controller. cold reset (default)
       acpi   Use the RESET_REG in the FADT
       efi    Use efi reset_system runtime service
+++    pci    Use the so-called "PCI reset register", CF9
       force  Avoid anything that could hang.
     */
    static int __init reboot_setup(char *str)
                case 'k':
                case 't':
                case 'e':
+++             case 'p':
                        reboot_type = *str;
                        break;
    
@@@@@ -169,15 -169,15 -169,15 -174,6 +174,15 @@@@@ static struct dmi_system_id __initdata 
                        DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
                },
        },
   +    {   /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
   +            .callback = set_bios_reboot,
   +            .ident = "Dell OptiPlex 330",
   +            .matches = {
   +                    DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
   +                    DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
   +                    DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
   +            },
   +    },
        {       /* Handle problems with rebooting on Dell 2400's */
                .callback = set_bios_reboot,
                .ident = "Dell PowerEdge 2400",
@@@@@ -404,12 -404,12 -404,12 -400,27 +409,27 @@@@@ static void native_machine_emergency_re
                        reboot_type = BOOT_KBD;
                        break;
    
--- 
                case BOOT_EFI:
                        if (efi_enabled)
---                             efi.reset_system(reboot_mode ? EFI_RESET_WARM : EFI_RESET_COLD,
+++                             efi.reset_system(reboot_mode ?
+++                                              EFI_RESET_WARM :
+++                                              EFI_RESET_COLD,
                                                 EFI_SUCCESS, 0, NULL);
+++                     reboot_type = BOOT_KBD;
+++                     break;
+++ 
+++             case BOOT_CF9:
+++                     port_cf9_safe = true;
+++                     /* fall through */
    
+++             case BOOT_CF9_COND:
+++                     if (port_cf9_safe) {
+++                             u8 cf9 = inb(0xcf9) & ~6;
+++                             outb(cf9|2, 0xcf9); /* Request hard reset */
+++                             udelay(50);
+++                             outb(cf9|6, 0xcf9); /* Actually do the reset */
+++                             udelay(50);
+++                     }
                        reboot_type = BOOT_KBD;
                        break;
                }
@@@@@ -470,6 -470,6 -470,6 -481,11 +490,11 @@@@@ static void native_machine_restart(cha
    
    static void native_machine_halt(void)
    {
+++     /* stop other cpus and apics */
+++     machine_shutdown();
+++ 
+++     /* stop this cpu */
+++     stop_this_cpu(NULL);
    }
    
    static void native_machine_power_off(void)
diff --combined arch/x86/kernel/setup.c
index 9d5674f7b6ccbfbdef7f5ad16901f9dc9dc08ad0,a3834f1232063aaf786196005dd4d42be3535395,f5096a6bf4edb25619547efeaeafb7760ece6a3b,0fa6790c1dd37d76e257de661ba3ed9312de89e0..b9018955a04ffa2b64ed0d2896c5086b052b3e4f
@@@@@ -583,7 -583,7 -583,20 -583,7 +583,20 @@@@@ static int __init setup_elfcorehdr(cha
    early_param("elfcorehdr", setup_elfcorehdr);
    #endif
    
-- -static struct x86_quirks default_x86_quirks __initdata;
++ +static int __init default_update_genapic(void)
++ +{
++ +#ifdef CONFIG_X86_SMP
++ +# if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64)
++ +    genapic->wakeup_cpu = wakeup_secondary_cpu_via_init;
++ +# endif
++ +#endif
++ +
++ +    return 0;
++ +}
++ +
++ +static struct x86_quirks default_x86_quirks __initdata = {
++ +    .update_genapic         = default_update_genapic,
++ +};
    
    struct x86_quirks *x86_quirks __initdata = &default_x86_quirks;
    
@@@@@ -764,7 -764,7 -777,7 -764,7 +777,7 @@@@@ static struct dmi_system_id __initdata 
                .callback = dmi_low_memory_corruption,
                .ident = "Phoenix BIOS",
                .matches = {
   -                    DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
   +                    DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
                },
        },
    #endif
@@@@@ -1082,7 -1082,7 -1095,7 -1082,7 +1095,7 @@@@@ void __init setup_arch(char **cmdline_p
        ioapic_init_mappings();
    
        /* need to wait for io_apic is mapped */
- --    nr_irqs = probe_nr_irqs();
+ ++    probe_nr_irqs_gsi();
    
        kvm_guest_init();
    
diff --combined init/main.c
index 79213c0785d293adc69165ec37899c2517793046,c1f999a3cf31b5c7f830f76cadc78f1e2a91a291,7e117a231af10313f1b9bd963bf404eecaf94c9e,7e117a231af10313f1b9bd963bf404eecaf94c9e..9d761aa53296b209243abdf005b6bf1f62ab86b9
    #include <linux/signal.h>
    #include <linux/idr.h>
    #include <linux/ftrace.h>
 +++#include <trace/boot.h>
    
    #include <asm/io.h>
    #include <asm/bugs.h>
@@@@@ -540,6 -539,15 -539,6 -539,6 +540,15 @@@@@ void __init __weak thread_info_cache_in
    {
    }
    
+ ++void __init __weak arch_early_irq_init(void)
+ ++{
+ ++}
+ ++
+ ++void __init __weak early_irq_init(void)
+ ++{
+ ++    arch_early_irq_init();
+ ++}
+ ++
    asmlinkage void __init start_kernel(void)
    {
        char * command_line;
        sort_main_extable();
        trap_init();
        rcu_init();
+ ++    /* init some links before init_ISA_irqs() */
+ ++    early_irq_init();
        init_IRQ();
        pidhash_init();
        init_timers();
@@@@@ -704,35 -714,31 -703,31 -703,31 +715,35 @@@@@ core_param(initcall_debug, initcall_deb
    int do_one_initcall(initcall_t fn)
    {
        int count = preempt_count();
 ---    ktime_t delta;
 +++    ktime_t calltime, delta, rettime;
        char msgbuf[64];
 ---    struct boot_trace it;
 +++    struct boot_trace_call call;
 +++    struct boot_trace_ret ret;
    
        if (initcall_debug) {
 ---            it.caller = task_pid_nr(current);
 ---            printk("calling  %pF @ %i\n", fn, it.caller);
 ---            it.calltime = ktime_get();
 +++            call.caller = task_pid_nr(current);
 +++            printk("calling  %pF @ %i\n", fn, call.caller);
 +++            calltime = ktime_get();
 +++            trace_boot_call(&call, fn);
 +++            enable_boot_trace();
        }
    
 ---    it.result = fn();
 +++    ret.result = fn();
    
        if (initcall_debug) {
 ---            it.rettime = ktime_get();
 ---            delta = ktime_sub(it.rettime, it.calltime);
 ---            it.duration = (unsigned long long) delta.tv64 >> 10;
 +++            disable_boot_trace();
 +++            rettime = ktime_get();
 +++            delta = ktime_sub(rettime, calltime);
 +++            ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10;
 +++            trace_boot_ret(&ret, fn);
                printk("initcall %pF returned %d after %Ld usecs\n", fn,
 ---                    it.result, it.duration);
 ---            trace_boot(&it, fn);
 +++                    ret.result, ret.duration);
        }
    
        msgbuf[0] = 0;
    
 ---    if (it.result && it.result != -ENODEV && initcall_debug)
 ---            sprintf(msgbuf, "error code %d ", it.result);
 +++    if (ret.result && ret.result != -ENODEV && initcall_debug)
 +++            sprintf(msgbuf, "error code %d ", ret.result);
    
        if (preempt_count() != count) {
                strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
                printk("initcall %pF returned with %s\n", fn, msgbuf);
        }
    
 ---    return it.result;
 +++    return ret.result;
    }
    
    
@@@@@ -887,7 -893,7 -882,7 -882,7 +898,7 @@@@@ static int __init kernel_init(void * un
         * we're essentially up and running. Get rid of the
         * initmem segments and start the user-mode stuff..
         */
 ---    stop_boot_trace();
 +++
        init_post();
        return 0;
    }