x86/cleanups for v2.6.31
Linus,
Please pull the latest x86-cleanups-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-cleanups-for-linus
Thanks,
Ingo
------------------>
Cyrill Gorcunov (1):
x86, nmi: Use predefined numbers instead of hardcoded one
Huang Weiyi (1):
x86: mce: remove duplicated #include
Ingo Molnar (2):
x86 early quirks: eliminate unused function
x86: clean up arch/x86/kernel/tsc_sync.c a bit
Jaswinder Singh Rajput (12):
x86: apic/x2apic_cluster.c x86_cpu_to_logical_apicid should be static
x86: clean up declarations and variables
x86: vdso/vma.c declare vdso_enabled and arch_setup_additional_pages before they get used
x86: avoid multiple declaration of kstack_depth_to_print
x86: msr-index.h remove duplicate MSR C001_0015 declaration
x86, mtrr: replace MTRRcap_MSR with msr-index's MSR_MTRRcap
x86, mtrr: replace MTRRfix64K_00000_MSR with msr-index's MSR_MTRRfix64K_00000 x86, mtrr: replace MTRRfix16K_80000_MSR with msr-index's MSR_MTRRfix16K_80000 x86, mtrr: remove mtrr MSRs double declaration
x86, mtrr: replace MTRRfix4K_C0000_MSR with msr-index's MSR_MTRRfix4K_C0000 x86, mtrr: replace MTRRdefType_MSR with msr-index's MSR_MTRRdefType
x86: asm/processor.h: remove double declaration
Remis Lima Baima (1):
x86: added 'ifndef _ASM_X86_IOMAP_H' to iomap.h
Samuel Bronson (1):
x86: use symbolic name for VM86_SIGNAL when used as vm86 default return
arch/x86/include/asm/apic.h | 3 ++ arch/x86/include/asm/hw_irq.h | 4 ++ arch/x86/include/asm/iomap.h | 5 +++ arch/x86/include/asm/msr-index.h | 1 - arch/x86/include/asm/nmi.h | 2 +- arch/x86/include/asm/pgtable.h | 2 + arch/x86/include/asm/pgtable_64.h | 6 ---- arch/x86/include/asm/processor.h | 3 -- arch/x86/include/asm/syscalls.h | 45 +++++++++++++++------------- arch/x86/include/asm/traps.h | 1 - arch/x86/kernel/apic/io_apic.c | 1 + arch/x86/kernel/apic/nmi.c | 2 +- arch/x86/kernel/apic/probe_32.c | 1 - arch/x86/kernel/apic/x2apic_cluster.c | 2 +- arch/x86/kernel/cpu/mcheck/mce_intel_64.c | 1 - arch/x86/kernel/cpu/mtrr/cleanup.c | 4 +- arch/x86/kernel/cpu/mtrr/generic.c | 24 ++++++++-------- arch/x86/kernel/cpu/mtrr/main.c | 2 +- arch/x86/kernel/cpu/mtrr/mtrr.h | 15 --------- arch/x86/kernel/cpu/mtrr/state.c | 6 ++-- arch/x86/kernel/dumpstack.h | 1 - arch/x86/kernel/early-quirks.c | 2 + arch/x86/kernel/irq.c | 1 + arch/x86/kernel/process.c | 1 + arch/x86/kernel/tsc.c | 8 ++-- arch/x86/kernel/tsc_sync.c | 14 ++++----- arch/x86/kernel/vm86_32.c | 4 +- arch/x86/mm/init.c | 1 + arch/x86/vdso/vma.c | 1 + 29 files changed, 78 insertions(+), 85 deletions(-)
arch/x86/include/asm/apic.h +3 -0
@@ -478,6 +478,9 @@ static inline unsigned int read_apic_id(void)extern void default_setup_apic_routing (void );#ifdef CONFIG_X86_32 + +extern struct apic apic_default; +/* * Set up the logical destination ID. *
arch/x86/include/asm/hw_irq.h +4 -0
@@ -78,7 +78,11 @@ extern void eisa_set_level_irq(unsigned int irq);/* SMP */ extern void smp_apic_timer_interrupt (struct pt_regs *);extern void smp_spurious_interrupt (struct pt_regs *); +extern void smp_generic_interrupt (struct pt_regs *);extern void smp_error_interrupt (struct pt_regs *); +#ifdef CONFIG_X86_IO_APIC +extern asmlinkage void smp_irq_move_cleanup_interrupt(void); +#endif #ifdef CONFIG_SMP extern void smp_reschedule_interrupt (struct pt_regs *);extern void smp_call_function_interrupt (struct pt_regs *);
arch/x86/include/asm/iomap.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef _ASM_X86_IOMAP_H +#define _ASM_X86_IOMAP_H +/* * Copyright © 2008 Ingo Molnar *
@@ -31,3 +34,5 @@ iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);void iounmap_atomic (void *kvaddr,enum km_type type); + +#endif /* _ASM_X86_IOMAP_H */
arch/x86/include/asm/msr-index.h +0 -1
@@ -121,7 +121,6 @@#define MSR_K8_TOP_MEM1 0xc001001a#define MSR_K8_TOP_MEM2 0xc001001d#define MSR_K8_SYSCFG 0xc0010010 -#define MSR_K8_HWCR 0xc0010015#define MSR_K8_INT_PENDING_MSG 0xc0010055/* C1E active bits in int pending message */ #define K8_INTP_C1E_ACTIVE_MASK 0x18000000
arch/x86/include/asm/nmi.h +1 -1
@@ -64,7 +64,7 @@ static inline int nmi_watchdog_active(void)* but since they are power of two we could use a * cheaper way --cvg */ - return nmi_watchdog & 0x3; + return nmi_watchdog & (NMI_LOCAL_APIC | NMI_IO_APIC); }#endif
arch/x86/include/asm/pgtable.h +2 -0
@@ -503,6 +503,8 @@ static inline int pgd_none(pgd_t pgd)#ifndef __ASSEMBLY__ +extern int direct_gbpages; +/* local pte updates need not use xchg for locking */ static inline pte_t native_local_ptep_get_and_clear (pte_t *ptep) {
arch/x86/include/asm/pgtable_64.h +0 -6
@@ -25,10 +25,6 @@ extern pgd_t init_level4_pgt[];extern void paging_init (void ); -#endif /* !__ASSEMBLY__ */ - -#ifndef __ASSEMBLY__ -#define pte_ERROR (e) \ printk("%s:%d: bad pte %p(%016lx).\n", \ __FILE__, __LINE__, &(e), pte_val(e))
@@ -135,8 +131,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }#define update_mmu_cache (vma, address, pte) do { } while (0) -extern int direct_gbpages; -/* Encode and de-code a swap entry */ #if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE#define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1)
arch/x86/include/asm/processor.h +0 -3
@@ -403,9 +403,6 @@ DECLARE_PER_CPU(unsigned long, stack_canary);extern unsigned int xstate_size;extern void free_thread_xstate (struct task_struct *);extern struct kmem_cache *task_xstate_cachep; -extern void init_scattered_cpuid_features (struct cpuinfo_x86 *c); -extern unsigned int init_intel_cacheinfo (struct cpuinfo_x86 *c); -extern unsigned short num_cache_leaves;struct thread_struct {/* Cached TLS descriptors: */
arch/x86/include/asm/syscalls.h +24 -21
110 lines not on this page · raw message
arch/x86/include/asm/traps.h +0 -1
@@ -74,7 +74,6 @@ static inline int get_si_code(unsigned long condition) }extern int panic_on_unrecovered_nmi; -extern int kstack_depth_to_print;void math_error (void __user *);void math_emulate (struct math_emu_info *);
arch/x86/kernel/apic/io_apic.c +1 -0
@@ -59,6 +59,7 @@#include <asm/setup.h> #include <asm/irq_remapping.h> #include <asm/hpet.h> +#include <asm/hw_irq.h> #include <asm/uv/uv_hub.h> #include <asm/uv/uv_irq.h>
arch/x86/kernel/apic/nmi.c +1 -1
@@ -104,7 +104,7 @@ static __init void nmi_cpu_busy(void *data) }#endif -static void report_broken_nmi (int cpu,int *prev_nmi_count) +static void report_broken_nmi (int cpu,unsigned int *prev_nmi_count) {printk (KERN_CONT "\n" );
arch/x86/kernel/apic/probe_32.c +0 -1
@@ -160,7 +160,6 @@ extern struct apic apic_summit;extern struct apic apic_bigsmp;extern struct apic apic_es7000;extern struct apic apic_es7000_cluster; -extern struct apic apic_default;struct apic *apic = &apic_default;EXPORT_SYMBOL_GPL (apic);
arch/x86/kernel/apic/x2apic_cluster.c +1 -1
@@ -10,7 +10,7 @@#include <asm/apic.h> #include <asm/ipi.h> -DEFINE_PER_CPU (u32, x86_cpu_to_logical_apicid); +static DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid);static int x2apic_acpi_madt_oem_check (char *oem_id,char *oem_table_id) {
arch/x86/kernel/cpu/mcheck/mce_intel_64.c +0 -1
@@ -15,7 +15,6 @@#include <asm/hw_irq.h> #include <asm/idle.h> #include <asm/therm_throt.h> -#include <asm/apic.h> asmlinkage void smp_thermal_interrupt(void) {
arch/x86/kernel/cpu/mtrr/cleanup.c +2 -2
@@ -808,7 +808,7 @@ int __init mtrr_cleanup(unsigned address_bits)if (!is_cpu (INTEL ) || enable_mtrr_cleanup <1 )return 0 ; -rdmsr (MTRRdefType_MSR, def, dummy); +rdmsr (MSR_MTRRdefType, def, dummy); def &=0xff ;if (def !=MTRR_TYPE_UNCACHABLE )return 0 ;
@@ -1003,7 +1003,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)*/ if (!is_cpu (INTEL ) || disable_mtrr_trim)return 0 ; -rdmsr (MTRRdefType_MSR, def, dummy); +rdmsr (MSR_MTRRdefType, def, dummy); def &=0xff ;if (def !=MTRR_TYPE_UNCACHABLE )return 0 ;
arch/x86/kernel/cpu/mtrr/generic.c +12 -12
@@ -20,9 +20,9 @@ struct fixed_range_block { };static struct fixed_range_block fixed_range_blocks[] = { - { MTRRfix64K_00000_MSR,1 },/* one 64k MTRR */ - { MTRRfix16K_80000_MSR,2 },/* two 16k MTRRs */ - { MTRRfix4K_C0000_MSR,8 },/* eight 4k MTRRs */ + { MSR_MTRRfix64K_00000,1 },/* one 64k MTRR */ + { MSR_MTRRfix16K_80000,2 },/* two 16k MTRRs */ + { MSR_MTRRfix4K_C0000,8 },/* eight 4k MTRRs */ {} };
@@ -194,12 +194,12 @@ get_fixed_ranges(mtrr_type * frs)k8_check_syscfg_dram_mod_en (); -rdmsr (MTRRfix64K_00000_MSR, p[0 ], p[1 ]); +rdmsr (MSR_MTRRfix64K_00000, p[0 ], p[1 ]);for (i =0 ; i <2 ; i++) -rdmsr (MTRRfix16K_80000_MSR + i, p[2 + i *2 ], p[3 + i *2 ]); +rdmsr (MSR_MTRRfix16K_80000 + i, p[2 + i *2 ], p[3 + i *2 ]);for (i =0 ; i <8 ; i++) -rdmsr (MTRRfix4K_C0000_MSR + i, p[6 + i *2 ], p[7 + i *2 ]); +rdmsr (MSR_MTRRfix4K_C0000 + i, p[6 + i *2 ], p[7 + i *2 ]); }void mtrr_save_fixed_ranges (void *info)
@@ -306,7 +306,7 @@ void __init get_mtrr_state(void) vrs = mtrr_state.var_ranges; -rdmsr (MTRRcap_MSR, lo, dummy); +rdmsr (MSR_MTRRcap, lo, dummy); mtrr_state.have_fixed = (lo >>8 ) &1 ;for (i =0 ; i < num_var_ranges; i++)
@@ -314,7 +314,7 @@ void __init get_mtrr_state(void)if (mtrr_state.have_fixed)get_fixed_ranges (mtrr_state.fixed_ranges); -rdmsr (MTRRdefType_MSR, lo, dummy); +rdmsr (MSR_MTRRdefType, lo, dummy); mtrr_state.def_type = (lo &0xff ); mtrr_state.enabled = (lo &0xc00 ) >>10 ;
@@ -579,10 +579,10 @@ static void prepare_set(void) __acquires(set_atomicity_lock)__flush_tlb ();/* Save MTRR state */ -rdmsr (MTRRdefType_MSR, deftype_lo, deftype_hi); +rdmsr (MSR_MTRRdefType, deftype_lo, deftype_hi);/* Disable MTRRs, and set the default type to uncached */ -mtrr_wrmsr (MTRRdefType_MSR, deftype_lo & ~0xcff , deftype_hi); +mtrr_wrmsr (MSR_MTRRdefType, deftype_lo & ~0xcff , deftype_hi); } static void post_set(void) __releases(set_atomicity_lock)
@@ -591,7 +591,7 @@ static void post_set(void) __releases(set_atomicity_lock)__flush_tlb ();/* Intel (P6) standard MTRRs */ -mtrr_wrmsr (MTRRdefType_MSR, deftype_lo, deftype_hi); +mtrr_wrmsr (MSR_MTRRdefType, deftype_lo, deftype_hi);/* Enable caches */ write_cr0 (read_cr0 () &0xbfffffff );
@@ -703,7 +703,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size, unsigned istatic int generic_have_wrcomb (void ) {unsigned long config, dummy; -rdmsr (MTRRcap_MSR, config, dummy); +rdmsr (MSR_MTRRcap, config, dummy);return (config & (1 <<10 )); }
arch/x86/kernel/cpu/mtrr/main.c +1 -1
@@ -104,7 +104,7 @@ static void __init set_num_var_ranges(void)unsigned long config =0 , dummy;if (use_intel ()) { -rdmsr (MTRRcap_MSR, config, dummy); +rdmsr (MSR_MTRRcap, config, dummy); }else if (is_cpu (AMD )) config =2 ;else if (is_cpu (CYRIX ) ||is_cpu (CENTAUR ))
arch/x86/kernel/cpu/mtrr/mtrr.h +0 -15
@@ -5,21 +5,6 @@#include <linux/types.h> #include <linux/stddef.h> -#define MTRRcap_MSR 0x0fe -#define MTRRdefType_MSR 0x2ff - -#define MTRRfix64K_00000_MSR 0x250 -#define MTRRfix16K_80000_MSR 0x258 -#define MTRRfix16K_A0000_MSR 0x259 -#define MTRRfix4K_C0000_MSR 0x268 -#define MTRRfix4K_C8000_MSR 0x269 -#define MTRRfix4K_D0000_MSR 0x26a -#define MTRRfix4K_D8000_MSR 0x26b -#define MTRRfix4K_E0000_MSR 0x26c -#define MTRRfix4K_E8000_MSR 0x26d -#define MTRRfix4K_F0000_MSR 0x26e -#define MTRRfix4K_F8000_MSR 0x26f -#define MTRR_CHANGE_MASK_FIXED 0x01#define MTRR_CHANGE_MASK_VARIABLE 0x02#define MTRR_CHANGE_MASK_DEFTYPE 0x04
arch/x86/kernel/cpu/mtrr/state.c +3 -3
@@ -35,7 +35,7 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)if (use_intel ())/* Save MTRR state */ -rdmsr (MTRRdefType_MSR, ctxt->deftype_lo, ctxt->deftype_hi); +rdmsr (MSR_MTRRdefType, ctxt->deftype_lo, ctxt->deftype_hi);else /* Cyrix ARRs - everything else were excluded at the top */ ctxt->ccr3 =getCx86 (CX86_CCR3 );
@@ -46,7 +46,7 @@ void set_mtrr_cache_disable(struct set_mtrr_context *ctxt) {if (use_intel ())/* Disable MTRRs, and set the default type to uncached */ -mtrr_wrmsr (MTRRdefType_MSR, ctxt->deftype_lo &0xf300UL , +mtrr_wrmsr (MSR_MTRRdefType, ctxt->deftype_lo &0xf300UL , ctxt->deftype_hi);else if (is_cpu (CYRIX ))/* Cyrix ARRs - everything else were excluded at the top */
@@ -64,7 +64,7 @@ void set_mtrr_done(struct set_mtrr_context *ctxt)/* Restore MTRRdefType */ if (use_intel ())/* Intel (P6) standard MTRRs */ -mtrr_wrmsr (MTRRdefType_MSR, ctxt->deftype_lo, ctxt->deftype_hi); +mtrr_wrmsr (MSR_MTRRdefType, ctxt->deftype_lo, ctxt->deftype_hi);else /* Cyrix ARRs - everything else was excluded at the top */ setCx86 (CX86_CCR3 , ctxt->ccr3);
arch/x86/kernel/dumpstack.h +0 -1
@@ -29,7 +29,6 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, unsigned long *sp, unsigned long bp, char *log_lvl);extern unsigned int code_bytes; -extern int kstack_depth_to_print;/* The form of the top of the frame on the stack */ struct stack_frame {
arch/x86/kernel/early-quirks.c +2 -0
@@ -97,6 +97,7 @@ static void __init nvidia_bugs(int num, int slot, int func) } #if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC) +#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC) static u32 __init ati_ixp4x0_rev(int num, int slot, int func) { u32 d;
@@ -114,6 +115,7 @@ static u32 __init ati_ixp4x0_rev(int num, int slot, int func) d &=0xff ; return d; } +#endif static void __init ati_bugs (int num,int slot,int func) {
arch/x86/kernel/irq.c +1 -0
@@ -12,6 +12,7 @@#include <asm/io_apic.h> #include <asm/irq.h> #include <asm/idle.h> +#include <asm/hw_irq.h> atomic_t irq_err_count;
arch/x86/kernel/process.c +1 -0
@@ -11,6 +11,7 @@#include <trace/power.h> #include <asm/system.h> #include <asm/apic.h> +#include <asm/syscalls.h> #include <asm/idle.h> #include <asm/uaccess.h> #include <asm/i387.h>
arch/x86/kernel/tsc.c +4 -4
@@ -384,13 +384,13 @@ unsigned long native_calibrate_tsc(void) {u64 tsc1, tsc2, delta, ref1, ref2;unsigned long tsc_pit_min =ULONG_MAX , tsc_ref_min =ULONG_MAX ; -unsigned long flags, latch, ms, fast_calibrate, tsc_khz; +unsigned long flags, latch, ms, fast_calibrate, hv_tsc_khz;int hpet =is_hpet_enabled (), i, loopmin; - tsc_khz =get_hypervisor_tsc_freq (); -if (tsc_khz) { + hv_tsc_khz =get_hypervisor_tsc_freq (); +if (hv_tsc_khz) {printk (KERN_INFO "TSC: Frequency read from the hypervisor\n" ); -return tsc_khz; +return hv_tsc_khz; }local_irq_save (flags);
arch/x86/kernel/tsc_sync.c +6 -8
@@ -34,6 +34,7 @@ static __cpuinitdata atomic_t stop_count;* of a critical section, to be able to prove TSC time-warps: */ static __cpuinitdata raw_spinlock_t sync_lock = __RAW_SPIN_LOCK_UNLOCKED; +static __cpuinitdata cycles_t last_tsc;static __cpuinitdata cycles_t max_warp;static __cpuinitdata int nr_warps;
@@ -113,13 +114,12 @@ void __cpuinit check_tsc_sync_source(int cpu)return ;if (boot_cpu_has (X86_FEATURE_TSC_RELIABLE )) { -printk (KERN_INFO -"Skipping synchronization checks as TSC is reliable.\n" ); +pr_info ("Skipping synchronization checks as TSC is reliable.\n" );return ; } -printk (KERN_INFO "checking TSC synchronization [CPU#%d -> CPU#%d]:" , -smp_processor_id (), cpu); +pr_info ("checking TSC synchronization [CPU#%d -> CPU#%d]:" , +smp_processor_id (), cpu);/* * Reset it - in case this is a second bootup:
@@ -143,8 +143,8 @@ void __cpuinit check_tsc_sync_source(int cpu)if (nr_warps) {printk ("\n" ); -printk (KERN_WARNING "Measured %Ld cycles TSC warp between CPUs," -" turning off TSC clock.\n" , max_warp); +pr_warning ("Measured %Ld cycles TSC warp between CPUs, " +"turning off TSC clock.\n" , max_warp);mark_tsc_unstable ("check_tsc_sync_source failed" ); }else {printk (" passed.\n" );
@@ -195,5 +195,3 @@ void __cpuinit check_tsc_sync_target(void)while (atomic_read (&stop_count) != cpus)cpu_relax (); } -#undef NR_LOOPS -
arch/x86/kernel/vm86_32.c +2 -2
@@ -318,9 +318,9 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk }/* -* Save old state, set default return value (%ax) to 0 +* Save old state, set default return value (%ax) to 0 (VM86_SIGNAL) */ - info->regs32->ax =0 ; + info->regs32->ax =VM86_SIGNAL ; tsk->thread.saved_sp0 = tsk->thread.sp0; tsk->thread.saved_fs = info->regs32->fs; tsk->thread.saved_gs =get_user_gs (info->regs32);
arch/x86/mm/init.c +1 -0
@@ -1,3 +1,4 @@ +#include <linux/initrd.h> #include <linux/ioport.h> #include <linux/swap.h>
arch/x86/vdso/vma.c +1 -0
@@ -8,6 +8,7 @@#include <linux/sched.h> #include <linux/init.h> #include <linux/random.h> +#include <linux/elf.h> #include <asm/vsyscall.h> #include <asm/vgtod.h> #include <asm/proto.h>
Quoted 4 lines · Ingo Molnar
Please pull the latest x86-cleanups-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-cleanups-for-linus
Just checking - these are all independent and it doesn't much matter which order I pull in, right?
That way I can go through the easy ones first, which helps me get around to the ones I decide I want to think about more later.
Linus
Quoted 9 lines · Linus Torvalds
Quoted 4 lines · Ingo Molnar
Please pull the latest x86-cleanups-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-cleanups-for-linusJust checking - these are all independent and it doesn't much matter which order I pull in, right?
Yes - each is -git based and independent. To make sure i also built each one before sending, and also booted the ones i wanted to double-check (about half of them).
Quoted 2 lines
That way I can go through the easy ones first, which helps me get around to the ones I decide I want to think about more later.
Yeah. Any order should be fine and if there are conflicts they should be straightforward.
Any unreasonably heavy conflict was resolved by merging topics into a single entity. This happened for one of the branches: the IRQ bits i sent started out as x86/apic - the the scope of the changes increased on the way.
No unreasonable mixing of topics happened in this cycle - the topic separation worked out fine, due to increased attention we spent on making it happen and due to the unification activities winding down (finally! :-).
Ingo