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, uv: Ensure hub revision set for all ACPI modes.
x86, uv: Add function retrieving node controller revision number
x86: xen: 64-bit kernel RPL should be 0
x86: kernel_thread() -- initialize SS to a known state
x86/agp: Fix agp_amd64_init and agp_amd64_cleanup
x86: SGI UV: Fix mapping of MMIO registers
x86: mce.h: Fix warning in header checks

+42 -11
+2 -1
arch/x86/include/asm/mce.h
··· 108 #define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) 109 #define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) 110 111 - extern struct atomic_notifier_head x86_mce_decoder_chain; 112 113 #ifdef __KERNEL__ 114 115 #include <linux/percpu.h> 116 #include <linux/init.h>
··· 108 #define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) 109 #define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) 110 111 112 #ifdef __KERNEL__ 113 + 114 + extern struct atomic_notifier_head x86_mce_decoder_chain; 115 116 #include <linux/percpu.h> 117 #include <linux/init.h>
+12
arch/x86/include/asm/uv/uv_hub.h
··· 495 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 496 } 497 498 #endif /* CONFIG_X86_64 */ 499 #endif /* _ASM_X86_UV_UV_HUB_H */
··· 495 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 496 } 497 498 + /* 499 + * Get the minimum revision number of the hub chips within the partition. 500 + * 1 - initial rev 1.0 silicon 501 + * 2 - rev 2.0 production silicon 502 + */ 503 + static inline int uv_get_min_hub_revision_id(void) 504 + { 505 + extern int uv_min_hub_revision_id; 506 + 507 + return uv_min_hub_revision_id; 508 + } 509 + 510 #endif /* CONFIG_X86_64 */ 511 #endif /* _ASM_X86_UV_UV_HUB_H */
+1
arch/x86/kernel/aperture_64.c
··· 31 #include <asm/x86_init.h> 32 33 int gart_iommu_aperture; 34 int gart_iommu_aperture_disabled __initdata; 35 int gart_iommu_aperture_allowed __initdata; 36
··· 31 #include <asm/x86_init.h> 32 33 int gart_iommu_aperture; 34 + EXPORT_SYMBOL_GPL(gart_iommu_aperture); 35 int gart_iommu_aperture_disabled __initdata; 36 int gart_iommu_aperture_allowed __initdata; 37
+18 -8
arch/x86/kernel/apic/x2apic_uv_x.c
··· 36 37 static enum uv_system_type uv_system_type; 38 static u64 gru_start_paddr, gru_end_paddr; 39 40 static inline bool is_GRU_range(u64 start, u64 end) 41 { ··· 57 mmr = early_ioremap(UV_LOCAL_MMR_BASE | UVH_NODE_ID, sizeof(*mmr)); 58 node_id.v = *mmr; 59 early_iounmap(mmr, sizeof(*mmr)); 60 return node_id.s.node_id; 61 } 62 63 static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 64 { 65 if (!strcmp(oem_id, "SGI")) { 66 x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; 67 if (!strcmp(oem_table_id, "UVL")) 68 uv_system_type = UV_LEGACY_APIC; ··· 77 uv_system_type = UV_X2APIC; 78 else if (!strcmp(oem_table_id, "UVH")) { 79 __get_cpu_var(x2apic_extra_bits) = 80 - early_get_nodeid() << (UV_APIC_PNODE_SHIFT - 1); 81 uv_system_type = UV_NON_UNIQUE_APIC; 82 return 1; 83 } ··· 383 384 enum map_type {map_wb, map_uc}; 385 386 - static __init void map_high(char *id, unsigned long base, int shift, 387 - int max_pnode, enum map_type map_type) 388 { 389 unsigned long bytes, paddr; 390 391 - paddr = base << shift; 392 - bytes = (1UL << shift) * (max_pnode + 1); 393 printk(KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n", id, paddr, 394 paddr + bytes); 395 if (map_type == map_uc) ··· 405 406 gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR); 407 if (gru.s.enable) { 408 - map_high("GRU", gru.s.base, shift, max_pnode, map_wb); 409 gru_start_paddr = ((u64)gru.s.base << shift); 410 gru_end_paddr = gru_start_paddr + (1UL << shift) * (max_pnode + 1); 411 ··· 419 420 mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR); 421 if (mmr.s.enable) 422 - map_high("MMR", mmr.s.base, shift, max_pnode, map_uc); 423 } 424 425 static __init void map_mmioh_high(int max_pnode) ··· 429 430 mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); 431 if (mmioh.s.enable) 432 - map_high("MMIOH", mmioh.s.base, shift, max_pnode, map_uc); 433 } 434 435 static __init void map_low_mmrs(void)
··· 36 37 static enum uv_system_type uv_system_type; 38 static u64 gru_start_paddr, gru_end_paddr; 39 + int uv_min_hub_revision_id; 40 + EXPORT_SYMBOL_GPL(uv_min_hub_revision_id); 41 42 static inline bool is_GRU_range(u64 start, u64 end) 43 { ··· 55 mmr = early_ioremap(UV_LOCAL_MMR_BASE | UVH_NODE_ID, sizeof(*mmr)); 56 node_id.v = *mmr; 57 early_iounmap(mmr, sizeof(*mmr)); 58 + 59 + /* Currently, all blades have same revision number */ 60 + uv_min_hub_revision_id = node_id.s.revision; 61 + 62 return node_id.s.node_id; 63 } 64 65 static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 66 { 67 + int nodeid; 68 + 69 if (!strcmp(oem_id, "SGI")) { 70 + nodeid = early_get_nodeid(); 71 x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range; 72 if (!strcmp(oem_table_id, "UVL")) 73 uv_system_type = UV_LEGACY_APIC; ··· 68 uv_system_type = UV_X2APIC; 69 else if (!strcmp(oem_table_id, "UVH")) { 70 __get_cpu_var(x2apic_extra_bits) = 71 + nodeid << (UV_APIC_PNODE_SHIFT - 1); 72 uv_system_type = UV_NON_UNIQUE_APIC; 73 return 1; 74 } ··· 374 375 enum map_type {map_wb, map_uc}; 376 377 + static __init void map_high(char *id, unsigned long base, int pshift, 378 + int bshift, int max_pnode, enum map_type map_type) 379 { 380 unsigned long bytes, paddr; 381 382 + paddr = base << pshift; 383 + bytes = (1UL << bshift) * (max_pnode + 1); 384 printk(KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n", id, paddr, 385 paddr + bytes); 386 if (map_type == map_uc) ··· 396 397 gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR); 398 if (gru.s.enable) { 399 + map_high("GRU", gru.s.base, shift, shift, max_pnode, map_wb); 400 gru_start_paddr = ((u64)gru.s.base << shift); 401 gru_end_paddr = gru_start_paddr + (1UL << shift) * (max_pnode + 1); 402 ··· 410 411 mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR); 412 if (mmr.s.enable) 413 + map_high("MMR", mmr.s.base, shift, shift, max_pnode, map_uc); 414 } 415 416 static __init void map_mmioh_high(int max_pnode) ··· 420 421 mmioh.v = uv_read_local_mmr(UVH_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR); 422 if (mmioh.s.enable) 423 + map_high("MMIOH", mmioh.s.base, shift, mmioh.s.m_io, 424 + max_pnode, map_uc); 425 } 426 427 static __init void map_low_mmrs(void)
+2
arch/x86/kernel/process.c
··· 288 regs.es = __USER_DS; 289 regs.fs = __KERNEL_PERCPU; 290 regs.gs = __KERNEL_STACK_CANARY; 291 #endif 292 293 regs.orig_ax = -1;
··· 288 regs.es = __USER_DS; 289 regs.fs = __KERNEL_PERCPU; 290 regs.gs = __KERNEL_STACK_CANARY; 291 + #else 292 + regs.ss = __KERNEL_DS; 293 #endif 294 295 regs.orig_ax = -1;
+4
arch/x86/xen/enlighten.c
··· 1151 1152 /* keep using Xen gdt for now; no urgent need to change it */ 1153 1154 pv_info.kernel_rpl = 1; 1155 if (xen_feature(XENFEAT_supervisor_mode_kernel)) 1156 pv_info.kernel_rpl = 0; 1157 1158 /* set the limit of our address space */ 1159 xen_reserve_top();
··· 1151 1152 /* keep using Xen gdt for now; no urgent need to change it */ 1153 1154 + #ifdef CONFIG_X86_32 1155 pv_info.kernel_rpl = 1; 1156 if (xen_feature(XENFEAT_supervisor_mode_kernel)) 1157 pv_info.kernel_rpl = 0; 1158 + #else 1159 + pv_info.kernel_rpl = 0; 1160 + #endif 1161 1162 /* set the limit of our address space */ 1163 xen_reserve_top();
+3 -2
drivers/char/agp/amd64-agp.c
··· 725 int __init agp_amd64_init(void) 726 { 727 int err = 0; 728 - static int done = 0; 729 730 if (agp_off) 731 return -EINVAL; 732 733 - if (done++) 734 return agp_bridges_found ? 0 : -ENODEV; 735 736 err = pci_register_driver(&agp_amd64_pci_driver); ··· 770 771 static void __exit agp_amd64_cleanup(void) 772 { 773 if (aperture_resource) 774 release_resource(aperture_resource); 775 pci_unregister_driver(&agp_amd64_pci_driver);
··· 725 int __init agp_amd64_init(void) 726 { 727 int err = 0; 728 729 if (agp_off) 730 return -EINVAL; 731 732 + if (gart_iommu_aperture) 733 return agp_bridges_found ? 0 : -ENODEV; 734 735 err = pci_register_driver(&agp_amd64_pci_driver); ··· 771 772 static void __exit agp_amd64_cleanup(void) 773 { 774 + if (gart_iommu_aperture) 775 + return; 776 if (aperture_resource) 777 release_resource(aperture_resource); 778 pci_unregister_driver(&agp_amd64_pci_driver);