x86 updates
Subsystems (4)
Linus, please pull the latest x86 git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
Note: three (well-tested) lguest fixlets are included as well.
Thanks,
Ingo
------------------>
Adrian Bunk (1):
x86: don't make swapper_pg_pmd global
Ahmed S. Darwish (1):
x86/lguest: fix pgdir pmd index calculation
Glauber Costa (1):
x86: make c_idle.work have a static address.
H. Peter Anvin (5):
x86: do not promote TM3x00/TM5x00 to i686-class
x86: require family >= 6 if we are using P6 NOPs
x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC
x86: add comments for NOPs
x86: handle BIOSes which terminate e820 with CF=1 and no SMAP
Harvey Harrison (1):
lguest: include function prototypes
Ingo Molnar (4):
x86: make DEBUG_PAGEALLOC and CPA more robust
x86: fix spontaneous reboot with allyesconfig bzImage
x86: rename KERNEL_TEXT_SIZE => KERNEL_IMAGE_SIZE
x86: fix execve with -fstack-protect
Joerg Roedel (1):
x86: don't print a warning when MTRR are blank and running in KVM
Mikael Pettersson (1):
x86: fix boot failure on 486 due to TSC breakage
Pavel Machek (2):
x86: hpet fix docbook comment
x86: notsc is ignored on common configurations
Priit Laes (1):
x86: fix build on non-C locales.
Randy Dunlap (1):
x86/mtrr: fix kernel-doc missing notation
Thomas Gleixner (2):
x86: fix vsyscall wreckage
x86: no robust/pi futex for real i386 CPUs
Tony Breeds (1):
lguest: fix build breakage
Vegard Nossum (1):
x86: don't save unreliable stack trace entries
Yinghai Lu (1):
x86: remove double-checking empty zero pages debug
arch/x86/Kconfig.cpu | 14 ++++++ arch/x86/boot/memory.c | 9 +++- arch/x86/kernel/asm-offsets_32.c | 4 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/mtrr/main.c | 9 +++- arch/x86/kernel/cpu/transmeta.c | 7 --- arch/x86/kernel/entry_64.S | 6 ++- arch/x86/kernel/head_32.S | 2 +- arch/x86/kernel/head_64.S | 22 ++++++---- arch/x86/kernel/hpet.c | 4 +- arch/x86/kernel/process_64.c | 6 +- arch/x86/kernel/setup_64.c | 2 +- arch/x86/kernel/smpboot_64.c | 2 +- arch/x86/kernel/stacktrace.c | 4 ++ arch/x86/kernel/tsc_32.c | 3 +- arch/x86/kernel/vsyscall_64.c | 52 +---------------------- arch/x86/lguest/boot.c | 12 +----- arch/x86/mm/init_64.c | 13 +----- arch/x86/mm/pageattr.c | 84 +++++++++++++++++++++++--------------- arch/x86/vdso/Makefile | 2 +- include/asm-x86/futex.h | 7 +++ include/asm-x86/lguest.h | 11 +++++ include/asm-x86/nops.h | 66 +++++++++++++++++++++--------- include/asm-x86/page_64.h | 8 +++- 24 files changed, 191 insertions(+), 160 deletions(-)
arch/x86/Kconfig.cpu +14 -0
@@ -377,6 +377,19 @@ config X86_OOSTORE def_bool y depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR +# +# P6_NOPs are a relatively minor optimization that require a family >= +# 6 processor, except that it is broken on certain VIA chips. +# Furthermore, AMD chips prefer a totally different sequence of NOPs +# (which work on all CPUs). As a result, disallow these if we're +# compiling X86_GENERIC but not X86_64 (these NOPs do work on all +# x86-64 capable chips); the list of processors in the right-hand clause +# are the cores that benefit from this optimization. +# +config X86_P6_NOP + def_bool y + depends on (X86_64 || !X86_GENERIC) && (M686 || MPENTIUMII || MPENTIUMIII || MPENTIUMM || MCORE2 || PENTIUM4) + config X86_TSC def_bool y depends on ((MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2) && !X86_NUMAQ) || X86_64
@@ -390,6 +403,7 @@ config X86_CMOV config X86_MINIMUM_CPU_FAMILY int default "64" if X86_64 + default "6" if X86_32 && X86_P6_NOP default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK) default "3"
arch/x86/boot/memory.c +6 -3
@@ -37,6 +37,12 @@ static int detect_memory_e820(void) "=m" (*desc) : "D" (desc), "d" (SMAP), "a" (0xe820)); +/* BIOSes which terminate the chain with CF = 1 as opposed +to %ebx = 0 don't always report the SMAP signature on +the final, failing, probe. */ +if (err) +break ; +/* Some BIOSes stop returning SMAP in the middle of the search loop. We don't know exactly how the BIOS screwed up the map at that point, we might have a
@@ -47,9 +53,6 @@ static int detect_memory_e820(void)break ; } -if (err) -break ; - count++; desc++; }while (next && count <E820MAX );
arch/x86/kernel/asm-offsets_32.c +1 -3
@@ -128,13 +128,11 @@ void foo(void)OFFSET (XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);#endif -#ifdef CONFIG_LGUEST_GUEST +#if defined(CONFIG_LGUEST ) || defined(CONFIG_LGUEST_GUEST ) || defined(CONFIG_LGUEST_MODULE )BLANK ();OFFSET (LGUEST_DATA_irq_enabled, lguest_data, irq_enabled);OFFSET (LGUEST_DATA_pgdir, lguest_data, pgdir); -#endif -#ifdef CONFIG_LGUEST BLANK ();OFFSET (LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc);OFFSET (LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc);
arch/x86/kernel/cpu/common.c +1 -1
@@ -504,7 +504,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)/* Clear all flags overriden by options */ for (i =0 ; i <NCAPINTS ; i++) - c->x86_capability[i] ^= cleared_cpu_caps[i]; + c->x86_capability[i] &= ~cleared_cpu_caps[i];/* Init Machine Check Exception if available. */ mcheck_init (c);
arch/x86/kernel/cpu/mtrr/main.c +7 -2
@@ -43,6 +43,7 @@#include <asm/uaccess.h> #include <asm/processor.h> #include <asm/msr.h> +#include <asm/kvm_para.h> #include "mtrr.h" u32 num_var_ranges =0 ;
@@ -649,6 +650,7 @@ static __init int amd_special_default_mtrr(void)/** * mtrr_trim_uncached_memory - trim RAM not covered by MTRRs +* @end_pfn: ending page frame number * * Some buggy BIOSes don't setup the MTRRs properly for systems with certain * memory configurations. This routine checks that the highest MTRR matches
@@ -688,8 +690,11 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)/* kvm/qemu doesn't have mtrr set right, don't trim them all */ if (!highest_pfn) { -printk (KERN_WARNING "WARNING: strange, CPU MTRRs all blank?\n" ); -WARN_ON (1 ); +if (!kvm_para_available ()) { +printk (KERN_WARNING +"WARNING: strange, CPU MTRRs all blank?\n" ); +WARN_ON (1 ); + }return 0 ; }
arch/x86/kernel/cpu/transmeta.c +0 -7
@@ -76,13 +76,6 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)/* All Transmeta CPUs have a constant TSC */ set_bit (X86_FEATURE_CONSTANT_TSC , c->x86_capability); -/* If we can run i686 user-space code, call us an i686 */ -#define USER686 ((1 << X86_FEATURE_TSC)|\ - (1 << X86_FEATURE_CX8)|\ - (1 << X86_FEATURE_CMOV)) -if (c->x86 ==5 && (c->x86_capability[0 ] &USER686 ) ==USER686 ) - c->x86 =6 ; -#ifdef CONFIG_SYSCTL /* randomize_va_space slows us down enormously; it probably triggers retranslation of x86->native bytecode */
arch/x86/kernel/entry_64.S +4 -2
@@ -453,6 +453,7 @@ ENTRY(stub_execve) CFI_REGISTER rip, r11 SAVE_REST FIXUP_TOP_OF_STACK %r11 + movq %rsp, %rcx call sys_execve RESTORE_TOP_OF_STACK %r11 movq %rax,RAX(%rsp)
@@ -1036,15 +1037,16 @@ ENDPROC(child_rip) * rdi: name, rsi: argv, rdx: envp * * We want to fallback into: - * extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs regs) + * extern long sys_execve(char *name, char **argv,char **envp, struct pt_regs *regs) * * do_sys_execve asm fallback arguments: - * rdi: name, rsi: argv, rdx: envp, fake frame on the stack + * rdi: name, rsi: argv, rdx: envp, rcx: fake frame on the stack */ ENTRY(kernel_execve) CFI_STARTPROC FAKE_STACK_FRAME $0 SAVE_ALL + movq %rsp,%rcx call sys_execve movq %rax, RAX(%rsp) RESTORE_REST
arch/x86/kernel/head_32.S +1 -1
@@ -606,7 +606,7 @@ ENTRY(_stext) .section ".bss.page_aligned","wa" .align PAGE_SIZE_asm #ifdef CONFIG_X86_PAE -ENTRY(swapper_pg_pmd) +swapper_pg_pmd: .fill 1024*KPMDS,4,0 #else ENTRY(swapper_pg_dir)
arch/x86/kernel/head_64.S +14 -8
@@ -379,18 +379,24 @@ NEXT_PAGE(level2_ident_pgt) /* Since I easily can, map the first 1G. * Don't set NX because code runs from these pages. */ - PMDS(0x0000000000000000, __PAGE_KERNEL_LARGE_EXEC, PTRS_PER_PMD) + PMDS(0, __PAGE_KERNEL_LARGE_EXEC, PTRS_PER_PMD) NEXT_PAGE(level2_kernel_pgt) - /* 40MB kernel mapping. The kernel code cannot be bigger than that. - When you change this change KERNEL_TEXT_SIZE in page.h too. */ - /* (2^48-(2*1024*1024*1024)-((2^39)*511)-((2^30)*510)) = 0 */ - PMDS(0x0000000000000000, __PAGE_KERNEL_LARGE_EXEC|_PAGE_GLOBAL, KERNEL_TEXT_SIZE/PMD_SIZE) - /* Module mapping starts here */ - .fill (PTRS_PER_PMD - (KERNEL_TEXT_SIZE/PMD_SIZE)),8,0 + /* + * 128 MB kernel mapping. We spend a full page on this pagetable + * anyway. + * + * The kernel code+data+bss must not be bigger than that. + * + * (NOTE: at +128MB starts the module area, see MODULES_VADDR. + * If you want to increase this then increase MODULES_VADDR + * too.) + */ + PMDS(0, __PAGE_KERNEL_LARGE_EXEC|_PAGE_GLOBAL, + KERNEL_IMAGE_SIZE/PMD_SIZE) NEXT_PAGE(level2_spare_pgt) - .fill 512,8,0 + .fill 512, 8, 0 #undef PMDS #undef NEXT_PAGE
arch/x86/kernel/hpet.c +2 -2
@@ -368,8 +368,8 @@ static int hpet_clocksource_register(void)return 0 ; } -/* -* Try to setup the HPET timer +/** +* hpet_enable - Try to setup the HPET timer. Returns 1 on success. */ int __init hpet_enable (void ) {
arch/x86/kernel/process_64.c +3 -3
@@ -730,16 +730,16 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)*/ asmlinkage long sys_execve (char __user *name,char __user *__user *argv, -char __user *__user *envp,struct pt_regs regs) +char __user *__user *envp,struct pt_regs *regs) {long error;char * filename; filename =getname (name); error =PTR_ERR (filename); -if (IS_ERR (filename)) +if (IS_ERR (filename))return error; - error =do_execve (filename, argv, envp, ®s); + error =do_execve (filename, argv, envp, regs);putname (filename);return error; }
arch/x86/kernel/setup_64.c +1 -1
@@ -1021,7 +1021,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)/* Clear all flags overriden by options */ for (i =0 ; i <NCAPINTS ; i++) - c->x86_capability[i] ^= cleared_cpu_caps[i]; + c->x86_capability[i] &= ~cleared_cpu_caps[i];#ifdef CONFIG_X86_MCE mcheck_init (c);
arch/x86/kernel/smpboot_64.c +1 -1
@@ -554,10 +554,10 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)int timeout;unsigned long start_rip;struct create_idle c_idle = { - .work =__WORK_INITIALIZER (c_idle.work, do_fork_idle), .cpu = cpu, .done =COMPLETION_INITIALIZER_ONSTACK (c_idle.done), }; +INIT_WORK (&c_idle.work, do_fork_idle);/* allocate memory for gdts of secondary cpus. Hotplug is considered */ if (!cpu_gdt_descr[cpu].address &&
arch/x86/kernel/stacktrace.c +4 -0
@@ -25,6 +25,8 @@ static int save_stack_stack(void *data, char *name)static void save_stack_address (void *data,unsigned long addr,int reliable) {struct stack_trace *trace = data; +if (!reliable) +return ;if (trace->skip >0 ) { trace->skip--;return ;
@@ -37,6 +39,8 @@ static void save_stack_address_nosched(void *data, unsigned long addr, int reliable) {struct stack_trace *trace = (struct stack_trace *)data; +if (!reliable) +return ;if (in_sched_functions (addr))return ;if (trace->skip >0 ) {
arch/x86/kernel/tsc_32.c +2 -1
@@ -28,7 +28,8 @@ EXPORT_SYMBOL_GPL(tsc_khz);static int __init tsc_setup (char *str) {printk (KERN_WARNING "notsc: Kernel compiled with CONFIG_X86_TSC, " -"cannot disable TSC.\n" ); +"cannot disable TSC completely.\n" ); +mark_tsc_unstable ("user disabled TSC" );return 1 ; }#else
arch/x86/kernel/vsyscall_64.c +3 -49
85 lines not on this page · raw message
arch/x86/lguest/boot.c +2 -10
@@ -57,6 +57,7 @@#include <linux/lguest_launcher.h> #include <linux/virtio_console.h> #include <linux/pm.h> +#include <asm/lguest.h> #include <asm/paravirt.h> #include <asm/param.h> #include <asm/page.h>
@@ -75,15 +76,6 @@* behaving in simplified but equivalent ways. In particular, the Guest is the * same kernel as the Host (or at least, built from the same source code). :*/ -/* Declarations for definitions in lguest_guest.S */ -extern char lguest_noirq_start[], lguest_noirq_end[]; -extern const char lgstart_cli[], lgend_cli[]; -extern const char lgstart_sti[], lgend_sti[]; -extern const char lgstart_popf[], lgend_popf[]; -extern const char lgstart_pushf[], lgend_pushf[]; -extern const char lgstart_iret[], lgend_iret[]; -extern void lguest_iret (void ); -struct lguest_data lguest_data = { .hcall_status = { [0 ...LHCALL_RING_SIZE -1 ] =0xFF }, .noirq_start = (u32 )lguest_noirq_start,
@@ -489,7 +481,7 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval) { *pmdp = pmdval;lazy_hcall (LHCALL_SET_PMD ,__pa (pmdp)&PAGE_MASK , - (__pa (pmdp)&(PAGE_SIZE -1 ))/4 ,0 ); + (__pa (pmdp)&(PAGE_SIZE -1 )),0 ); }/* There are a couple of legacy places where the kernel sets a PTE, but we
arch/x86/mm/init_64.c +3 -10
@@ -172,8 +172,9 @@ set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot) }/* -* The head.S code sets up the kernel high mapping from: -* __START_KERNEL_map to __START_KERNEL_map + KERNEL_TEXT_SIZE +* The head.S code sets up the kernel high mapping: +* +* from __START_KERNEL_map to __START_KERNEL_map + size (== _end-_text) * * phys_addr holds the negative offset to the kernel, which is added * to the compile time generated pmds. This results in invalid pmds up
@@ -515,14 +516,6 @@ void __init mem_init(void)/* clear_bss() already clear the empty_zero_page */ -/* temporary debugging - double check it's true: */ - { -int i; - -for (i =0 ; i <1024 ; i++) -WARN_ON_ONCE (empty_zero_page[i]); - } - reservedpages =0 ;/* this will put all low memory onto the freelists */
arch/x86/mm/pageattr.c +51 -33
143 lines not on this page · raw message
arch/x86/vdso/Makefile +1 -1
@@ -48,7 +48,7 @@ obj-$(VDSO64-y) += vdso-syms.lds # Match symbols in the DSO that look like VDSO*; produce a file of constants. # sed-vdsosym := -e 's/^00*/0/' \ - -e 's/^\([0-9a-fA-F]*\) . \(VDSO[a-zA-Z0-9_]*\)$$/\2 = 0x\1;/p' + -e 's/^\([[:xdigit:]]*\) . \(VDSO[[:alnum:]_]*\)$$/\2 = 0x\1;/p' quiet_cmd_vdsosym = VDSOSYM $@ cmd_vdsosym = $(NM) $< | sed -n $(sed-vdsosym) | LC_ALL=C sort > $@
include/asm-x86/futex.h +7 -0
@@ -102,6 +102,13 @@ futex_atomic_op_inuser(int encoded_op, int __user *uaddr)static inline int futex_atomic_cmpxchg_inatomic (int __user *uaddr,int oldval,int newval) { + +#if defined(CONFIG_X86_32 ) && !defined(CONFIG_X86_BSWAP ) +/* Real i386 machines have no cmpxchg instruction */ +if (boot_cpu_data.x86 ==3 ) +return -ENOSYS ; +#endif +if (!access_ok (VERIFY_WRITE , uaddr,sizeof (int )))return -EFAULT ;
include/asm-x86/lguest.h +11 -0
@@ -23,6 +23,17 @@/* Found in switcher.S */ extern unsigned long default_idt_entries[]; +/* Declarations for definitions in lguest_guest.S */ +extern char lguest_noirq_start[], lguest_noirq_end[]; +extern const char lgstart_cli[], lgend_cli[]; +extern const char lgstart_sti[], lgend_sti[]; +extern const char lgstart_popf[], lgend_popf[]; +extern const char lgstart_pushf[], lgend_pushf[]; +extern const char lgstart_iret[], lgend_iret[]; + +extern void lguest_iret (void ); +extern void lguest_init (void ); +struct lguest_regs {/* Manually saved part. */
include/asm-x86/nops.h +46 -20
91 lines not on this page · raw message
include/asm-x86/page_64.h +6 -2
@@ -47,8 +47,12 @@#define __PHYSICAL_MASK_SHIFT 46#define __VIRTUAL_MASK_SHIFT 48 -#define KERNEL_TEXT_SIZE (40*1024*1024) -#define KERNEL_TEXT_START _AC(0xffffffff80000000, UL) +/* +* Kernel image size is limited to 128 MB (see level2_kernel_pgt in +* arch/x86/kernel/head_64.S), and it is mapped here: +*/ +#define KERNEL_IMAGE_SIZE (128*1024*1024) +#define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL)#ifndef __ASSEMBLY__void clear_page (void *page);