diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/apic.c | 20 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/genx2apic_uv_x.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic.c | 20 | ||||
-rw-r--r-- | arch/x86/kernel/olpc.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 10 |
7 files changed, 30 insertions, 42 deletions
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index cf2ca19e62da..a894eea9d51a 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c | |||
@@ -1659,35 +1659,31 @@ int __init APIC_init_uniprocessor(void) | |||
1659 | physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); | 1659 | physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); |
1660 | setup_local_APIC(); | 1660 | setup_local_APIC(); |
1661 | 1661 | ||
1662 | #ifdef CONFIG_X86_64 | 1662 | #ifdef CONFIG_X86_IO_APIC |
1663 | /* | 1663 | /* |
1664 | * Now enable IO-APICs, actually call clear_IO_APIC | 1664 | * Now enable IO-APICs, actually call clear_IO_APIC |
1665 | * We need clear_IO_APIC before enabling vector on BP | 1665 | * We need clear_IO_APIC before enabling error vector |
1666 | */ | 1666 | */ |
1667 | if (!skip_ioapic_setup && nr_ioapics) | 1667 | if (!skip_ioapic_setup && nr_ioapics) |
1668 | enable_IO_APIC(); | 1668 | enable_IO_APIC(); |
1669 | #endif | 1669 | #endif |
1670 | 1670 | ||
1671 | #ifdef CONFIG_X86_IO_APIC | ||
1672 | if (!smp_found_config || skip_ioapic_setup || !nr_ioapics) | ||
1673 | #endif | ||
1674 | localise_nmi_watchdog(); | ||
1675 | end_local_APIC_setup(); | 1671 | end_local_APIC_setup(); |
1676 | 1672 | ||
1677 | #ifdef CONFIG_X86_IO_APIC | 1673 | #ifdef CONFIG_X86_IO_APIC |
1678 | if (smp_found_config && !skip_ioapic_setup && nr_ioapics) | 1674 | if (smp_found_config && !skip_ioapic_setup && nr_ioapics) |
1679 | setup_IO_APIC(); | 1675 | setup_IO_APIC(); |
1680 | # ifdef CONFIG_X86_64 | 1676 | else { |
1681 | else | ||
1682 | nr_ioapics = 0; | 1677 | nr_ioapics = 0; |
1683 | # endif | 1678 | localise_nmi_watchdog(); |
1679 | } | ||
1680 | #else | ||
1681 | localise_nmi_watchdog(); | ||
1684 | #endif | 1682 | #endif |
1685 | 1683 | ||
1684 | setup_boot_clock(); | ||
1686 | #ifdef CONFIG_X86_64 | 1685 | #ifdef CONFIG_X86_64 |
1687 | setup_boot_APIC_clock(); | ||
1688 | check_nmi_watchdog(); | 1686 | check_nmi_watchdog(); |
1689 | #else | ||
1690 | setup_boot_clock(); | ||
1691 | #endif | 1687 | #endif |
1692 | 1688 | ||
1693 | return 0; | 1689 | return 0; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index e8f4a386bd9d..4db150ed446d 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -254,9 +254,9 @@ static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) | |||
254 | * signs here... | 254 | * signs here... |
255 | */ | 255 | */ |
256 | if (cpu_has(c, df->feature) && | 256 | if (cpu_has(c, df->feature) && |
257 | ((s32)df->feature < 0 ? | 257 | ((s32)df->level < 0 ? |
258 | (u32)df->feature > (u32)c->extended_cpuid_level : | 258 | (u32)df->level > (u32)c->extended_cpuid_level : |
259 | (s32)df->feature > (s32)c->cpuid_level)) { | 259 | (s32)df->level > (s32)c->cpuid_level)) { |
260 | clear_cpu_cap(c, df->feature); | 260 | clear_cpu_cap(c, df->feature); |
261 | if (warn) | 261 | if (warn) |
262 | printk(KERN_WARNING | 262 | printk(KERN_WARNING |
@@ -266,7 +266,7 @@ static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) | |||
266 | df->level); | 266 | df->level); |
267 | } | 267 | } |
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | /* | 271 | /* |
272 | * Naming convention should be: <Name> [(<Codename>)] | 272 | * Naming convention should be: <Name> [(<Codename>)] |
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c index 6adb5e6f4d92..89b84e004f04 100644 --- a/arch/x86/kernel/genx2apic_uv_x.c +++ b/arch/x86/kernel/genx2apic_uv_x.c | |||
@@ -114,16 +114,15 @@ int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip) | |||
114 | 114 | ||
115 | static void uv_send_IPI_one(int cpu, int vector) | 115 | static void uv_send_IPI_one(int cpu, int vector) |
116 | { | 116 | { |
117 | unsigned long val, apicid, lapicid; | 117 | unsigned long val, apicid; |
118 | int pnode; | 118 | int pnode; |
119 | 119 | ||
120 | apicid = per_cpu(x86_cpu_to_apicid, cpu); | 120 | apicid = per_cpu(x86_cpu_to_apicid, cpu); |
121 | lapicid = apicid & 0x3f; /* ZZZ macro needed */ | ||
122 | pnode = uv_apicid_to_pnode(apicid); | 121 | pnode = uv_apicid_to_pnode(apicid); |
123 | 122 | ||
124 | val = ( 1UL << UVH_IPI_INT_SEND_SHFT ) | | 123 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
125 | ( lapicid << UVH_IPI_INT_APIC_ID_SHFT ) | | 124 | (apicid << UVH_IPI_INT_APIC_ID_SHFT) | |
126 | ( vector << UVH_IPI_INT_VECTOR_SHFT ); | 125 | (vector << UVH_IPI_INT_VECTOR_SHFT); |
127 | 126 | ||
128 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | 127 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); |
129 | } | 128 | } |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 7248ca11bdcd..a89878e08a42 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -813,8 +813,9 @@ static void clear_IO_APIC (void) | |||
813 | */ | 813 | */ |
814 | 814 | ||
815 | #define MAX_PIRQS 8 | 815 | #define MAX_PIRQS 8 |
816 | static int pirq_entries [MAX_PIRQS]; | 816 | static int pirq_entries[MAX_PIRQS] = { |
817 | static int pirqs_enabled; | 817 | [0 ... MAX_PIRQS - 1] = -1 |
818 | }; | ||
818 | 819 | ||
819 | static int __init ioapic_pirq_setup(char *str) | 820 | static int __init ioapic_pirq_setup(char *str) |
820 | { | 821 | { |
@@ -823,10 +824,6 @@ static int __init ioapic_pirq_setup(char *str) | |||
823 | 824 | ||
824 | get_options(str, ARRAY_SIZE(ints), ints); | 825 | get_options(str, ARRAY_SIZE(ints), ints); |
825 | 826 | ||
826 | for (i = 0; i < MAX_PIRQS; i++) | ||
827 | pirq_entries[i] = -1; | ||
828 | |||
829 | pirqs_enabled = 1; | ||
830 | apic_printk(APIC_VERBOSE, KERN_INFO | 827 | apic_printk(APIC_VERBOSE, KERN_INFO |
831 | "PIRQ redirection, working around broken MP-BIOS.\n"); | 828 | "PIRQ redirection, working around broken MP-BIOS.\n"); |
832 | max = MAX_PIRQS; | 829 | max = MAX_PIRQS; |
@@ -1976,13 +1973,6 @@ void __init enable_IO_APIC(void) | |||
1976 | int apic; | 1973 | int apic; |
1977 | unsigned long flags; | 1974 | unsigned long flags; |
1978 | 1975 | ||
1979 | #ifdef CONFIG_X86_32 | ||
1980 | int i; | ||
1981 | if (!pirqs_enabled) | ||
1982 | for (i = 0; i < MAX_PIRQS; i++) | ||
1983 | pirq_entries[i] = -1; | ||
1984 | #endif | ||
1985 | |||
1986 | /* | 1976 | /* |
1987 | * The number of IO-APIC IRQ registers (== #pins): | 1977 | * The number of IO-APIC IRQ registers (== #pins): |
1988 | */ | 1978 | */ |
@@ -3057,13 +3047,9 @@ out: | |||
3057 | void __init setup_IO_APIC(void) | 3047 | void __init setup_IO_APIC(void) |
3058 | { | 3048 | { |
3059 | 3049 | ||
3060 | #ifdef CONFIG_X86_32 | ||
3061 | enable_IO_APIC(); | ||
3062 | #else | ||
3063 | /* | 3050 | /* |
3064 | * calling enable_IO_APIC() is moved to setup_local_APIC for BP | 3051 | * calling enable_IO_APIC() is moved to setup_local_APIC for BP |
3065 | */ | 3052 | */ |
3066 | #endif | ||
3067 | 3053 | ||
3068 | io_apic_irqs = ~PIC_IRQS; | 3054 | io_apic_irqs = ~PIC_IRQS; |
3069 | 3055 | ||
diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c index 7a13fac63a1f..4006c522adc7 100644 --- a/arch/x86/kernel/olpc.c +++ b/arch/x86/kernel/olpc.c | |||
@@ -203,7 +203,7 @@ static void __init platform_detect(void) | |||
203 | static void __init platform_detect(void) | 203 | static void __init platform_detect(void) |
204 | { | 204 | { |
205 | /* stopgap until OFW support is added to the kernel */ | 205 | /* stopgap until OFW support is added to the kernel */ |
206 | olpc_platform_info.boardrev = 0xc2; | 206 | olpc_platform_info.boardrev = olpc_board(0xc2); |
207 | } | 207 | } |
208 | #endif | 208 | #endif |
209 | 209 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index af57f88186e7..10834954e301 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1154,13 +1154,12 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
1154 | */ | 1154 | */ |
1155 | setup_local_APIC(); | 1155 | setup_local_APIC(); |
1156 | 1156 | ||
1157 | #ifdef CONFIG_X86_64 | ||
1158 | /* | 1157 | /* |
1159 | * Enable IO APIC before setting up error vector | 1158 | * Enable IO APIC before setting up error vector |
1160 | */ | 1159 | */ |
1161 | if (!skip_ioapic_setup && nr_ioapics) | 1160 | if (!skip_ioapic_setup && nr_ioapics) |
1162 | enable_IO_APIC(); | 1161 | enable_IO_APIC(); |
1163 | #endif | 1162 | |
1164 | end_local_APIC_setup(); | 1163 | end_local_APIC_setup(); |
1165 | 1164 | ||
1166 | map_cpu_to_logical_apicid(); | 1165 | map_cpu_to_logical_apicid(); |
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index bde57f0f1616..acb8c0585ab9 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -98,6 +98,12 @@ static inline void preempt_conditional_sti(struct pt_regs *regs) | |||
98 | local_irq_enable(); | 98 | local_irq_enable(); |
99 | } | 99 | } |
100 | 100 | ||
101 | static inline void conditional_cli(struct pt_regs *regs) | ||
102 | { | ||
103 | if (regs->flags & X86_EFLAGS_IF) | ||
104 | local_irq_disable(); | ||
105 | } | ||
106 | |||
101 | static inline void preempt_conditional_cli(struct pt_regs *regs) | 107 | static inline void preempt_conditional_cli(struct pt_regs *regs) |
102 | { | 108 | { |
103 | if (regs->flags & X86_EFLAGS_IF) | 109 | if (regs->flags & X86_EFLAGS_IF) |
@@ -625,8 +631,10 @@ clear_dr7: | |||
625 | 631 | ||
626 | #ifdef CONFIG_X86_32 | 632 | #ifdef CONFIG_X86_32 |
627 | debug_vm86: | 633 | debug_vm86: |
634 | /* reenable preemption: handle_vm86_trap() might sleep */ | ||
635 | dec_preempt_count(); | ||
628 | handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1); | 636 | handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1); |
629 | preempt_conditional_cli(regs); | 637 | conditional_cli(regs); |
630 | return; | 638 | return; |
631 | #endif | 639 | #endif |
632 | 640 | ||