From 48b83d2425d7781bb625b1c37b5f2a8963b6e23b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 2 May 2008 21:24:30 +0200 Subject: [PATCH 01/13] x86: undo visws/numaq build changes arch/x86/pci/Makefile_32 has a nasty detail. VISWS and NUMAQ build override the generic pci-y rules. This needs a proper cleanup, but that needs more thoughts. Undo commit 895d30935ebe05f192e844792668bf8d19deaae7 x86: numaq fix do not override the existing pci-y rule when adding visws or numaq rules. There is also a stupid init function ordering problem vs. acpi.o Add comments to the Makefile to avoid tripping over this again. Remove the srat stub code in discontig_32.c to allow a proper NUMAQ build. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/mm/discontig_32.c | 26 -------------------------- arch/x86/pci/Makefile_32 | 12 ++++++++++-- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c index 18378850e25a..914ccf983687 100644 --- a/arch/x86/mm/discontig_32.c +++ b/arch/x86/mm/discontig_32.c @@ -476,29 +476,3 @@ int memory_add_physaddr_to_nid(u64 addr) EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); #endif - -#ifndef CONFIG_HAVE_ARCH_PARSE_SRAT -/* - * XXX FIXME: Make SLIT table parsing available to 32-bit NUMA - * - * These stub functions are needed to compile 32-bit NUMA when SRAT is - * not set. There are functions in srat_64.c for parsing this table - * and it may be possible to make them common functions. - */ -void acpi_numa_slit_init (struct acpi_table_slit *slit) -{ - printk(KERN_INFO "ACPI: No support for parsing SLIT table\n"); -} - -void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa) -{ -} - -void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma) -{ -} - -void acpi_numa_arch_fixup(void) -{ -} -#endif /* CONFIG_HAVE_ARCH_PARSE_SRAT */ diff --git a/arch/x86/pci/Makefile_32 b/arch/x86/pci/Makefile_32 index 7fa519868d70..89ec35d00efd 100644 --- a/arch/x86/pci/Makefile_32 +++ b/arch/x86/pci/Makefile_32 @@ -6,11 +6,19 @@ obj-$(CONFIG_PCI_DIRECT) += direct.o obj-$(CONFIG_PCI_OLPC) += olpc.o pci-y := fixup.o + +# Do not change the ordering here. There is a nasty init function +# ordering dependency which breaks when you move acpi.o below +# legacy/irq.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 +# Careful: VISWS and NUMAQ overrule the pci-y above. The colons are +# therefor correct. This needs a proper fix by distangling the code. +pci-$(CONFIG_X86_VISWS) := visws.o fixup.o +pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o + +# Necessary for NUMAQ as well pci-$(CONFIG_NUMA) += mp_bus_to_node.o obj-y += $(pci-y) common.o early.o From 22eecde2f9034764a3fd095eecfa3adfb8ec9a98 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 1 May 2008 12:06:54 +0200 Subject: [PATCH 02/13] uml: fix gcc problem this is what caused gcc 4.3 to throw an internal error when OPTIMIZE_INLINING was enabled ... Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/um/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/um/Makefile b/arch/um/Makefile index dbeab15e7bb7..01b97c19a8ba 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -77,7 +77,10 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)) KBUILD_CFLAGS += $(KERNEL_DEFINES) -KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,) +# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use +# a lot more stack due to the lack of sharing of stacklots: +KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \ + echo $(call cc-option,-fno-unit-at-a-time); fi ;) PHONY += linux From 4c6214c75a5aca5417156a47cd890b128c5f0637 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Thu, 1 May 2008 11:31:07 +0200 Subject: [PATCH 03/13] kbuild, suspend, x86: fix rebuild of wakeup.bin In kernel/acpi/realmode/Makefile use the 'always' variable to say that wakeup.bin should always be made. In acpi/Makefile we then do not need to specify the requested target and we avoid the message from make: `arch/x86/kernel/acpi/realmode/wakeup.bin' is up to date. Add wakeup.lds to list af targets to avoid rebuilding wakeup.bin - from Roland McGrath. Signed-off-by: Sam Ravnborg Cc: Rafael J. Wysocki Cc: Pavel Machek Cc: H. Peter Anvin Cc: Roland McGrath Signed-off-by: Ingo Molnar --- arch/x86/kernel/acpi/Makefile | 2 +- arch/x86/kernel/acpi/realmode/Makefile | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile index 7335959b6aff..fd5ca97a2ad5 100644 --- a/arch/x86/kernel/acpi/Makefile +++ b/arch/x86/kernel/acpi/Makefile @@ -10,5 +10,5 @@ endif $(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin $(obj)/realmode/wakeup.bin: FORCE - $(Q)$(MAKE) $(build)=$(obj)/realmode $@ + $(Q)$(MAKE) $(build)=$(obj)/realmode diff --git a/arch/x86/kernel/acpi/realmode/Makefile b/arch/x86/kernel/acpi/realmode/Makefile index 092900854acc..1c31cc0e9def 100644 --- a/arch/x86/kernel/acpi/realmode/Makefile +++ b/arch/x86/kernel/acpi/realmode/Makefile @@ -6,7 +6,8 @@ # for more details. # -targets := wakeup.bin wakeup.elf +always := wakeup.bin +targets := wakeup.elf wakeup.lds wakeup-y += wakeup.o wakemain.o video-mode.o copy.o @@ -48,7 +49,7 @@ LDFLAGS_wakeup.elf := -T CPPFLAGS_wakeup.lds += -P -C -$(obj)/wakeup.elf: $(src)/wakeup.lds $(WAKEUP_OBJS) FORCE +$(obj)/wakeup.elf: $(obj)/wakeup.lds $(WAKEUP_OBJS) FORCE $(call if_changed,ld) OBJCOPYFLAGS_wakeup.bin := -O binary From dbe55f4797712f86691a0ee0b5f508693c7310fe Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Tue, 22 Apr 2008 01:50:26 +0300 Subject: [PATCH 04/13] x86: make start_secondary() static start_secondary() needlessly became global. Signed-off-by: Adrian Bunk Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/smpboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 84241a256dc8..b78e4d47a42b 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -299,7 +299,7 @@ static void __cpuinit smp_callin(void) /* * Activate a secondary processor. */ -void __cpuinit start_secondary(void *unused) +static void __cpuinit start_secondary(void *unused) { /* * Don't put *anything* before cpu_init(), SMP booting is too From c5562faeaacf19e81a78ee37cc6b96ab1f3e68e4 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Tue, 22 Apr 2008 00:31:37 +0300 Subject: [PATCH 05/13] x86: make additional_cpus static This patch makes the needlessly global additional_cpus static. Signed-off-by: Adrian Bunk Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/smpboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index b78e4d47a42b..6b087ab6cd8f 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1306,7 +1306,7 @@ static void remove_siblinginfo(int cpu) cpu_clear(cpu, cpu_sibling_setup_map); } -int additional_cpus __initdata = -1; +static int additional_cpus __initdata = -1; static __init int setup_additional_cpus(char *s) { From e37ee42caadab46cec277546099fa2a6207fff0b Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sat, 3 May 2008 22:01:31 +0200 Subject: [PATCH 06/13] x86: es7000 build fix Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/mpparse.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 3e2c54dc8b29..404683b94e79 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -794,6 +794,11 @@ void __init find_smp_config(void) ACPI-based MP Configuration -------------------------------------------------------------------------- */ +/* + * Keep this outside and initialized to 0, for !CONFIG_ACPI builds: + */ +int es7000_plat; + #ifdef CONFIG_ACPI #ifdef CONFIG_X86_IO_APIC @@ -909,8 +914,6 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) MP_intsrc_info(&intsrc); } -int es7000_plat; - void __init mp_config_acpi_legacy_irqs(void) { struct mpc_config_intsrc intsrc; From 163ea310b68bdde89b1ac633fbf8c0db290d3f86 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 3 May 2008 22:39:42 +0200 Subject: [PATCH 07/13] x86: remove dell reboot dmi quirk board name match http://bugzilla.kernel.org/show_bug.cgi?id=10547 Newer Dell OptiPlex 745s hang before rebooting after 'sudo reboot'. A patch for some versions of the OptiPlex was proposed here -- http://lkml.org/lkml/2007/6/5/59 -- and is included in 2.6.23 and later kernels, according to http://lxr.linux.no/linux+v2.6.23/arch/i386/kernel/reboot.c . However, the DMI_BOARD_NAME ("0WF810") is too restrictive. Newer OptiPlex machines have a DMI_BOARD_NAME of "0RF703". I therefore suggest adding another clause to reboot.c, similar to the one in the original patch, but matching a DMI_BOARD_NAME of "0RF703". On further inspection, it seems that there are other DMI_BOARD_NAMEs for this same machine. They seem to change from time to time, which means that the current code is fragile. Moreover, using bios reboot should not break non-SFF OptiPlex 745s, and so a reasonable fix is to simply drop the match on DMI_BOARD_NAME. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/kernel/reboot.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 07c6d42ab5ff..f6be7d5f82f8 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -149,7 +149,6 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"), - DMI_MATCH(DMI_BOARD_NAME, "0WF810"), }, }, { /* Handle problems with rebooting on Dell Optiplex 745's DFF*/ From ecb783eae1372d69a53d406e1bdba8284e4bafcc Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 3 May 2008 14:18:01 +0400 Subject: [PATCH 08/13] x86: vdso ELF handling - use SELFMAG instead of numeric constant Signed-off-by: Cyrill Gorcunov Cc: akpm@linux-foundation.org Cc: hpa@zytor.com Cc: mingo@elte.hu Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/vdso/vdso32-setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c index 4dceeb1fc5e0..cf058fecfcee 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c @@ -162,7 +162,7 @@ static __init void relocate_vdso(Elf32_Ehdr *ehdr) Elf32_Shdr *shdr; int i; - BUG_ON(memcmp(ehdr->e_ident, ELFMAG, 4) != 0 || + BUG_ON(memcmp(ehdr->e_ident, ELFMAG, SELFMAG) != 0 || !elf_check_arch_ia32(ehdr) || ehdr->e_type != ET_DYN); From 8bd1796dedd50abd7553afbe6113bd97cc88390f Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 3 May 2008 14:18:03 +0400 Subject: [PATCH 09/13] x86: relocs ELF handling - use SELFMAG instead of numeric constant Signed-off-by: Cyrill Gorcunov Cc: akpm@linux-foundation.org Cc: hpa@zytor.com Cc: mingo@elte.hu Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/boot/compressed/relocs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c index d01ea42187e6..edaadea90aaf 100644 --- a/arch/x86/boot/compressed/relocs.c +++ b/arch/x86/boot/compressed/relocs.c @@ -191,7 +191,7 @@ static void read_ehdr(FILE *fp) die("Cannot read ELF header: %s\n", strerror(errno)); } - if (memcmp(ehdr.e_ident, ELFMAG, 4) != 0) { + if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) { die("No ELF magic\n"); } if (ehdr.e_ident[EI_CLASS] != ELFCLASS32) { From afaafe50ee15c59010f19273ebfb6c44f0962d7c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 2 May 2008 21:14:20 +1000 Subject: [PATCH 10/13] x86: fix up bootparam.h for userspace inclusion commit 8b664aa66e824a0ddf4ec56d41fa0cf7bb374de6 (x86, boot: add linked list of struct setup_data) put a new struct in bootparam.h, but didn't use the userspace-safe types. Signed-off-by: Rusty Russell Cc: Huang Ying Acked-by: H. Peter Anvin Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/asm-x86/bootparam.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/asm-x86/bootparam.h b/include/asm-x86/bootparam.h index e8659909e5f6..f62f4733606b 100644 --- a/include/asm-x86/bootparam.h +++ b/include/asm-x86/bootparam.h @@ -14,10 +14,10 @@ /* extensible setup data list node */ struct setup_data { - u64 next; - u32 type; - u32 len; - u8 data[0]; + __u64 next; + __u32 type; + __u32 len; + __u8 data[0]; }; struct setup_header { From 7b04fa014c11e6415da8b5a7999dbd201abad53c Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 2 May 2008 13:32:32 -0700 Subject: [PATCH 11/13] x86: video/fbdev.c: add MODULE_LICENSE Add the missing MODULE_LICENSE("GPL"). Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/video/fbdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/fbdev.c index 4db42bff8c60..69527688f794 100644 --- a/arch/x86/video/fbdev.c +++ b/arch/x86/video/fbdev.c @@ -1,5 +1,4 @@ /* - * * Copyright (C) 2007 Antonino Daplas * * This file is subject to the terms and conditions of the GNU General Public @@ -29,3 +28,4 @@ int fb_is_primary_device(struct fb_info *info) return retval; } EXPORT_SYMBOL(fb_is_primary_device); +MODULE_LICENSE("GPL"); From e26a28d190304d910ee49b81cbfe6d9241f56e86 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 3 May 2008 23:49:59 +0200 Subject: [PATCH 12/13] x86: olpc build fix CONFIG_OLPC needs to depend on MGEODE_LX Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c3f880902d66..845ea2b2d487 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1661,6 +1661,7 @@ config GEODE_MFGPT_TIMER config OLPC bool "One Laptop Per Child support" + depends on MGEODE_LX default n help Add support for detecting the unique features of the OLPC From 62179849b40aded9e727cca5006627a1c4d6446e Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Fri, 2 May 2008 13:32:35 -0700 Subject: [PATCH 13/13] x86: fix setup printk format warning Fix x86 setup printk format warming: next-20080430/arch/x86/kernel/setup.c:172: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'ssize_t' Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Cc: mingo@elte.hu Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c0c68c18a788..cc6f5eb20b24 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -95,7 +95,7 @@ void __init setup_per_cpu_areas(void) /* Copy section for each CPU (we discard the original) */ size = PERCPU_ENOUGH_ROOM; - printk(KERN_INFO "PERCPU: Allocating %lu bytes of per cpu data\n", + printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n", size); for_each_possible_cpu(i) {