From ceff8d859c77981147c320da4074dcf8a06501a4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 26 Oct 2007 17:22:17 +0200 Subject: Revert "i386: export i386 smp_call_function_mask() to modules" This reverts commit 6442eea937ef797d4b66733f49c82e2fdc2aca6f. The patch breaks smp_ops and needs to be reverted. The solution to allow modular build of KVM is to export smp_ops instead. Pointed-out-by: James Bottomley tglx, so write out 100 times "voyager is a useful architecture" ... yes, Sir Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/kernel/smp_32.c | 7 ------- include/asm-x86/smp_32.h | 9 ++++++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/smp_32.c b/arch/x86/kernel/smp_32.c index f3211530839..22a6fa0cfb2 100644 --- a/arch/x86/kernel/smp_32.c +++ b/arch/x86/kernel/smp_32.c @@ -708,10 +708,3 @@ struct smp_ops smp_ops = { .smp_send_reschedule = native_smp_send_reschedule, .smp_call_function_mask = native_smp_call_function_mask, }; - -int smp_call_function_mask(cpumask_t mask, void (*func) (void *info), - void *info, int wait) -{ - return smp_ops.smp_call_function_mask(mask, func, info, wait); -} -EXPORT_SYMBOL(smp_call_function_mask); diff --git a/include/asm-x86/smp_32.h b/include/asm-x86/smp_32.h index 7056d868452..e10b7affdfe 100644 --- a/include/asm-x86/smp_32.h +++ b/include/asm-x86/smp_32.h @@ -94,9 +94,12 @@ static inline void smp_send_reschedule(int cpu) { smp_ops.smp_send_reschedule(cpu); } -extern int smp_call_function_mask(cpumask_t mask, - void (*func) (void *info), void *info, - int wait); +static inline int smp_call_function_mask(cpumask_t mask, + void (*func) (void *info), void *info, + int wait) +{ + return smp_ops.smp_call_function_mask(mask, func, info, wait); +} void native_smp_prepare_boot_cpu(void); void native_smp_prepare_cpus(unsigned int max_cpus); -- cgit v1.2.3 From 027447c4913c8fd6f91092b92dfa07eec91f009d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 27 Oct 2007 20:57:43 +0200 Subject: x86: export smp_ops to allow modular build of KVM KVM uses smp_call_function_mask and therefor need smp_ops to be exported. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/kernel/smp_32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/smp_32.c b/arch/x86/kernel/smp_32.c index 22a6fa0cfb2..fcaa026eb80 100644 --- a/arch/x86/kernel/smp_32.c +++ b/arch/x86/kernel/smp_32.c @@ -708,3 +708,4 @@ struct smp_ops smp_ops = { .smp_send_reschedule = native_smp_send_reschedule, .smp_call_function_mask = native_smp_call_function_mask, }; +EXPORT_SYMBOL_GPL(smp_ops); -- cgit v1.2.3 From 0cca1ca647d87c2c0b0d76d2f32683ce34d54989 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Fri, 26 Oct 2007 12:17:19 -0500 Subject: x86: voyager: fix bogus conversion to per_cpu for boot_cpu_info There were two problems. Firstly, someone forgot the struct keyword in front of cpuinfo_x86, so I take it this wasn't even compile checked. Secondly, the actual definition has this as a SHARED_ALIGNED, so the definitions mismatch. Signed-off-by: James Bottomley Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/mach-voyager/voyager_smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 361ac5107b3..69371434b0c 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c @@ -29,14 +29,14 @@ #include /* TLB state -- visible externally, indexed physically */ -DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) ____cacheline_aligned = { &init_mm, 0 }; +DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = { &init_mm, 0 }; /* CPU IRQ affinity -- set to all ones initially */ static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR_CPUS-1] = ~0UL }; /* per CPU data structure (for /proc/cpuinfo et al), visible externally * indexed physically */ -DEFINE_PER_CPU(cpuinfo_x86, cpu_info) __cacheline_aligned; +DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); EXPORT_PER_CPU_SYMBOL(cpu_info); /* physical ID of the CPU used to boot the system */ -- cgit v1.2.3 From bd53147db8bdf5dd49025c198ff18ac23f560e0e Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Fri, 26 Oct 2007 11:29:04 -0600 Subject: x86: Fix boot protocol KEEP_SEGMENTS check. The kernel only ever supports 1 version of the boot protocol so there is no need to check the boot protocol revision to see if a feature is supported. Both x86 and x86_64 support the same boot protocol so we need to implement the KEEP_SEGMENTS on x86_64 as well. It isn't just paravirt bootloaders that could use this functionality. Signed-off-by: Eric W. Biederman Cc: Jeremy Fitzhardinge Cc: Rusty Russell Cc: Vivek Goyal Cc: James Bottomley Cc: Zachary Amsden Cc: Andi Kleen Acked-by: H. Peter Anvin Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/boot/compressed/head_32.S | 12 ++++-------- arch/x86/boot/compressed/head_64.S | 7 +++++++ arch/x86/kernel/asm-offsets_64.c | 10 ++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index a0ae2e7f6ce..036e635f18a 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S @@ -33,24 +33,20 @@ .globl startup_32 startup_32: - /* check to see if KEEP_SEGMENTS flag is meaningful */ - cmpw $0x207, BP_version(%esi) - jb 1f - + cld /* test KEEP_SEGMENTS flag to see if the bootloader is asking * us to not reload segments */ testb $(1<<6), BP_loadflags(%esi) - jnz 2f + jnz 1f -1: cli + cli movl $(__BOOT_DS),%eax movl %eax,%ds movl %eax,%es movl %eax,%fs movl %eax,%gs movl %eax,%ss - -2: cld +1: /* Calculate the delta between where we were compiled to run * at and where we were actually loaded at. This can only be done diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 49467640751..1ccb38a7f0d 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -29,6 +29,7 @@ #include #include #include +#include .section ".text.head" .code32 @@ -36,11 +37,17 @@ startup_32: cld + /* test KEEP_SEGMENTS flag to see if the bootloader is asking + * us to not reload segments */ + testb $(1<<6), BP_loadflags(%esi) + jnz 1f + cli movl $(__KERNEL_DS), %eax movl %eax, %ds movl %eax, %es movl %eax, %ss +1: /* Calculate the delta between where we were compiled to run * at and where we were actually loaded at. This can only be done diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index 7e50bda565b..d1b6ed98774 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c @@ -15,12 +15,16 @@ #include #include #include +#include #define DEFINE(sym, val) \ asm volatile("\n->" #sym " %0 " #val : : "i" (val)) #define BLANK() asm volatile("\n->" : : ) +#define OFFSET(sym, str, mem) \ + DEFINE(sym, offsetof(struct str, mem)) + #define __NO_STUBS 1 #undef __SYSCALL #undef _ASM_X86_64_UNISTD_H_ @@ -109,5 +113,11 @@ int main(void) DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx)); BLANK(); DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); + + BLANK(); + OFFSET(BP_scratch, boot_params, scratch); + OFFSET(BP_loadflags, boot_params, hdr.loadflags); + OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); + OFFSET(BP_version, boot_params, hdr.version); return 0; } -- cgit v1.2.3 From 74a3d2d331246a12428b027e21d508679187fcf0 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 27 Oct 2007 20:57:43 +0200 Subject: x86: fix !SMP compiler warning in arch/x86/kernel/acpi/processor.c Fix !CONFIG_SMP warning: arch/x86/kernel/acpi/processor.c: In function arch_acpi_processor_init_pdc: arch/x86/kernel/acpi/processor.c:65: warning: unused variable cpu Signed-off-by: Jeff Garzik Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/acpi/processor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c index 2ed0a4ce62f..f63e5ff0aca 100644 --- a/arch/x86/kernel/acpi/processor.c +++ b/arch/x86/kernel/acpi/processor.c @@ -62,8 +62,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c) /* Initialize _PDC data based on the CPU vendor */ void arch_acpi_processor_init_pdc(struct acpi_processor *pr) { - unsigned int cpu = pr->id; - struct cpuinfo_x86 *c = &cpu_data(cpu); + struct cpuinfo_x86 *c = &cpu_data(pr->id); pr->pdc = NULL; if (c->x86_vendor == X86_VENDOR_INTEL) -- cgit v1.2.3 From 03d0d20e640a6189ec85fa917259d94013b4d730 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 27 Oct 2007 20:57:43 +0200 Subject: x86: fix compiler warnings in arch/x86/kernel/early-quirks.c fix this warning: arch/x86/kernel/early-quirks.c:40: warning: nvidia_hpet_check defined but not used Signed-off-by: Jeff Garzik Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/early-quirks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index dc34acbd54a..639e6320518 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -35,12 +35,14 @@ static void __init via_bugs(void) } #ifdef CONFIG_ACPI +#ifdef CONFIG_X86_IO_APIC static int __init nvidia_hpet_check(struct acpi_table_header *header) { return 0; } -#endif +#endif /* CONFIG_X86_IO_APIC */ +#endif /* CONFIG_ACPI */ static void __init nvidia_bugs(void) { -- cgit v1.2.3 From 69243f91257083795065762ce805120b980e256b Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Fri, 26 Oct 2007 14:19:26 +0900 Subject: x86: Dump filtering supports x86_64 sparsemem This patch adds the symbol "init_level4_pgt" to the vmcoreinfo data so that makedumpfile (dump filtering command) supports x86_64 sparsemem kernel of linux-2.6.24. makedumpfile creates a small dumpfile by excluding unnecessary pages for the analysis. It checks attributes in page structures and distinguishes necessary pages and unnecessary ones. To check them, makedumpfile gets the vmcoreinfo data which has the minimum debugging information only for dump filtering. For older x86_64 kernel (linux-2.6.23 or before), makedumpfile translates the virtual address of page structure into physical address by subtracting PAGE_OFFSET from virtual address, but this translation isn't effective for linux-2.6.24 sparsemem kernel, because its page structures are in virtual memmap area. makedumpfile should translate their virtual address by 4-levels paging and it needs the symbol "init_level4_pgt". Signed-off-by: Ken'ichi Ohmichi Signed-off-by: Thomas Gleixner --- arch/x86/kernel/machine_kexec_64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 0d8577f0542..aa3d2c8f773 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -233,6 +233,8 @@ NORET_TYPE void machine_kexec(struct kimage *image) void arch_crash_save_vmcoreinfo(void) { + VMCOREINFO_SYMBOL(init_level4_pgt); + #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE VMCOREINFO_SYMBOL(node_data); VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); -- cgit v1.2.3