From e686d34156ef0e56b2ebec505b809018bc0dc73b Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 26 Apr 2008 21:00:17 -0700 Subject: [PATCH 1/6] x86: !x & y typo in mtrr code As written, this can never be true. Spotted by the Sparse checker. Signed-off-by: Harvey Harrison Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/mtrr/generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index 353efe4f5017..5d241ce94a44 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c @@ -90,7 +90,7 @@ u8 mtrr_type_lookup(u64 start, u64 end) * Look of multiple ranges matching this address and pick type * as per MTRR precedence */ - if (!mtrr_state.enabled & 2) { + if (!(mtrr_state.enabled & 2)) { return mtrr_state.def_type; } From 8008abbd87644c84f93a7a86fec88f1e14031901 Mon Sep 17 00:00:00 2001 From: Alexander van Heukelum Date: Wed, 16 Apr 2008 18:45:35 +0200 Subject: [PATCH 2/6] x86: fix warning in "x86: clean up vSMP detection" The function detect_vsmp_box is a void function in the PCI case. Change the !PCI stub to void too. Signed-off-by: Alexander van Heukelum Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/vsmp_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index caf2a26f5cfd..ba8c0b75ab0a 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c @@ -133,7 +133,7 @@ int is_vsmp_box(void) } } #else -static int __init detect_vsmp_box(void) +static void __init detect_vsmp_box(void) { } int is_vsmp_box(void) From 781fe2ebc0f44b32418d203ac023a541afdd042f Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sat, 26 Apr 2008 23:14:36 +0200 Subject: [PATCH 3/6] bootprotocol: cleanup Signed-off-by: Ingo Molnar --- arch/x86/kernel/e820_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index 645ee5e32a27..124480c0008d 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c @@ -100,7 +100,7 @@ void __init free_early(unsigned long start, unsigned long end) for (j = i + 1; j < MAX_EARLY_RES && early_res[j].end; j++) ; - memcpy(&early_res[i], &early_res[i + 1], + memmove(&early_res[i], &early_res[i + 1], (j - 1 - i) * sizeof(struct early_res)); early_res[j - 1].end = 0; From 4c0587e6e42c5b679234d3dffda8a888dc0ff9c1 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Sun, 27 Apr 2008 12:21:11 +0100 Subject: [PATCH 4/6] x86: add more boot protocol documentation Signed-off-by: Ian Campbell Cc: Rusty Russell Cc: Jeremy Fitzhardinge Acked-by: H. Peter Anvin Signed-off-by: Ingo Molnar --- Documentation/i386/boot.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 0fac3465f2e3..95ad15c3b01f 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt @@ -40,9 +40,17 @@ Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable. Introduce relocatable_kernel and kernel_alignment fields. Protocol 2.06: (Kernel 2.6.22) Added a field that contains the size of - the boot command line + the boot command line. -Protocol 2.09: (kernel 2.6.26) Added a field of 64-bit physical +Protocol 2.07: (Kernel 2.6.24) Added paravirtualised boot protocol. + Introduced hardware_subarch and hardware_subarch_data + and KEEP_SEGMENTS flag in load_flags. + +Protocol 2.08: (Kernel 2.6.26) Added crc32 checksum and ELF format + payload. Introduced payload_offset and payload length + fields to aid in locating the payload. + +Protocol 2.09: (Kernel 2.6.26) Added a field of 64-bit physical pointer to single linked list of struct setup_data. **** MEMORY LAYOUT From 9752082560b440e6a45624569d26802e20d1b8b4 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Sun, 27 Apr 2008 00:39:36 +0100 Subject: [PATCH 5/6] x86: vget_cycles() __always_inline Mark vget_cycles() as __always_inline, so gcc is never tempted to make the vsyscall vread_tsc() dive into kernel text, with resulting SIGSEGV. This was a self-inflicted wound: I've not seen that happen with unhacked sources; but for debug reasons I'd changed my x86/Makefile to compile no-unit-at-a-time, and that in conjunction with OPTIMIZE_INLINING=y ended up with vget_cycles() in kernel text. Perhaps it can happen in other ways: safer to use __always_inline. Signed-off-by: Hugh Dickins Signed-off-by: Ingo Molnar --- include/asm-x86/tsc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-x86/tsc.h b/include/asm-x86/tsc.h index d2d8eb5b55f5..548873ab5fc1 100644 --- a/include/asm-x86/tsc.h +++ b/include/asm-x86/tsc.h @@ -32,7 +32,7 @@ static inline cycles_t get_cycles(void) return ret; } -static inline cycles_t vget_cycles(void) +static __always_inline cycles_t vget_cycles(void) { /* * We only do VDSOs on TSC capable CPUs, so this shouldnt From e90955c26d8af318658c45caadb1d330ac6a506c Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Mon, 21 Apr 2008 14:14:44 -0700 Subject: [PATCH 6/6] x86: fix PCI MSI breaks when booting with nosmp set up sane APIC state even in the nosmp case. Signed-off-by: Ingo Molnar --- arch/x86/kernel/smpboot.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 04c662ba18f1..84241a256dc8 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1149,14 +1149,10 @@ static int __init smp_sanity_check(unsigned max_cpus) "forcing use of dummy APIC emulation.\n"); smpboot_clear_io_apic(); #ifdef CONFIG_X86_32 - if (nmi_watchdog == NMI_LOCAL_APIC) { - printk(KERN_INFO "activating minimal APIC for" - "NMI watchdog use.\n"); - connect_bsp_APIC(); - setup_local_APIC(); - end_local_APIC_setup(); - } + connect_bsp_APIC(); #endif + setup_local_APIC(); + end_local_APIC_setup(); return -1; }