diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-05 15:02:18 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-05 15:02:18 -0400 |
| commit | 46302b46e5cf9e23859360e38c540be6e3465c6b (patch) | |
| tree | 0ffa9e4493bcba6985895045187f807d5fd99a99 | |
| parent | 5b1755f23b98e0afaedaec8344002ab184646286 (diff) | |
| parent | 24e35800cdc4350fc34e2bed37b608a9e13ab3b6 (diff) | |
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: Don't leak 64-bit kernel register values to 32-bit processes
x86, SLUB: Remove unused CONFIG FAST_CMPXCHG_LOCAL
x86: earlyprintk: Fix regression to handle serial,ttySn as 1 arg
x86: Don't generate cmpxchg8b_emu if CONFIG_X86_CMPXCHG64=y
x86: Fix csum_ipv6_magic asm memory clobber
x86: Optimize cmpxchg64() at build-time some more
| -rw-r--r-- | Documentation/kernel-parameters.txt | 1 | ||||
| -rw-r--r-- | arch/x86/Kconfig | 4 | ||||
| -rw-r--r-- | arch/x86/Kconfig.cpu | 3 | ||||
| -rw-r--r-- | arch/x86/ia32/ia32entry.S | 36 | ||||
| -rw-r--r-- | arch/x86/kernel/early_printk.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/i386_ksyms_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/lib/Makefile | 6 |
7 files changed, 36 insertions, 21 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 6fa7292947e5..9107b387e91f 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -671,6 +671,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
| 671 | earlyprintk= [X86,SH,BLACKFIN] | 671 | earlyprintk= [X86,SH,BLACKFIN] |
| 672 | earlyprintk=vga | 672 | earlyprintk=vga |
| 673 | earlyprintk=serial[,ttySn[,baudrate]] | 673 | earlyprintk=serial[,ttySn[,baudrate]] |
| 674 | earlyprintk=ttySn[,baudrate] | ||
| 674 | earlyprintk=dbgp[debugController#] | 675 | earlyprintk=dbgp[debugController#] |
| 675 | 676 | ||
| 676 | Append ",keep" to not disable it when the real console | 677 | Append ",keep" to not disable it when the real console |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8da93745c087..c876bace8fdc 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -86,10 +86,6 @@ config STACKTRACE_SUPPORT | |||
| 86 | config HAVE_LATENCYTOP_SUPPORT | 86 | config HAVE_LATENCYTOP_SUPPORT |
| 87 | def_bool y | 87 | def_bool y |
| 88 | 88 | ||
| 89 | config FAST_CMPXCHG_LOCAL | ||
| 90 | bool | ||
| 91 | default y | ||
| 92 | |||
| 93 | config MMU | 89 | config MMU |
| 94 | def_bool y | 90 | def_bool y |
| 95 | 91 | ||
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index 527519b8a9f9..f2824fb8c79c 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu | |||
| @@ -400,7 +400,7 @@ config X86_TSC | |||
| 400 | 400 | ||
| 401 | config X86_CMPXCHG64 | 401 | config X86_CMPXCHG64 |
| 402 | def_bool y | 402 | def_bool y |
| 403 | depends on X86_PAE || X86_64 | 403 | depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM |
| 404 | 404 | ||
| 405 | # this should be set for all -march=.. options where the compiler | 405 | # this should be set for all -march=.. options where the compiler |
| 406 | # generates cmov. | 406 | # generates cmov. |
| @@ -412,6 +412,7 @@ config X86_MINIMUM_CPU_FAMILY | |||
| 412 | int | 412 | int |
| 413 | default "64" if X86_64 | 413 | default "64" if X86_64 |
| 414 | default "6" if X86_32 && X86_P6_NOP | 414 | default "6" if X86_32 && X86_P6_NOP |
| 415 | default "5" if X86_32 && X86_CMPXCHG64 | ||
| 415 | default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK) | 416 | default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK) |
| 416 | default "3" | 417 | default "3" |
| 417 | 418 | ||
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 74619c4f9fda..1733f9f65e82 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
| @@ -21,8 +21,8 @@ | |||
| 21 | #define __AUDIT_ARCH_LE 0x40000000 | 21 | #define __AUDIT_ARCH_LE 0x40000000 |
| 22 | 22 | ||
| 23 | #ifndef CONFIG_AUDITSYSCALL | 23 | #ifndef CONFIG_AUDITSYSCALL |
| 24 | #define sysexit_audit int_ret_from_sys_call | 24 | #define sysexit_audit ia32_ret_from_sys_call |
| 25 | #define sysretl_audit int_ret_from_sys_call | 25 | #define sysretl_audit ia32_ret_from_sys_call |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | #define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8) | 28 | #define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8) |
| @@ -39,12 +39,12 @@ | |||
| 39 | .endm | 39 | .endm |
| 40 | 40 | ||
| 41 | /* clobbers %eax */ | 41 | /* clobbers %eax */ |
| 42 | .macro CLEAR_RREGS _r9=rax | 42 | .macro CLEAR_RREGS offset=0, _r9=rax |
| 43 | xorl %eax,%eax | 43 | xorl %eax,%eax |
| 44 | movq %rax,R11(%rsp) | 44 | movq %rax,\offset+R11(%rsp) |
| 45 | movq %rax,R10(%rsp) | 45 | movq %rax,\offset+R10(%rsp) |
| 46 | movq %\_r9,R9(%rsp) | 46 | movq %\_r9,\offset+R9(%rsp) |
| 47 | movq %rax,R8(%rsp) | 47 | movq %rax,\offset+R8(%rsp) |
| 48 | .endm | 48 | .endm |
| 49 | 49 | ||
| 50 | /* | 50 | /* |
| @@ -172,6 +172,10 @@ sysexit_from_sys_call: | |||
| 172 | movl RIP-R11(%rsp),%edx /* User %eip */ | 172 | movl RIP-R11(%rsp),%edx /* User %eip */ |
| 173 | CFI_REGISTER rip,rdx | 173 | CFI_REGISTER rip,rdx |
| 174 | RESTORE_ARGS 1,24,1,1,1,1 | 174 | RESTORE_ARGS 1,24,1,1,1,1 |
| 175 | xorq %r8,%r8 | ||
| 176 | xorq %r9,%r9 | ||
| 177 | xorq %r10,%r10 | ||
| 178 | xorq %r11,%r11 | ||
| 175 | popfq | 179 | popfq |
| 176 | CFI_ADJUST_CFA_OFFSET -8 | 180 | CFI_ADJUST_CFA_OFFSET -8 |
| 177 | /*CFI_RESTORE rflags*/ | 181 | /*CFI_RESTORE rflags*/ |
| @@ -202,7 +206,7 @@ sysexit_from_sys_call: | |||
| 202 | 206 | ||
| 203 | .macro auditsys_exit exit,ebpsave=RBP | 207 | .macro auditsys_exit exit,ebpsave=RBP |
| 204 | testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) | 208 | testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) |
| 205 | jnz int_ret_from_sys_call | 209 | jnz ia32_ret_from_sys_call |
| 206 | TRACE_IRQS_ON | 210 | TRACE_IRQS_ON |
| 207 | sti | 211 | sti |
| 208 | movl %eax,%esi /* second arg, syscall return value */ | 212 | movl %eax,%esi /* second arg, syscall return value */ |
| @@ -218,8 +222,9 @@ sysexit_from_sys_call: | |||
| 218 | cli | 222 | cli |
| 219 | TRACE_IRQS_OFF | 223 | TRACE_IRQS_OFF |
| 220 | testl %edi,TI_flags(%r10) | 224 | testl %edi,TI_flags(%r10) |
| 221 | jnz int_with_check | 225 | jz \exit |
| 222 | jmp \exit | 226 | CLEAR_RREGS -ARGOFFSET |
| 227 | jmp int_with_check | ||
| 223 | .endm | 228 | .endm |
| 224 | 229 | ||
| 225 | sysenter_auditsys: | 230 | sysenter_auditsys: |
| @@ -329,6 +334,9 @@ sysretl_from_sys_call: | |||
| 329 | CFI_REGISTER rip,rcx | 334 | CFI_REGISTER rip,rcx |
| 330 | movl EFLAGS-ARGOFFSET(%rsp),%r11d | 335 | movl EFLAGS-ARGOFFSET(%rsp),%r11d |
| 331 | /*CFI_REGISTER rflags,r11*/ | 336 | /*CFI_REGISTER rflags,r11*/ |
| 337 | xorq %r10,%r10 | ||
| 338 | xorq %r9,%r9 | ||
| 339 | xorq %r8,%r8 | ||
| 332 | TRACE_IRQS_ON | 340 | TRACE_IRQS_ON |
| 333 | movl RSP-ARGOFFSET(%rsp),%esp | 341 | movl RSP-ARGOFFSET(%rsp),%esp |
| 334 | CFI_RESTORE rsp | 342 | CFI_RESTORE rsp |
| @@ -353,7 +361,7 @@ cstar_tracesys: | |||
| 353 | #endif | 361 | #endif |
| 354 | xchgl %r9d,%ebp | 362 | xchgl %r9d,%ebp |
| 355 | SAVE_REST | 363 | SAVE_REST |
| 356 | CLEAR_RREGS r9 | 364 | CLEAR_RREGS 0, r9 |
| 357 | movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */ | 365 | movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */ |
| 358 | movq %rsp,%rdi /* &pt_regs -> arg1 */ | 366 | movq %rsp,%rdi /* &pt_regs -> arg1 */ |
| 359 | call syscall_trace_enter | 367 | call syscall_trace_enter |
| @@ -425,6 +433,8 @@ ia32_do_call: | |||
| 425 | call *ia32_sys_call_table(,%rax,8) # xxx: rip relative | 433 | call *ia32_sys_call_table(,%rax,8) # xxx: rip relative |
| 426 | ia32_sysret: | 434 | ia32_sysret: |
| 427 | movq %rax,RAX-ARGOFFSET(%rsp) | 435 | movq %rax,RAX-ARGOFFSET(%rsp) |
| 436 | ia32_ret_from_sys_call: | ||
| 437 | CLEAR_RREGS -ARGOFFSET | ||
| 428 | jmp int_ret_from_sys_call | 438 | jmp int_ret_from_sys_call |
| 429 | 439 | ||
| 430 | ia32_tracesys: | 440 | ia32_tracesys: |
| @@ -442,8 +452,8 @@ END(ia32_syscall) | |||
| 442 | 452 | ||
| 443 | ia32_badsys: | 453 | ia32_badsys: |
| 444 | movq $0,ORIG_RAX-ARGOFFSET(%rsp) | 454 | movq $0,ORIG_RAX-ARGOFFSET(%rsp) |
| 445 | movq $-ENOSYS,RAX-ARGOFFSET(%rsp) | 455 | movq $-ENOSYS,%rax |
| 446 | jmp int_ret_from_sys_call | 456 | jmp ia32_sysret |
| 447 | 457 | ||
| 448 | quiet_ni_syscall: | 458 | quiet_ni_syscall: |
| 449 | movq $-ENOSYS,%rax | 459 | movq $-ENOSYS,%rax |
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index 41fd965c80c6..b9c830c12b4a 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c | |||
| @@ -206,8 +206,11 @@ static int __init setup_early_printk(char *buf) | |||
| 206 | 206 | ||
| 207 | while (*buf != '\0') { | 207 | while (*buf != '\0') { |
| 208 | if (!strncmp(buf, "serial", 6)) { | 208 | if (!strncmp(buf, "serial", 6)) { |
| 209 | early_serial_init(buf + 6); | 209 | buf += 6; |
| 210 | early_serial_init(buf); | ||
| 210 | early_console_register(&early_serial_console, keep); | 211 | early_console_register(&early_serial_console, keep); |
| 212 | if (!strncmp(buf, ",ttyS", 5)) | ||
| 213 | buf += 5; | ||
| 211 | } | 214 | } |
| 212 | if (!strncmp(buf, "ttyS", 4)) { | 215 | if (!strncmp(buf, "ttyS", 4)) { |
| 213 | early_serial_init(buf + 4); | 216 | early_serial_init(buf + 4); |
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c index 1736c5a725aa..9c3bd4a2050e 100644 --- a/arch/x86/kernel/i386_ksyms_32.c +++ b/arch/x86/kernel/i386_ksyms_32.c | |||
| @@ -15,8 +15,10 @@ EXPORT_SYMBOL(mcount); | |||
| 15 | * the export, but dont use it from C code, it is used | 15 | * the export, but dont use it from C code, it is used |
| 16 | * by assembly code and is not using C calling convention! | 16 | * by assembly code and is not using C calling convention! |
| 17 | */ | 17 | */ |
| 18 | #ifndef CONFIG_X86_CMPXCHG64 | ||
| 18 | extern void cmpxchg8b_emu(void); | 19 | extern void cmpxchg8b_emu(void); |
| 19 | EXPORT_SYMBOL(cmpxchg8b_emu); | 20 | EXPORT_SYMBOL(cmpxchg8b_emu); |
| 21 | #endif | ||
| 20 | 22 | ||
| 21 | /* Networking helper routines. */ | 23 | /* Networking helper routines. */ |
| 22 | EXPORT_SYMBOL(csum_partial_copy_generic); | 24 | EXPORT_SYMBOL(csum_partial_copy_generic); |
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 3e549b8ec8c9..85f5db95c60f 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile | |||
| @@ -15,8 +15,10 @@ ifeq ($(CONFIG_X86_32),y) | |||
| 15 | obj-y += atomic64_32.o | 15 | obj-y += atomic64_32.o |
| 16 | lib-y += checksum_32.o | 16 | lib-y += checksum_32.o |
| 17 | lib-y += strstr_32.o | 17 | lib-y += strstr_32.o |
| 18 | lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o | 18 | lib-y += semaphore_32.o string_32.o |
| 19 | 19 | ifneq ($(CONFIG_X86_CMPXCHG64),y) | |
| 20 | lib-y += cmpxchg8b_emu.o | ||
| 21 | endif | ||
| 20 | lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o | 22 | lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o |
| 21 | else | 23 | else |
| 22 | obj-y += io_64.o iomap_copy_64.o | 24 | obj-y += io_64.o iomap_copy_64.o |
