From 9cbfe20068878d597cfa064be9cab871875bea60 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 21 Apr 2008 11:47:46 +0300 Subject: x86: remove Xgt_desc_struct The comment says it should have been removed in 2.6.25. Signed-off-by: Adrian Bunk Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/processor.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 2e7974ec77e..559105220a4 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h @@ -3,9 +3,6 @@ #include -/* migration helper, for KVM - will be removed in 2.6.25: */ -#define Xgt_desc_struct desc_ptr - /* Forward declaration, a strange C thing */ struct task_struct; struct mm_struct; -- cgit v1.2.3 From b9e017e04be672244502a0567fb752973556f388 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 21 Apr 2008 11:51:44 +0300 Subject: x86: unexport kmap_atomic_to_page This patch removes the no longer used export of kmap_atomic_to_page. Signed-off-by: Adrian Bunk Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/mm/highmem_32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index 9cf33d3ee5b..165c871ba9a 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c @@ -155,4 +155,3 @@ EXPORT_SYMBOL(kmap); EXPORT_SYMBOL(kunmap); EXPORT_SYMBOL(kmap_atomic); EXPORT_SYMBOL(kunmap_atomic); -EXPORT_SYMBOL(kmap_atomic_to_page); -- cgit v1.2.3 From fc3fbc45098e5aff59f06962dee79aba2e11430d Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sun, 27 Apr 2008 14:04:14 +0200 Subject: hpet: fix Al Viro pointed out that there's a missing readl() of timer->hpet_config, found by Sparse. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/hpet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 9007f9ea64e..9b5cfcdfc42 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -137,9 +137,10 @@ static void hpet_reserve_platform_timers(unsigned long id) hd.hd_irq[0] = HPET_LEGACY_8254; hd.hd_irq[1] = HPET_LEGACY_RTC; - for (i = 2; i < nrtimers; timer++, i++) - hd.hd_irq[i] = (timer->hpet_config & Tn_INT_ROUTE_CNF_MASK) >> + for (i = 2; i < nrtimers; timer++, i++) { + hd.hd_irq[i] = (readl(&timer->hpet_config) & Tn_INT_ROUTE_CNF_MASK) >> Tn_INT_ROUTE_CNF_SHIFT; + } hpet_alloc(&hd); -- cgit v1.2.3 From ed5e233284bc4aff965df7351da8426aa188c8f9 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sun, 27 Apr 2008 23:21:03 +0200 Subject: x86, voyager: fix ioremap_nocache() James Bottomley reported that the following commit: | commit 6371b495991debfd1417b17c2bc4f7d7bae05739 | Author: Ingo Molnar | Date: Wed Jan 30 13:33:40 2008 +0100 | | x86: change ioremap() to default to uncached broke Voyager. James says: " it broke a class of voyager machines: those which rely on the quad interrupt controller (QIC). The precis of why they broke is because the QIC does IPIs (or CPIs in its terminology) via cache line interference: you interrupt a processor by moving a designated memory area to write exclusive in the cache (by simply writing to the line) and the CPU acks the interrupt by moving it back to read shared (by reading from it). That area, is, of course, mapped by ioremap, so reversing the ioremap semantics and adding the uncached bit completely breaks the QIC. " Sorry about that! Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/mach-voyager/voyager_cat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mach-voyager/voyager_cat.c b/arch/x86/mach-voyager/voyager_cat.c index ecab9fff0fd..2ad598c104a 100644 --- a/arch/x86/mach-voyager/voyager_cat.c +++ b/arch/x86/mach-voyager/voyager_cat.c @@ -877,7 +877,7 @@ void __init voyager_cat_init(void) request_resource(&iomem_resource, res); } - qic_addr = (unsigned long)ioremap(qic_addr, 0x400); + qic_addr = (unsigned long)ioremap_cache(qic_addr, 0x400); for (j = 0; j < 4; j++) { __u8 cpu; -- cgit v1.2.3 From 3e8f7e35f3fd17eadef44e4679abb39a3806cf01 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 28 Apr 2008 10:46:58 +0200 Subject: x86 VISWS: build fix the 'reboot_force' flag is a notion that non-PC subarchitectures do not have. also, unify the X86_BIOS_REBOOT option between 32-bit and 64-bit and get rid of a few unnecessary Kconfig and Makefile complications that way. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig | 4 ++-- arch/x86/kernel/Makefile | 1 - include/asm-x86/proto.h | 4 ++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f70e3e3a9fa..80303187b87 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -180,7 +180,7 @@ config X86_HT config X86_BIOS_REBOOT bool - depends on X86_32 && !(X86_VISWS || X86_VOYAGER) + depends on !X86_VISWS && !X86_VOYAGER default y config X86_TRAMPOLINE @@ -1161,7 +1161,7 @@ source kernel/Kconfig.hz config KEXEC bool "kexec system call" - depends on X86_64 || X86_BIOS_REBOOT + depends on X86_BIOS_REBOOT help kexec is a system call that implements the ability to shutdown your current kernel, and to start another kernel. It is like a reboot diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 30d54ed27e5..bbdacb398d4 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -40,7 +40,6 @@ obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-y += cpu/ obj-y += acpi/ obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o -obj-$(CONFIG_X86_64) += reboot.o obj-$(CONFIG_MCA) += mca_32.o obj-$(CONFIG_X86_MSR) += msr.o obj-$(CONFIG_X86_CPUID) += cpuid.o diff --git a/include/asm-x86/proto.h b/include/asm-x86/proto.h index 1e17bcce450..6c8b41b03f6 100644 --- a/include/asm-x86/proto.h +++ b/include/asm-x86/proto.h @@ -20,7 +20,11 @@ extern void syscall32_cpu_init(void); extern void check_efer(void); +#ifdef CONFIG_X86_BIOS_REBOOT extern int reboot_force; +#else +static const int reboot_force = 0; +#endif long do_arch_prctl(struct task_struct *task, int code, unsigned long addr); -- cgit v1.2.3 From 4412620fc2772af0fc7a94b2cfa28792a46b4fc8 Mon Sep 17 00:00:00 2001 From: Dmitri Vorobiev Date: Mon, 28 Apr 2008 03:15:59 +0400 Subject: x86: add proper header for reboot_force This patch fixes one sparse warning by including the appropriate header for the reboot_force symbol. Signed-off-by: Dmitri Vorobiev Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/reboot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index a4a838306b2..07c6d42ab5f 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From b4cdc4300de6ff7b8b366f23bed17c7d59c8117c Mon Sep 17 00:00:00 2001 From: Dmitri Vorobiev Date: Mon, 28 Apr 2008 03:15:58 +0400 Subject: x86: iommu_sac_force can become static The iommu_sac_force variable is needlessly defined global, and this patch makes it static. Additionally, this variable needs not be explicitly initialized. Signed-off-by: Dmitri Vorobiev Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 388b113a7d8..0c37f16b695 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -14,7 +14,7 @@ EXPORT_SYMBOL(forbid_dac); const struct dma_mapping_ops *dma_ops; EXPORT_SYMBOL(dma_ops); -int iommu_sac_force __read_mostly = 0; +static int iommu_sac_force __read_mostly; #ifdef CONFIG_IOMMU_DEBUG int panic_on_overflow __read_mostly = 1; -- cgit v1.2.3 From 575ca7351bf0546919060071797cccb4a05960df Mon Sep 17 00:00:00 2001 From: Vegard Nossum Date: Fri, 25 Apr 2008 21:02:34 +0200 Subject: x86: fix early-BUG message The .asciz directive takes any number of strings, but each one is zero- terminated, and string pasting is not done as in C. That results in only the first line being output. Replace .asciz with multiple .ascii directives and terminate with .asciz. Signed-off-by: Vegard Nossum Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/head_32.S | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 90f038af3ad..b2cc73768a9 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S @@ -656,15 +656,16 @@ int_msg: .asciz "Unknown interrupt or fault at EIP %p %p %p\n" fault_msg: - .asciz \ -/* fault info: */ "BUG: Int %d: CR2 %p\n" \ -/* pusha regs: */ " EDI %p ESI %p EBP %p ESP %p\n" \ - " EBX %p EDX %p ECX %p EAX %p\n" \ -/* fault frame: */ " err %p EIP %p CS %p flg %p\n" \ - \ - "Stack: %p %p %p %p %p %p %p %p\n" \ - " %p %p %p %p %p %p %p %p\n" \ - " %p %p %p %p %p %p %p %p\n" +/* fault info: */ + .ascii "BUG: Int %d: CR2 %p\n" +/* pusha regs: */ + .ascii " EDI %p ESI %p EBP %p ESP %p\n" + .ascii " EBX %p EDX %p ECX %p EAX %p\n" +/* fault frame: */ + .ascii " err %p EIP %p CS %p flg %p\n" + .ascii "Stack: %p %p %p %p %p %p %p %p\n" + .ascii " %p %p %p %p %p %p %p %p\n" + .asciz " %p %p %p %p %p %p %p %p\n" #include "../../x86/xen/xen-head.S" -- cgit v1.2.3 From f6c133f7d5ee3b82f5b34b988e897ea38cd8219c Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 25 Apr 2008 11:45:26 +0200 Subject: fix: x86: support for new UV apic Don't warn in read_apic_id() when preemptible but only one CPU online. Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/genapic_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c index 021624c8358..cbaaf69bedb 100644 --- a/arch/x86/kernel/genapic_64.c +++ b/arch/x86/kernel/genapic_64.c @@ -83,7 +83,7 @@ unsigned int read_apic_id(void) { unsigned int id; - WARN_ON(preemptible()); + WARN_ON(preemptible() && num_online_cpus() > 1); id = apic_read(APIC_ID); if (uv_system_type >= UV_X2APIC) id |= __get_cpu_var(x2apic_extra_bits); -- cgit v1.2.3 From a4c863f497e640e049083e1b3a1f3723cb766da9 Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Mon, 28 Apr 2008 11:05:07 -0700 Subject: x86: don't bother printing compat vdso address The kernel prints the compat vdso address regardless of whether compat vdso mode is enabled or not, which is confusing. Given that this isn't very interesting information anyway, just remove the printk. Signed-off-by: Jeremy Fitzhardinge Cc: Gerhard Mack Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/vdso/vdso32-setup.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c index e2af8eee80e..4dceeb1fc5e 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c @@ -303,8 +303,6 @@ int __init sysenter_setup(void) #ifdef CONFIG_X86_32 gate_vma_init(); - - printk("Compat vDSO mapped to %08lx.\n", __fix_to_virt(FIX_VDSO)); #endif if (!vdso32_sysenter()) { -- cgit v1.2.3 From 2544a873ab2a1ee9196bb2f4b12c3afd44ec8a06 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Tue, 29 Apr 2008 12:04:51 +0200 Subject: revert: "x86: ioremap(), extend check to all RAM pages" Vegard Nossum reported a large (150 seconds) boot delay during bootup, and bisected it to "x86: ioremap(), extend check to all RAM pages" (commit bdd3cee2e4b). Revert this commit for now. Bisected-by: Vegard Nossum Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/mm/ioremap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 804de18abcc..0be9f9c59aa 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -148,8 +148,8 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, /* * Don't allow anybody to remap normal RAM that we're using.. */ - for (pfn = phys_addr >> PAGE_SHIFT; - (pfn << PAGE_SHIFT) < last_addr; pfn++) { + for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped && + (pfn << PAGE_SHIFT) < last_addr; pfn++) { int is_ram = page_is_ram(pfn); -- cgit v1.2.3 From 1dcf83fd0c42525dd36cfeb61fe0bfb12113c6b3 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 29 Apr 2008 14:20:23 +0100 Subject: toshiba: use ioremap_cached The switch of ioremap to default to uncached doesn't break this driver but it does needlessly slow it down as BIOS space is cachable and this driver is quite happy scanning cached ROM space. Signed-off-by: Alan Cox Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- drivers/char/toshiba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c index 64f1ceed0b2..663cd15d7c7 100644 --- a/drivers/char/toshiba.c +++ b/drivers/char/toshiba.c @@ -426,7 +426,7 @@ static int tosh_probe(void) int i,major,minor,day,year,month,flag; unsigned char signature[7] = { 0x54,0x4f,0x53,0x48,0x49,0x42,0x41 }; SMMRegisters regs; - void __iomem *bios = ioremap(0xf0000, 0x10000); + void __iomem *bios = ioremap_cache(0xf0000, 0x10000); if (!bios) return -ENOMEM; -- cgit v1.2.3 From b9b39bfba5b0de3418305f01cfa7bc55a16004e1 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Tue, 29 Apr 2008 12:48:15 +0200 Subject: x86: use defconfigs from x86/configs/* Daniel Drake reported: In 2.6.23, if you unpacked a kernel source tarball and then ran "make menuconfig" you'd be presented with this message: # using defaults found in arch/i386/defconfig and the default options would be set. The same thing in 2.6.24 does not give you any "using defaults" message, and the default config options within menuconfig are rather blank (e.g. no PCI support). You can work around this by explicitly running "make defconfig" before menuconfig, but it would be nice to have the behaviour the way it was for 2.6.23 (and the way it still is for other archs). Fixed by adding a x86 specific defconfig list to Kconfig. Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=10470 Tested-by: dsd@gentoo.org Signed-off-by: Sam Ravnborg Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 80303187b87..c3f880902d6 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -25,6 +25,18 @@ config X86 select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) select HAVE_ARCH_KGDB if !X86_VOYAGER +config DEFCONFIG_LIST + string + depends on X86_32 + option defconfig_list + default "arch/x86/configs/i386_defconfig" + +config DEFCONFIG_LIST + string + depends on X86_64 + option defconfig_list + default "arch/x86/configs/x86_64_defconfig" + config GENERIC_LOCKBREAK def_bool n -- cgit v1.2.3 From de33c442ed2a465d2d7804b26dafd2eec067aa34 Mon Sep 17 00:00:00 2001 From: Suresh Siddha Date: Fri, 25 Apr 2008 17:07:22 -0700 Subject: x86 PAT: fix performance drop for glx, use UC minus for ioremap(), ioremap_nocache() and pci_mmap_page_range() Use UC_MINUS for ioremap(), ioremap_nocache() instead of strong UC. Once all the X drivers move to ioremap_wc(), we can go back to strong UC semantics for ioremap() and ioremap_nocache(). To avoid attribute aliasing issues, pci_mmap_page_range() will also use UC_MINUS for default non write-combining mapping request. Next steps: a) change all the video drivers using ioremap() or ioremap_nocache() and adding WC MTTR using mttr_add() to ioremap_wc() b) for strict usage, we can go back to strong uc semantics for ioremap() and ioremap_nocache() after some grace period for completing step-a. c) user level X server needs to use the appropriate method for setting up WC mapping (like using resourceX_wc sysfs file instead of adding MTRR for WC and using /dev/mem or resourceX under /sys) Signed-off-by: Suresh Siddha Signed-off-by: Venkatesh Pallipadi Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/mm/ioremap.c | 20 ++++++++++++++++---- arch/x86/mm/pageattr.c | 10 ++++++++-- arch/x86/pci/i386.c | 12 +++++++++--- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 0be9f9c59aa..6d02a36e5e4 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -176,11 +176,11 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, /* * Do not fallback to certain memory types with certain * requested type: - * - request is uncached, return cannot be write-back - * - request is uncached, return cannot be write-combine + * - request is uc-, return cannot be write-back + * - request is uc-, return cannot be write-combine * - request is write-combine, return cannot be write-back */ - if ((prot_val == _PAGE_CACHE_UC && + if ((prot_val == _PAGE_CACHE_UC_MINUS && (new_prot_val == _PAGE_CACHE_WB || new_prot_val == _PAGE_CACHE_WC)) || (prot_val == _PAGE_CACHE_WC && @@ -201,6 +201,9 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, default: prot = PAGE_KERNEL_NOCACHE; break; + case _PAGE_CACHE_UC_MINUS: + prot = PAGE_KERNEL_UC_MINUS; + break; case _PAGE_CACHE_WC: prot = PAGE_KERNEL_WC; break; @@ -255,7 +258,16 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, */ void __iomem *ioremap_nocache(resource_size_t phys_addr, unsigned long size) { - return __ioremap_caller(phys_addr, size, _PAGE_CACHE_UC, + /* + * Ideally, this should be: + * pat_wc_enabled ? _PAGE_CACHE_UC : _PAGE_CACHE_UC_MINUS; + * + * Till we fix all X drivers to use ioremap_wc(), we will use + * UC MINUS. + */ + unsigned long val = _PAGE_CACHE_UC_MINUS; + + return __ioremap_caller(phys_addr, size, val, __builtin_return_address(0)); } EXPORT_SYMBOL(ioremap_nocache); diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index bd5e05c654d..60bcb5b6a37 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -777,14 +777,20 @@ static inline int change_page_attr_clear(unsigned long addr, int numpages, int _set_memory_uc(unsigned long addr, int numpages) { + /* + * for now UC MINUS. see comments in ioremap_nocache() + */ return change_page_attr_set(addr, numpages, - __pgprot(_PAGE_CACHE_UC)); + __pgprot(_PAGE_CACHE_UC_MINUS)); } int set_memory_uc(unsigned long addr, int numpages) { + /* + * for now UC MINUS. see comments in ioremap_nocache() + */ if (reserve_memtype(addr, addr + numpages * PAGE_SIZE, - _PAGE_CACHE_UC, NULL)) + _PAGE_CACHE_UC_MINUS, NULL)) return -EINVAL; return _set_memory_uc(addr, numpages); diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 94f6c73a53d..8af0f0bae2a 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c @@ -301,6 +301,13 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, prot = pgprot_val(vma->vm_page_prot); if (pat_wc_enabled && write_combine) prot |= _PAGE_CACHE_WC; + else if (pat_wc_enabled) + /* + * ioremap() and ioremap_nocache() defaults to UC MINUS for now. + * To avoid attribute conflicts, request UC MINUS here + * aswell. + */ + prot |= _PAGE_CACHE_UC_MINUS; else if (boot_cpu_data.x86 > 3) prot |= _PAGE_CACHE_UC; @@ -319,9 +326,8 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, * - request is uncached, return cannot be write-combine * - request is write-combine, return cannot be write-back */ - if ((flags == _PAGE_CACHE_UC && - (new_flags == _PAGE_CACHE_WB || - new_flags == _PAGE_CACHE_WC)) || + if ((flags == _PAGE_CACHE_UC_MINUS && + (new_flags == _PAGE_CACHE_WB)) || (flags == _PAGE_CACHE_WC && new_flags == _PAGE_CACHE_WB)) { free_memtype(addr, addr+len); -- cgit v1.2.3 From c9af1e33231912cedae3e49e56621b6c765e57fe Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 30 Apr 2008 08:48:45 +0200 Subject: x86: Kconfig fix Andrew noticed that OPTIMIZE_INLINING appeared in the toplevel menu - fix it. Reported-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig.debug | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 5b1979a45a1..770397ec476 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -256,8 +256,6 @@ config CPA_DEBUG help Do change_page_attr() self-tests every 30 seconds. -endmenu - config OPTIMIZE_INLINING bool "Allow gcc to uninline functions marked 'inline'" default y @@ -270,3 +268,6 @@ config OPTIMIZE_INLINING this algorithm is so good that allowing gcc4 to make the decision can become the default in the future, until then this option is there to test gcc for this. + +endmenu + -- cgit v1.2.3 From acbaa93e3d38db0e67b070d97598f87a7a6779da Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 30 Apr 2008 08:58:27 +0200 Subject: x86: CONFIG_X86_ELAN fix move the X86_CPU section out of the !X86_ELAN branch. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig.cpu | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index 7ef18b01f0b..2ad6301849a 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu @@ -278,11 +278,6 @@ config GENERIC_CPU endchoice -config X86_CPU - def_bool y - select GENERIC_FIND_FIRST_BIT - select GENERIC_FIND_NEXT_BIT - config X86_GENERIC bool "Generic x86 support" depends on X86_32 @@ -297,6 +292,11 @@ config X86_GENERIC endif +config X86_CPU + def_bool y + select GENERIC_FIND_FIRST_BIT + select GENERIC_FIND_NEXT_BIT + # # Define implied options from the CPU selection here config X86_L1_CACHE_BYTES -- cgit v1.2.3 From 5de8f68b43229cce3d457ca9ac6dab8372a35f18 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 30 Apr 2008 10:29:13 +0200 Subject: x86: optimize inlining off default to inline optimizing off. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig.debug | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 770397ec476..84c71c7e62e 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -258,7 +258,6 @@ config CPA_DEBUG config OPTIMIZE_INLINING bool "Allow gcc to uninline functions marked 'inline'" - default y help This option determines if the kernel forces gcc to inline the functions developers have marked 'inline'. Doing so takes away freedom from gcc to -- cgit v1.2.3 From 5f464707c8c18fccd3c6278ad46ac94b5cf15a98 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Wed, 30 Apr 2008 16:17:46 +0100 Subject: x86: fix HT cpu booting on 32-bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since recent smpboot 32/64-bit merge, my dual Xeon with HT has been booting only 2 of its 4 cpus (when running an i386 kernel; but x86_64 is okay). J.A. Magallón reports the same. native_cpu_up: bad cpu 2 native_cpu_up: bad cpu 3 The mach-default cpu_present_to_apicid() was just returning cpu number (2, 3) instead of apicid (6, 7): looks like we now need the x86_64 code even for the i386 case. Comparing with other versions of cpu_present_to_apicid(), it seems a good idea to include an NR_CPUS test too, since cpu_present() doesn't include that; but that wasn't a problem here, and may no problem at all. Prior to that smpboot merge, my Xeon booted the two HT siblings on one physical first, then the two siblings on the other physical after - when i386, but alternated them when x86_64. Since the merge, the x86_64 sequence is unchanged, but the i386 sequence is now like x86_64. I prefer this consistency, and I prefer the new sequence: booting with maxcpus=2 then uses the independent physicals without HT sharing. Signed-off-by: Hugh Dickins Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/mach-default/mach_apic.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/asm-x86/mach-default/mach_apic.h b/include/asm-x86/mach-default/mach_apic.h index 0a6634f62ab..21003b56ae9 100644 --- a/include/asm-x86/mach-default/mach_apic.h +++ b/include/asm-x86/mach-default/mach_apic.h @@ -109,13 +109,8 @@ static inline int cpu_to_logical_apicid(int cpu) static inline int cpu_present_to_apicid(int mps_cpu) { -#ifdef CONFIG_X86_64 - if (cpu_present(mps_cpu)) + if (mps_cpu < NR_CPUS && cpu_present(mps_cpu)) return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); -#else - if (mps_cpu < get_physical_broadcast()) - return mps_cpu; -#endif else return BAD_APICID; } -- cgit v1.2.3 From cb8ab687c32331fb548c613ae74df574bb0908c1 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Wed, 30 Apr 2008 11:30:24 -0400 Subject: x86: ioremap ram check fix bdd3cee2e4b7279457139058615ced6c2b41e7de (x86: ioremap(), extend check to all RAM pages) breaks OLPC's ioremap call. The ioremap that OLPC uses is: romsig = ioremap(0xffffffc0, 16); The commit that breaks it is basically: - for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped && - (pfn << PAGE_SHIFT) < last_addr; pfn++) { + for (pfn = phys_addr >> PAGE_SHIFT; + (pfn << PAGE_SHIFT) < last_addr; pfn++) { + Previously, the 'pfn < max_pfn_mapped' check would've caused us to not enter the loop. Removing that check means we loop infinitely. The reason for that is because pfn is 0xfffff, and last_addr is 0xffffffcf. The remaining check that is used to exit the loop is not sufficient; when pfn< Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/mm/ioremap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 6d02a36e5e4..71bb3159031 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -148,8 +148,9 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, /* * Don't allow anybody to remap normal RAM that we're using.. */ - for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped && - (pfn << PAGE_SHIFT) < last_addr; pfn++) { + for (pfn = phys_addr >> PAGE_SHIFT; + (pfn << PAGE_SHIFT) < (last_addr & PAGE_MASK); + pfn++) { int is_ram = page_is_ram(pfn); -- cgit v1.2.3 From 6b8e1c7ec4af6defa7045ff3c9b266486124d9c5 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 30 Apr 2008 20:45:40 +0200 Subject: x86: 8K stacks by default Switch back to 8K stacks as the safer default. Out-of-memory situations are less problematic than silent and hard to debug stack corruption. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig.debug | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 84c71c7e62e..5fc8d0b3191 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -118,7 +118,6 @@ config DEBUG_NX_TEST config 4KSTACKS bool "Use 4Kb for kernel stacks instead of 8Kb" depends on X86_32 - default y help If you say Y here the kernel will use a 4Kb stacksize for the kernel stack attached to each process/thread. This facilitates -- cgit v1.2.3 From 895d30935ebe05f192e844792668bf8d19deaae7 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 30 Apr 2008 23:05:52 +0200 Subject: x86: numaq fix do not override the existing pci-y rule when adding visws or numaq rules. Signed-off-by: Ingo Molnar --- arch/x86/pci/Makefile_32 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/pci/Makefile_32 b/arch/x86/pci/Makefile_32 index 2a1516efb54..7fa519868d7 100644 --- a/arch/x86/pci/Makefile_32 +++ b/arch/x86/pci/Makefile_32 @@ -9,8 +9,8 @@ pci-y := fixup.o pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.o -pci-$(CONFIG_X86_VISWS) := visws.o fixup.o -pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o +pci-$(CONFIG_X86_VISWS) += visws.o fixup.o +pci-$(CONFIG_X86_NUMAQ) += numa.o irq.o pci-$(CONFIG_NUMA) += mp_bus_to_node.o obj-y += $(pci-y) common.o early.o -- cgit v1.2.3