Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+23 -39
+1 -1
arch/x86/Makefile
··· 74 74 75 75 ifdef CONFIG_CC_STACKPROTECTOR 76 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 78 stackp-y := -fstack-protector 79 79 KBUILD_CFLAGS += $(stackp-y) 80 80 else
+2 -2
arch/x86/include/asm/cpufeature.h
··· 296 296 297 297 #endif /* CONFIG_X86_64 */ 298 298 299 + #if __GNUC__ >= 4 299 300 /* 300 301 * Static testing of CPU features. Used the same as boot_cpu_has(). 301 302 * These are only valid after alternatives have run, but will statically ··· 305 304 */ 306 305 static __always_inline __pure bool __static_cpu_has(u16 bit) 307 306 { 308 - #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) 307 + #if __GNUC__ > 4 || __GNUC_MINOR__ >= 5 309 308 asm goto("1: jmp %l[t_no]\n" 310 309 "2:\n" 311 310 ".section .altinstructions,\"a\"\n" ··· 346 345 #endif 347 346 } 348 347 349 - #if __GNUC__ >= 4 350 348 #define static_cpu_has(bit) \ 351 349 ( \ 352 350 __builtin_constant_p(boot_cpu_has(bit)) ? \
-1
arch/x86/include/asm/hpet.h
··· 68 68 extern u8 hpet_blockid; 69 69 extern int hpet_force_user; 70 70 extern u8 hpet_msi_disable; 71 - extern u8 hpet_readback_cmp; 72 71 extern int is_hpet_enabled(void); 73 72 extern int hpet_enable(void); 74 73 extern void hpet_disable(void);
+3 -3
arch/x86/kernel/apic/x2apic_uv_x.c
··· 698 698 for (j = 0; j < 64; j++) { 699 699 if (!test_bit(j, &present)) 700 700 continue; 701 - uv_blade_info[blade].pnode = (i * 64 + j); 701 + pnode = (i * 64 + j); 702 + uv_blade_info[blade].pnode = pnode; 702 703 uv_blade_info[blade].nr_possible_cpus = 0; 703 704 uv_blade_info[blade].nr_online_cpus = 0; 705 + max_pnode = max(pnode, max_pnode); 704 706 blade++; 705 707 } 706 708 } ··· 740 738 uv_cpu_hub_info(cpu)->scir.offset = uv_scir_offset(apicid); 741 739 uv_node_to_blade[nid] = blade; 742 740 uv_cpu_to_blade[cpu] = blade; 743 - max_pnode = max(pnode, max_pnode); 744 741 } 745 742 746 743 /* Add blade/pnode info for nodes without cpus */ ··· 751 750 pnode = (paddr >> m_val) & pnode_mask; 752 751 blade = boot_pnode_to_blade(pnode); 753 752 uv_node_to_blade[nid] = blade; 754 - max_pnode = max(pnode, max_pnode); 755 753 } 756 754 757 755 map_gru_high(max_pnode);
-18
arch/x86/kernel/early-quirks.c
··· 18 18 #include <asm/apic.h> 19 19 #include <asm/iommu.h> 20 20 #include <asm/gart.h> 21 - #include <asm/hpet.h> 22 21 23 22 static void __init fix_hypertransport_config(int num, int slot, int func) 24 23 { ··· 191 192 } 192 193 #endif 193 194 194 - /* 195 - * Force the read back of the CMP register in hpet_next_event() 196 - * to work around the problem that the CMP register write seems to be 197 - * delayed. See hpet_next_event() for details. 198 - * 199 - * We do this on all SMBUS incarnations for now until we have more 200 - * information about the affected chipsets. 201 - */ 202 - static void __init ati_hpet_bugs(int num, int slot, int func) 203 - { 204 - #ifdef CONFIG_HPET_TIMER 205 - hpet_readback_cmp = 1; 206 - #endif 207 - } 208 - 209 195 #define QFLAG_APPLY_ONCE 0x1 210 196 #define QFLAG_APPLIED 0x2 211 197 #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) ··· 220 236 PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, 221 237 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, 222 238 PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, 223 - { PCI_VENDOR_ID_ATI, PCI_ANY_ID, 224 - PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_hpet_bugs }, 225 239 {} 226 240 }; 227 241
+17 -14
arch/x86/kernel/hpet.c
··· 35 35 unsigned long hpet_address; 36 36 u8 hpet_blockid; /* OS timer block num */ 37 37 u8 hpet_msi_disable; 38 - u8 hpet_readback_cmp; 39 38 40 39 #ifdef CONFIG_PCI_MSI 41 40 static unsigned long hpet_num_timers; ··· 394 395 * at that point and we would wait for the next hpet interrupt 395 396 * forever. We found out that reading the CMP register back 396 397 * forces the transfer so we can rely on the comparison with 397 - * the counter register below. 398 + * the counter register below. If the read back from the 399 + * compare register does not match the value we programmed 400 + * then we might have a real hardware problem. We can not do 401 + * much about it here, but at least alert the user/admin with 402 + * a prominent warning. 398 403 * 399 - * That works fine on those ATI chipsets, but on newer Intel 400 - * chipsets (ICH9...) this triggers due to an erratum: Reading 401 - * the comparator immediately following a write is returning 402 - * the old value. 404 + * An erratum on some chipsets (ICH9,..), results in 405 + * comparator read immediately following a write returning old 406 + * value. Workaround for this is to read this value second 407 + * time, when first read returns old value. 403 408 * 404 - * We restrict the read back to the affected ATI chipsets (set 405 - * by quirks) and also run it with hpet=verbose for debugging 406 - * purposes. 409 + * In fact the write to the comparator register is delayed up 410 + * to two HPET cycles so the workaround we tried to restrict 411 + * the readback to those known to be borked ATI chipsets 412 + * failed miserably. So we give up on optimizations forever 413 + * and penalize all HPET incarnations unconditionally. 407 414 */ 408 - if (hpet_readback_cmp || hpet_verbose) { 409 - u32 cmp = hpet_readl(HPET_Tn_CMP(timer)); 410 - 411 - if (cmp != cnt) 415 + if (unlikely((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt)) { 416 + if (hpet_readl(HPET_Tn_CMP(timer)) != cnt) 412 417 printk_once(KERN_WARNING 413 - "hpet: compare register read back failed.\n"); 418 + "hpet: compare register read back failed.\n"); 414 419 } 415 420 416 421 return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;