diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-16 22:38:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-16 22:38:08 -0400 |
commit | a5b617368c8d61072844ac267aaf140e489b808b (patch) | |
tree | 2b7699b6bd7d044a0301962d679682f99a0718ab /arch/x86 | |
parent | 03a7ab083e4d619136d6f07ce70fa9de0bc436fc (diff) | |
parent | 54ff7e595d763d894104d421b103a89f7becf47c (diff) |
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: hpet: Work around hardware stupidity
x86, build: Disable -fPIE when compiling with CONFIG_CC_STACKPROTECTOR=y
x86, cpufeature: Suppress compiler warning with gcc 3.x
x86, UV: Fix initialization of max_pnode
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/cpufeature.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/hpet.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/early-quirks.c | 18 | ||||
-rw-r--r-- | arch/x86/kernel/hpet.c | 31 |
6 files changed, 23 insertions, 39 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 8aa1b59b9074..e8c8881351b3 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -74,7 +74,7 @@ endif | |||
74 | 74 | ||
75 | ifdef CONFIG_CC_STACKPROTECTOR | 75 | ifdef CONFIG_CC_STACKPROTECTOR |
76 | cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh | 76 | cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh |
77 | ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(biarch)),y) | 77 | ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(KBUILD_CPPFLAGS) $(biarch)),y) |
78 | stackp-y := -fstack-protector | 78 | stackp-y := -fstack-protector |
79 | KBUILD_CFLAGS += $(stackp-y) | 79 | KBUILD_CFLAGS += $(stackp-y) |
80 | else | 80 | else |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 781a50b29a49..c6fbb7b430d1 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -296,6 +296,7 @@ extern const char * const x86_power_flags[32]; | |||
296 | 296 | ||
297 | #endif /* CONFIG_X86_64 */ | 297 | #endif /* CONFIG_X86_64 */ |
298 | 298 | ||
299 | #if __GNUC__ >= 4 | ||
299 | /* | 300 | /* |
300 | * Static testing of CPU features. Used the same as boot_cpu_has(). | 301 | * Static testing of CPU features. Used the same as boot_cpu_has(). |
301 | * These are only valid after alternatives have run, but will statically | 302 | * These are only valid after alternatives have run, but will statically |
@@ -304,7 +305,7 @@ extern const char * const x86_power_flags[32]; | |||
304 | */ | 305 | */ |
305 | static __always_inline __pure bool __static_cpu_has(u16 bit) | 306 | static __always_inline __pure bool __static_cpu_has(u16 bit) |
306 | { | 307 | { |
307 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) | 308 | #if __GNUC__ > 4 || __GNUC_MINOR__ >= 5 |
308 | asm goto("1: jmp %l[t_no]\n" | 309 | asm goto("1: jmp %l[t_no]\n" |
309 | "2:\n" | 310 | "2:\n" |
310 | ".section .altinstructions,\"a\"\n" | 311 | ".section .altinstructions,\"a\"\n" |
@@ -345,7 +346,6 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
345 | #endif | 346 | #endif |
346 | } | 347 | } |
347 | 348 | ||
348 | #if __GNUC__ >= 4 | ||
349 | #define static_cpu_has(bit) \ | 349 | #define static_cpu_has(bit) \ |
350 | ( \ | 350 | ( \ |
351 | __builtin_constant_p(boot_cpu_has(bit)) ? \ | 351 | __builtin_constant_p(boot_cpu_has(bit)) ? \ |
diff --git a/arch/x86/include/asm/hpet.h b/arch/x86/include/asm/hpet.h index 004e6e25e913..1d5c08a1bdfd 100644 --- a/arch/x86/include/asm/hpet.h +++ b/arch/x86/include/asm/hpet.h | |||
@@ -68,7 +68,6 @@ extern unsigned long force_hpet_address; | |||
68 | extern u8 hpet_blockid; | 68 | extern u8 hpet_blockid; |
69 | extern int hpet_force_user; | 69 | extern int hpet_force_user; |
70 | extern u8 hpet_msi_disable; | 70 | extern u8 hpet_msi_disable; |
71 | extern u8 hpet_readback_cmp; | ||
72 | extern int is_hpet_enabled(void); | 71 | extern int is_hpet_enabled(void); |
73 | extern int hpet_enable(void); | 72 | extern int hpet_enable(void); |
74 | extern void hpet_disable(void); | 73 | extern void hpet_disable(void); |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 7b598b84c902..f744f54cb248 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -698,9 +698,11 @@ void __init uv_system_init(void) | |||
698 | for (j = 0; j < 64; j++) { | 698 | for (j = 0; j < 64; j++) { |
699 | if (!test_bit(j, &present)) | 699 | if (!test_bit(j, &present)) |
700 | continue; | 700 | continue; |
701 | uv_blade_info[blade].pnode = (i * 64 + j); | 701 | pnode = (i * 64 + j); |
702 | uv_blade_info[blade].pnode = pnode; | ||
702 | uv_blade_info[blade].nr_possible_cpus = 0; | 703 | uv_blade_info[blade].nr_possible_cpus = 0; |
703 | uv_blade_info[blade].nr_online_cpus = 0; | 704 | uv_blade_info[blade].nr_online_cpus = 0; |
705 | max_pnode = max(pnode, max_pnode); | ||
704 | blade++; | 706 | blade++; |
705 | } | 707 | } |
706 | } | 708 | } |
@@ -738,7 +740,6 @@ void __init uv_system_init(void) | |||
738 | uv_cpu_hub_info(cpu)->scir.offset = uv_scir_offset(apicid); | 740 | uv_cpu_hub_info(cpu)->scir.offset = uv_scir_offset(apicid); |
739 | uv_node_to_blade[nid] = blade; | 741 | uv_node_to_blade[nid] = blade; |
740 | uv_cpu_to_blade[cpu] = blade; | 742 | uv_cpu_to_blade[cpu] = blade; |
741 | max_pnode = max(pnode, max_pnode); | ||
742 | } | 743 | } |
743 | 744 | ||
744 | /* Add blade/pnode info for nodes without cpus */ | 745 | /* Add blade/pnode info for nodes without cpus */ |
@@ -750,7 +751,6 @@ void __init uv_system_init(void) | |||
750 | pnode = (paddr >> m_val) & pnode_mask; | 751 | pnode = (paddr >> m_val) & pnode_mask; |
751 | blade = boot_pnode_to_blade(pnode); | 752 | blade = boot_pnode_to_blade(pnode); |
752 | uv_node_to_blade[nid] = blade; | 753 | uv_node_to_blade[nid] = blade; |
753 | max_pnode = max(pnode, max_pnode); | ||
754 | } | 754 | } |
755 | 755 | ||
756 | map_gru_high(max_pnode); | 756 | map_gru_high(max_pnode); |
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index e5cc7e82e60d..ebdb85cf2686 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <asm/apic.h> | 18 | #include <asm/apic.h> |
19 | #include <asm/iommu.h> | 19 | #include <asm/iommu.h> |
20 | #include <asm/gart.h> | 20 | #include <asm/gart.h> |
21 | #include <asm/hpet.h> | ||
22 | 21 | ||
23 | static void __init fix_hypertransport_config(int num, int slot, int func) | 22 | static void __init fix_hypertransport_config(int num, int slot, int func) |
24 | { | 23 | { |
@@ -192,21 +191,6 @@ static void __init ati_bugs_contd(int num, int slot, int func) | |||
192 | } | 191 | } |
193 | #endif | 192 | #endif |
194 | 193 | ||
195 | /* | ||
196 | * Force the read back of the CMP register in hpet_next_event() | ||
197 | * to work around the problem that the CMP register write seems to be | ||
198 | * delayed. See hpet_next_event() for details. | ||
199 | * | ||
200 | * We do this on all SMBUS incarnations for now until we have more | ||
201 | * information about the affected chipsets. | ||
202 | */ | ||
203 | static void __init ati_hpet_bugs(int num, int slot, int func) | ||
204 | { | ||
205 | #ifdef CONFIG_HPET_TIMER | ||
206 | hpet_readback_cmp = 1; | ||
207 | #endif | ||
208 | } | ||
209 | |||
210 | #define QFLAG_APPLY_ONCE 0x1 | 194 | #define QFLAG_APPLY_ONCE 0x1 |
211 | #define QFLAG_APPLIED 0x2 | 195 | #define QFLAG_APPLIED 0x2 |
212 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) | 196 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) |
@@ -236,8 +220,6 @@ static struct chipset early_qrk[] __initdata = { | |||
236 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, | 220 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, |
237 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, | 221 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, |
238 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, | 222 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, |
239 | { PCI_VENDOR_ID_ATI, PCI_ANY_ID, | ||
240 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_hpet_bugs }, | ||
241 | {} | 223 | {} |
242 | }; | 224 | }; |
243 | 225 | ||
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 351f9c0fea1f..410fdb3f1939 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -35,7 +35,6 @@ | |||
35 | unsigned long hpet_address; | 35 | unsigned long hpet_address; |
36 | u8 hpet_blockid; /* OS timer block num */ | 36 | u8 hpet_blockid; /* OS timer block num */ |
37 | u8 hpet_msi_disable; | 37 | u8 hpet_msi_disable; |
38 | u8 hpet_readback_cmp; | ||
39 | 38 | ||
40 | #ifdef CONFIG_PCI_MSI | 39 | #ifdef CONFIG_PCI_MSI |
41 | static unsigned long hpet_num_timers; | 40 | static unsigned long hpet_num_timers; |
@@ -395,23 +394,27 @@ static int hpet_next_event(unsigned long delta, | |||
395 | * at that point and we would wait for the next hpet interrupt | 394 | * at that point and we would wait for the next hpet interrupt |
396 | * forever. We found out that reading the CMP register back | 395 | * forever. We found out that reading the CMP register back |
397 | * forces the transfer so we can rely on the comparison with | 396 | * forces the transfer so we can rely on the comparison with |
398 | * the counter register below. | 397 | * the counter register below. If the read back from the |
398 | * compare register does not match the value we programmed | ||
399 | * then we might have a real hardware problem. We can not do | ||
400 | * much about it here, but at least alert the user/admin with | ||
401 | * a prominent warning. | ||
399 | * | 402 | * |
400 | * That works fine on those ATI chipsets, but on newer Intel | 403 | * An erratum on some chipsets (ICH9,..), results in |
401 | * chipsets (ICH9...) this triggers due to an erratum: Reading | 404 | * comparator read immediately following a write returning old |
402 | * the comparator immediately following a write is returning | 405 | * value. Workaround for this is to read this value second |
403 | * the old value. | 406 | * time, when first read returns old value. |
404 | * | 407 | * |
405 | * We restrict the read back to the affected ATI chipsets (set | 408 | * In fact the write to the comparator register is delayed up |
406 | * by quirks) and also run it with hpet=verbose for debugging | 409 | * to two HPET cycles so the workaround we tried to restrict |
407 | * purposes. | 410 | * the readback to those known to be borked ATI chipsets |
411 | * failed miserably. So we give up on optimizations forever | ||
412 | * and penalize all HPET incarnations unconditionally. | ||
408 | */ | 413 | */ |
409 | if (hpet_readback_cmp || hpet_verbose) { | 414 | if (unlikely((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt)) { |
410 | u32 cmp = hpet_readl(HPET_Tn_CMP(timer)); | 415 | if (hpet_readl(HPET_Tn_CMP(timer)) != cnt) |
411 | |||
412 | if (cmp != cnt) | ||
413 | printk_once(KERN_WARNING | 416 | printk_once(KERN_WARNING |
414 | "hpet: compare register read back failed.\n"); | 417 | "hpet: compare register read back failed.\n"); |
415 | } | 418 | } |
416 | 419 | ||
417 | return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; | 420 | return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; |