diff options
27 files changed, 188 insertions, 91 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 89a47b5aff07..04e6c819b28a 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
| @@ -451,3 +451,33 @@ Why: OSS sound_core grabs all legacy minors (0-255) of SOUND_MAJOR | |||
| 451 | will also allow making ALSA OSS emulation independent of | 451 | will also allow making ALSA OSS emulation independent of |
| 452 | sound_core. The dependency will be broken then too. | 452 | sound_core. The dependency will be broken then too. |
| 453 | Who: Tejun Heo <tj@kernel.org> | 453 | Who: Tejun Heo <tj@kernel.org> |
| 454 | |||
| 455 | ---------------------------- | ||
| 456 | |||
| 457 | What: Support for VMware's guest paravirtuliazation technique [VMI] will be | ||
| 458 | dropped. | ||
| 459 | When: 2.6.37 or earlier. | ||
| 460 | Why: With the recent innovations in CPU hardware acceleration technologies | ||
| 461 | from Intel and AMD, VMware ran a few experiments to compare these | ||
| 462 | techniques to guest paravirtualization technique on VMware's platform. | ||
| 463 | These hardware assisted virtualization techniques have outperformed the | ||
| 464 | performance benefits provided by VMI in most of the workloads. VMware | ||
| 465 | expects that these hardware features will be ubiquitous in a couple of | ||
| 466 | years, as a result, VMware has started a phased retirement of this | ||
| 467 | feature from the hypervisor. We will be removing this feature from the | ||
| 468 | Kernel too. Right now we are targeting 2.6.37 but can retire earlier if | ||
| 469 | technical reasons (read opportunity to remove major chunk of pvops) | ||
| 470 | arise. | ||
| 471 | |||
| 472 | Please note that VMI has always been an optimization and non-VMI kernels | ||
| 473 | still work fine on VMware's platform. | ||
| 474 | Latest versions of VMware's product which support VMI are, | ||
| 475 | Workstation 7.0 and VSphere 4.0 on ESX side, future maintainence | ||
| 476 | releases for these products will continue supporting VMI. | ||
| 477 | |||
| 478 | For more details about VMI retirement take a look at this, | ||
| 479 | http://blogs.vmware.com/guestosguide/2009/09/vmi-retirement.html | ||
| 480 | |||
| 481 | Who: Alok N Kataria <akataria@vmware.com> | ||
| 482 | |||
| 483 | ---------------------------- | ||
diff --git a/MAINTAINERS b/MAINTAINERS index ff968842ce56..6b057778477d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -4076,6 +4076,13 @@ M: Peter Zijlstra <a.p.zijlstra@chello.nl> | |||
| 4076 | M: Paul Mackerras <paulus@samba.org> | 4076 | M: Paul Mackerras <paulus@samba.org> |
| 4077 | M: Ingo Molnar <mingo@elte.hu> | 4077 | M: Ingo Molnar <mingo@elte.hu> |
| 4078 | S: Supported | 4078 | S: Supported |
| 4079 | F: kernel/perf_event.c | ||
| 4080 | F: include/linux/perf_event.h | ||
| 4081 | F: arch/*/*/kernel/perf_event.c | ||
| 4082 | F: arch/*/include/asm/perf_event.h | ||
| 4083 | F: arch/*/lib/perf_event.c | ||
| 4084 | F: arch/*/kernel/perf_callchain.c | ||
| 4085 | F: tools/perf/ | ||
| 4079 | 4086 | ||
| 4080 | PERSONALITY HANDLING | 4087 | PERSONALITY HANDLING |
| 4081 | M: Christoph Hellwig <hch@infradead.org> | 4088 | M: Christoph Hellwig <hch@infradead.org> |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 68d9223b145e..3eb84931d2aa 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
| @@ -121,7 +121,7 @@ noresched: | |||
| 121 | ENTRY(resume_userspace) | 121 | ENTRY(resume_userspace) |
| 122 | ! r8: current_thread_info | 122 | ! r8: current_thread_info |
| 123 | cli | 123 | cli |
| 124 | TRACE_IRQS_OfF | 124 | TRACE_IRQS_OFF |
| 125 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags | 125 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags |
| 126 | tst #(_TIF_WORK_MASK & 0xff), r0 | 126 | tst #(_TIF_WORK_MASK & 0xff), r0 |
| 127 | bt/s __restore_all | 127 | bt/s __restore_all |
diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c index a3dcc6d5d253..2c48e267256e 100644 --- a/arch/sh/kernel/ftrace.c +++ b/arch/sh/kernel/ftrace.c | |||
| @@ -291,31 +291,48 @@ struct syscall_metadata *syscall_nr_to_meta(int nr) | |||
| 291 | return syscalls_metadata[nr]; | 291 | return syscalls_metadata[nr]; |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | void arch_init_ftrace_syscalls(void) | 294 | int syscall_name_to_nr(char *name) |
| 295 | { | ||
| 296 | int i; | ||
| 297 | |||
| 298 | if (!syscalls_metadata) | ||
| 299 | return -1; | ||
| 300 | for (i = 0; i < NR_syscalls; i++) | ||
| 301 | if (syscalls_metadata[i]) | ||
| 302 | if (!strcmp(syscalls_metadata[i]->name, name)) | ||
| 303 | return i; | ||
| 304 | return -1; | ||
| 305 | } | ||
| 306 | |||
| 307 | void set_syscall_enter_id(int num, int id) | ||
| 308 | { | ||
| 309 | syscalls_metadata[num]->enter_id = id; | ||
| 310 | } | ||
| 311 | |||
| 312 | void set_syscall_exit_id(int num, int id) | ||
| 313 | { | ||
| 314 | syscalls_metadata[num]->exit_id = id; | ||
| 315 | } | ||
| 316 | |||
| 317 | static int __init arch_init_ftrace_syscalls(void) | ||
| 295 | { | 318 | { |
| 296 | int i; | 319 | int i; |
| 297 | struct syscall_metadata *meta; | 320 | struct syscall_metadata *meta; |
| 298 | unsigned long **psys_syscall_table = &sys_call_table; | 321 | unsigned long **psys_syscall_table = &sys_call_table; |
| 299 | static atomic_t refs; | ||
| 300 | |||
| 301 | if (atomic_inc_return(&refs) != 1) | ||
| 302 | goto end; | ||
| 303 | 322 | ||
| 304 | syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * | 323 | syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * |
| 305 | FTRACE_SYSCALL_MAX, GFP_KERNEL); | 324 | FTRACE_SYSCALL_MAX, GFP_KERNEL); |
| 306 | if (!syscalls_metadata) { | 325 | if (!syscalls_metadata) { |
| 307 | WARN_ON(1); | 326 | WARN_ON(1); |
| 308 | return; | 327 | return -ENOMEM; |
| 309 | } | 328 | } |
| 310 | 329 | ||
| 311 | for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { | 330 | for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { |
| 312 | meta = find_syscall_meta(psys_syscall_table[i]); | 331 | meta = find_syscall_meta(psys_syscall_table[i]); |
| 313 | syscalls_metadata[i] = meta; | 332 | syscalls_metadata[i] = meta; |
| 314 | } | 333 | } |
| 315 | return; | ||
| 316 | 334 | ||
| 317 | /* Paranoid: avoid overflow */ | 335 | return 0; |
| 318 | end: | ||
| 319 | atomic_dec(&refs); | ||
| 320 | } | 336 | } |
| 337 | arch_initcall(arch_init_ftrace_syscalls); | ||
| 321 | #endif /* CONFIG_FTRACE_SYSCALLS */ | 338 | #endif /* CONFIG_FTRACE_SYSCALLS */ |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index f9d44f8e0df6..99b4fb553bf1 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
| @@ -549,6 +549,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
| 549 | 549 | ||
| 550 | if (cpu == 0) | 550 | if (cpu == 0) |
| 551 | seq_printf(m, "machine\t\t: %s\n", get_system_type()); | 551 | seq_printf(m, "machine\t\t: %s\n", get_system_type()); |
| 552 | else | ||
| 553 | seq_printf(m, "\n"); | ||
| 552 | 554 | ||
| 553 | seq_printf(m, "processor\t: %d\n", cpu); | 555 | seq_printf(m, "processor\t: %d\n", cpu); |
| 554 | seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine); | 556 | seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine); |
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c index 6729703547a1..3db37425210d 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c | |||
| @@ -145,7 +145,7 @@ static inline int restore_sigcontext_fpu(struct sigcontext __user *sc) | |||
| 145 | { | 145 | { |
| 146 | struct task_struct *tsk = current; | 146 | struct task_struct *tsk = current; |
| 147 | 147 | ||
| 148 | if (!(current_cpu_data.flags & CPU_HAS_FPU)) | 148 | if (!(boot_cpu_data.flags & CPU_HAS_FPU)) |
| 149 | return 0; | 149 | return 0; |
| 150 | 150 | ||
| 151 | set_used_math(); | 151 | set_used_math(); |
| @@ -158,7 +158,7 @@ static inline int save_sigcontext_fpu(struct sigcontext __user *sc, | |||
| 158 | { | 158 | { |
| 159 | struct task_struct *tsk = current; | 159 | struct task_struct *tsk = current; |
| 160 | 160 | ||
| 161 | if (!(current_cpu_data.flags & CPU_HAS_FPU)) | 161 | if (!(boot_cpu_data.flags & CPU_HAS_FPU)) |
| 162 | return 0; | 162 | return 0; |
| 163 | 163 | ||
| 164 | if (!used_math()) { | 164 | if (!used_math()) { |
| @@ -199,7 +199,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p | |||
| 199 | #undef COPY | 199 | #undef COPY |
| 200 | 200 | ||
| 201 | #ifdef CONFIG_SH_FPU | 201 | #ifdef CONFIG_SH_FPU |
| 202 | if (current_cpu_data.flags & CPU_HAS_FPU) { | 202 | if (boot_cpu_data.flags & CPU_HAS_FPU) { |
| 203 | int owned_fp; | 203 | int owned_fp; |
| 204 | struct task_struct *tsk = current; | 204 | struct task_struct *tsk = current; |
| 205 | 205 | ||
| @@ -472,6 +472,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 472 | err |= __put_user(OR_R0_R0, &frame->retcode[6]); | 472 | err |= __put_user(OR_R0_R0, &frame->retcode[6]); |
| 473 | err |= __put_user((__NR_rt_sigreturn), &frame->retcode[7]); | 473 | err |= __put_user((__NR_rt_sigreturn), &frame->retcode[7]); |
| 474 | regs->pr = (unsigned long) frame->retcode; | 474 | regs->pr = (unsigned long) frame->retcode; |
| 475 | flush_icache_range(regs->pr, regs->pr + sizeof(frame->retcode)); | ||
| 475 | } | 476 | } |
| 476 | 477 | ||
| 477 | if (err) | 478 | if (err) |
| @@ -497,8 +498,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 497 | pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", | 498 | pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", |
| 498 | current->comm, task_pid_nr(current), frame, regs->pc, regs->pr); | 499 | current->comm, task_pid_nr(current), frame, regs->pc, regs->pr); |
| 499 | 500 | ||
| 500 | flush_icache_range(regs->pr, regs->pr + sizeof(frame->retcode)); | ||
| 501 | |||
| 502 | return 0; | 501 | return 0; |
| 503 | 502 | ||
| 504 | give_sigsegv: | 503 | give_sigsegv: |
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index 442d8d47a41e..160db1003cfb 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c | |||
| @@ -35,6 +35,8 @@ static inline void __init smp_store_cpu_info(unsigned int cpu) | |||
| 35 | { | 35 | { |
| 36 | struct sh_cpuinfo *c = cpu_data + cpu; | 36 | struct sh_cpuinfo *c = cpu_data + cpu; |
| 37 | 37 | ||
| 38 | memcpy(c, &boot_cpu_data, sizeof(struct sh_cpuinfo)); | ||
| 39 | |||
| 38 | c->loops_per_jiffy = loops_per_jiffy; | 40 | c->loops_per_jiffy = loops_per_jiffy; |
| 39 | } | 41 | } |
| 40 | 42 | ||
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index e0b5e4b5accd..7a2ee3a6b8e7 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/kexec.h> | 25 | #include <linux/kexec.h> |
| 26 | #include <linux/limits.h> | 26 | #include <linux/limits.h> |
| 27 | #include <linux/proc_fs.h> | 27 | #include <linux/proc_fs.h> |
| 28 | #include <linux/sysfs.h> | ||
| 28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
| 29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
| 30 | #include <asm/fpu.h> | 31 | #include <asm/fpu.h> |
| @@ -159,12 +160,12 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
| 159 | 160 | ||
| 160 | oops_enter(); | 161 | oops_enter(); |
| 161 | 162 | ||
| 162 | console_verbose(); | ||
| 163 | spin_lock_irq(&die_lock); | 163 | spin_lock_irq(&die_lock); |
| 164 | console_verbose(); | ||
| 164 | bust_spinlocks(1); | 165 | bust_spinlocks(1); |
| 165 | 166 | ||
| 166 | printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | 167 | printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); |
| 167 | 168 | sysfs_printk_last_file(); | |
| 168 | print_modules(); | 169 | print_modules(); |
| 169 | show_regs(regs); | 170 | show_regs(regs); |
| 170 | 171 | ||
| @@ -180,6 +181,7 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
| 180 | bust_spinlocks(0); | 181 | bust_spinlocks(0); |
| 181 | add_taint(TAINT_DIE); | 182 | add_taint(TAINT_DIE); |
| 182 | spin_unlock_irq(&die_lock); | 183 | spin_unlock_irq(&die_lock); |
| 184 | oops_exit(); | ||
| 183 | 185 | ||
| 184 | if (kexec_should_crash(current)) | 186 | if (kexec_should_crash(current)) |
| 185 | crash_kexec(regs); | 187 | crash_kexec(regs); |
| @@ -190,7 +192,6 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
| 190 | if (panic_on_oops) | 192 | if (panic_on_oops) |
| 191 | panic("Fatal exception"); | 193 | panic("Fatal exception"); |
| 192 | 194 | ||
| 193 | oops_exit(); | ||
| 194 | do_exit(SIGSEGV); | 195 | do_exit(SIGSEGV); |
| 195 | } | 196 | } |
| 196 | 197 | ||
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index 35c37b7f717a..5e1091be9dc4 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c | |||
| @@ -128,7 +128,7 @@ void __update_cache(struct vm_area_struct *vma, | |||
| 128 | return; | 128 | return; |
| 129 | 129 | ||
| 130 | page = pfn_to_page(pfn); | 130 | page = pfn_to_page(pfn); |
| 131 | if (pfn_valid(pfn) && page_mapping(page)) { | 131 | if (pfn_valid(pfn)) { |
| 132 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); | 132 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); |
| 133 | if (dirty) { | 133 | if (dirty) { |
| 134 | unsigned long addr = (unsigned long)page_address(page); | 134 | unsigned long addr = (unsigned long)page_address(page); |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c876bace8fdc..07e01149e3bf 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -491,7 +491,7 @@ if PARAVIRT_GUEST | |||
| 491 | source "arch/x86/xen/Kconfig" | 491 | source "arch/x86/xen/Kconfig" |
| 492 | 492 | ||
| 493 | config VMI | 493 | config VMI |
| 494 | bool "VMI Guest support" | 494 | bool "VMI Guest support (DEPRECATED)" |
| 495 | select PARAVIRT | 495 | select PARAVIRT |
| 496 | depends on X86_32 | 496 | depends on X86_32 |
| 497 | ---help--- | 497 | ---help--- |
| @@ -500,6 +500,15 @@ config VMI | |||
| 500 | at the moment), by linking the kernel to a GPL-ed ROM module | 500 | at the moment), by linking the kernel to a GPL-ed ROM module |
| 501 | provided by the hypervisor. | 501 | provided by the hypervisor. |
| 502 | 502 | ||
| 503 | As of September 2009, VMware has started a phased retirement | ||
| 504 | of this feature from VMware's products. Please see | ||
| 505 | feature-removal-schedule.txt for details. If you are | ||
| 506 | planning to enable this option, please note that you cannot | ||
| 507 | live migrate a VMI enabled VM to a future VMware product, | ||
| 508 | which doesn't support VMI. So if you expect your kernel to | ||
| 509 | seamlessly migrate to newer VMware products, keep this | ||
| 510 | disabled. | ||
| 511 | |||
| 503 | config KVM_CLOCK | 512 | config KVM_CLOCK |
| 504 | bool "KVM paravirtualized clock" | 513 | bool "KVM paravirtualized clock" |
| 505 | select PARAVIRT | 514 | select PARAVIRT |
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 8aebcc41041d..efb38994859c 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
| @@ -840,42 +840,22 @@ static __always_inline void __raw_spin_unlock(struct raw_spinlock *lock) | |||
| 840 | 840 | ||
| 841 | static inline unsigned long __raw_local_save_flags(void) | 841 | static inline unsigned long __raw_local_save_flags(void) |
| 842 | { | 842 | { |
| 843 | unsigned long f; | 843 | return PVOP_CALLEE0(unsigned long, pv_irq_ops.save_fl); |
| 844 | |||
| 845 | asm volatile(paravirt_alt(PARAVIRT_CALL) | ||
| 846 | : "=a"(f) | ||
| 847 | : paravirt_type(pv_irq_ops.save_fl), | ||
| 848 | paravirt_clobber(CLBR_EAX) | ||
| 849 | : "memory", "cc"); | ||
| 850 | return f; | ||
| 851 | } | 844 | } |
| 852 | 845 | ||
| 853 | static inline void raw_local_irq_restore(unsigned long f) | 846 | static inline void raw_local_irq_restore(unsigned long f) |
| 854 | { | 847 | { |
| 855 | asm volatile(paravirt_alt(PARAVIRT_CALL) | 848 | PVOP_VCALLEE1(pv_irq_ops.restore_fl, f); |
| 856 | : "=a"(f) | ||
| 857 | : PV_FLAGS_ARG(f), | ||
| 858 | paravirt_type(pv_irq_ops.restore_fl), | ||
| 859 | paravirt_clobber(CLBR_EAX) | ||
| 860 | : "memory", "cc"); | ||
| 861 | } | 849 | } |
| 862 | 850 | ||
| 863 | static inline void raw_local_irq_disable(void) | 851 | static inline void raw_local_irq_disable(void) |
| 864 | { | 852 | { |
| 865 | asm volatile(paravirt_alt(PARAVIRT_CALL) | 853 | PVOP_VCALLEE0(pv_irq_ops.irq_disable); |
| 866 | : | ||
| 867 | : paravirt_type(pv_irq_ops.irq_disable), | ||
| 868 | paravirt_clobber(CLBR_EAX) | ||
| 869 | : "memory", "eax", "cc"); | ||
| 870 | } | 854 | } |
| 871 | 855 | ||
| 872 | static inline void raw_local_irq_enable(void) | 856 | static inline void raw_local_irq_enable(void) |
| 873 | { | 857 | { |
| 874 | asm volatile(paravirt_alt(PARAVIRT_CALL) | 858 | PVOP_VCALLEE0(pv_irq_ops.irq_enable); |
| 875 | : | ||
| 876 | : paravirt_type(pv_irq_ops.irq_enable), | ||
| 877 | paravirt_clobber(CLBR_EAX) | ||
| 878 | : "memory", "eax", "cc"); | ||
| 879 | } | 859 | } |
| 880 | 860 | ||
| 881 | static inline unsigned long __raw_local_irq_save(void) | 861 | static inline unsigned long __raw_local_irq_save(void) |
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index dd0f5b32489d..9357473c8da0 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h | |||
| @@ -494,10 +494,11 @@ int paravirt_disable_iospace(void); | |||
| 494 | #define EXTRA_CLOBBERS | 494 | #define EXTRA_CLOBBERS |
| 495 | #define VEXTRA_CLOBBERS | 495 | #define VEXTRA_CLOBBERS |
| 496 | #else /* CONFIG_X86_64 */ | 496 | #else /* CONFIG_X86_64 */ |
| 497 | /* [re]ax isn't an arg, but the return val */ | ||
| 497 | #define PVOP_VCALL_ARGS \ | 498 | #define PVOP_VCALL_ARGS \ |
| 498 | unsigned long __edi = __edi, __esi = __esi, \ | 499 | unsigned long __edi = __edi, __esi = __esi, \ |
| 499 | __edx = __edx, __ecx = __ecx | 500 | __edx = __edx, __ecx = __ecx, __eax = __eax |
| 500 | #define PVOP_CALL_ARGS PVOP_VCALL_ARGS, __eax | 501 | #define PVOP_CALL_ARGS PVOP_VCALL_ARGS |
| 501 | 502 | ||
| 502 | #define PVOP_CALL_ARG1(x) "D" ((unsigned long)(x)) | 503 | #define PVOP_CALL_ARG1(x) "D" ((unsigned long)(x)) |
| 503 | #define PVOP_CALL_ARG2(x) "S" ((unsigned long)(x)) | 504 | #define PVOP_CALL_ARG2(x) "S" ((unsigned long)(x)) |
| @@ -509,6 +510,7 @@ int paravirt_disable_iospace(void); | |||
| 509 | "=c" (__ecx) | 510 | "=c" (__ecx) |
| 510 | #define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS, "=a" (__eax) | 511 | #define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS, "=a" (__eax) |
| 511 | 512 | ||
| 513 | /* void functions are still allowed [re]ax for scratch */ | ||
| 512 | #define PVOP_VCALLEE_CLOBBERS "=a" (__eax) | 514 | #define PVOP_VCALLEE_CLOBBERS "=a" (__eax) |
| 513 | #define PVOP_CALLEE_CLOBBERS PVOP_VCALLEE_CLOBBERS | 515 | #define PVOP_CALLEE_CLOBBERS PVOP_VCALLEE_CLOBBERS |
| 514 | 516 | ||
| @@ -583,8 +585,8 @@ int paravirt_disable_iospace(void); | |||
| 583 | VEXTRA_CLOBBERS, \ | 585 | VEXTRA_CLOBBERS, \ |
| 584 | pre, post, ##__VA_ARGS__) | 586 | pre, post, ##__VA_ARGS__) |
| 585 | 587 | ||
| 586 | #define __PVOP_VCALLEESAVE(rettype, op, pre, post, ...) \ | 588 | #define __PVOP_VCALLEESAVE(op, pre, post, ...) \ |
| 587 | ____PVOP_CALL(rettype, op.func, CLBR_RET_REG, \ | 589 | ____PVOP_VCALL(op.func, CLBR_RET_REG, \ |
| 588 | PVOP_VCALLEE_CLOBBERS, , \ | 590 | PVOP_VCALLEE_CLOBBERS, , \ |
| 589 | pre, post, ##__VA_ARGS__) | 591 | pre, post, ##__VA_ARGS__) |
| 590 | 592 | ||
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 391206199515..74656d1d4e30 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
| @@ -244,7 +244,6 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs) | |||
| 244 | __func__, smp_processor_id(), vector, irq); | 244 | __func__, smp_processor_id(), vector, irq); |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | run_local_timers(); | ||
| 248 | irq_exit(); | 247 | irq_exit(); |
| 249 | 248 | ||
| 250 | set_irq_regs(old_regs); | 249 | set_irq_regs(old_regs); |
| @@ -269,7 +268,6 @@ void smp_generic_interrupt(struct pt_regs *regs) | |||
| 269 | if (generic_interrupt_extension) | 268 | if (generic_interrupt_extension) |
| 270 | generic_interrupt_extension(); | 269 | generic_interrupt_extension(); |
| 271 | 270 | ||
| 272 | run_local_timers(); | ||
| 273 | irq_exit(); | 271 | irq_exit(); |
| 274 | 272 | ||
| 275 | set_irq_regs(old_regs); | 273 | set_irq_regs(old_regs); |
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index d915d956e66d..ec1de97600e7 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c | |||
| @@ -198,7 +198,6 @@ void smp_reschedule_interrupt(struct pt_regs *regs) | |||
| 198 | { | 198 | { |
| 199 | ack_APIC_irq(); | 199 | ack_APIC_irq(); |
| 200 | inc_irq_stat(irq_resched_count); | 200 | inc_irq_stat(irq_resched_count); |
| 201 | run_local_timers(); | ||
| 202 | /* | 201 | /* |
| 203 | * KVM uses this interrupt to force a cpu out of guest mode | 202 | * KVM uses this interrupt to force a cpu out of guest mode |
| 204 | */ | 203 | */ |
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c index dcb00d278512..be2573448ed9 100644 --- a/arch/x86/kernel/time.c +++ b/arch/x86/kernel/time.c | |||
| @@ -38,7 +38,8 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
| 38 | #ifdef CONFIG_FRAME_POINTER | 38 | #ifdef CONFIG_FRAME_POINTER |
| 39 | return *(unsigned long *)(regs->bp + sizeof(long)); | 39 | return *(unsigned long *)(regs->bp + sizeof(long)); |
| 40 | #else | 40 | #else |
| 41 | unsigned long *sp = (unsigned long *)regs->sp; | 41 | unsigned long *sp = |
| 42 | (unsigned long *)kernel_stack_pointer(regs); | ||
| 42 | /* | 43 | /* |
| 43 | * Return address is either directly at stack pointer | 44 | * Return address is either directly at stack pointer |
| 44 | * or above a saved flags. Eflags has bits 22-31 zero, | 45 | * or above a saved flags. Eflags has bits 22-31 zero, |
diff --git a/arch/x86/kernel/trampoline.c b/arch/x86/kernel/trampoline.c index 699f7eeb896a..cd022121cab6 100644 --- a/arch/x86/kernel/trampoline.c +++ b/arch/x86/kernel/trampoline.c | |||
| @@ -3,8 +3,16 @@ | |||
| 3 | #include <asm/trampoline.h> | 3 | #include <asm/trampoline.h> |
| 4 | #include <asm/e820.h> | 4 | #include <asm/e820.h> |
| 5 | 5 | ||
| 6 | #if defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP) | ||
| 7 | #define __trampinit | ||
| 8 | #define __trampinitdata | ||
| 9 | #else | ||
| 10 | #define __trampinit __cpuinit | ||
| 11 | #define __trampinitdata __cpuinitdata | ||
| 12 | #endif | ||
| 13 | |||
| 6 | /* ready for x86_64 and x86 */ | 14 | /* ready for x86_64 and x86 */ |
| 7 | unsigned char *__cpuinitdata trampoline_base = __va(TRAMPOLINE_BASE); | 15 | unsigned char *__trampinitdata trampoline_base = __va(TRAMPOLINE_BASE); |
| 8 | 16 | ||
| 9 | void __init reserve_trampoline_memory(void) | 17 | void __init reserve_trampoline_memory(void) |
| 10 | { | 18 | { |
| @@ -26,7 +34,7 @@ void __init reserve_trampoline_memory(void) | |||
| 26 | * bootstrap into the page concerned. The caller | 34 | * bootstrap into the page concerned. The caller |
| 27 | * has made sure it's suitably aligned. | 35 | * has made sure it's suitably aligned. |
| 28 | */ | 36 | */ |
| 29 | unsigned long __cpuinit setup_trampoline(void) | 37 | unsigned long __trampinit setup_trampoline(void) |
| 30 | { | 38 | { |
| 31 | memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE); | 39 | memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE); |
| 32 | return virt_to_phys(trampoline_base); | 40 | return virt_to_phys(trampoline_base); |
diff --git a/arch/x86/kernel/trampoline_64.S b/arch/x86/kernel/trampoline_64.S index 596d54c660a5..3af2dff58b21 100644 --- a/arch/x86/kernel/trampoline_64.S +++ b/arch/x86/kernel/trampoline_64.S | |||
| @@ -32,8 +32,12 @@ | |||
| 32 | #include <asm/segment.h> | 32 | #include <asm/segment.h> |
| 33 | #include <asm/processor-flags.h> | 33 | #include <asm/processor-flags.h> |
| 34 | 34 | ||
| 35 | #ifdef CONFIG_ACPI_SLEEP | ||
| 36 | .section .rodata, "a", @progbits | ||
| 37 | #else | ||
| 35 | /* We can free up the trampoline after bootup if cpu hotplug is not supported. */ | 38 | /* We can free up the trampoline after bootup if cpu hotplug is not supported. */ |
| 36 | __CPUINITRODATA | 39 | __CPUINITRODATA |
| 40 | #endif | ||
| 37 | .code16 | 41 | .code16 |
| 38 | 42 | ||
| 39 | ENTRY(trampoline_data) | 43 | ENTRY(trampoline_data) |
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c index 31e6f6cfe53e..d430e4c30193 100644 --- a/arch/x86/kernel/vmi_32.c +++ b/arch/x86/kernel/vmi_32.c | |||
| @@ -648,7 +648,7 @@ static inline int __init activate_vmi(void) | |||
| 648 | 648 | ||
| 649 | pv_info.paravirt_enabled = 1; | 649 | pv_info.paravirt_enabled = 1; |
| 650 | pv_info.kernel_rpl = kernel_cs & SEGMENT_RPL_MASK; | 650 | pv_info.kernel_rpl = kernel_cs & SEGMENT_RPL_MASK; |
| 651 | pv_info.name = "vmi"; | 651 | pv_info.name = "vmi [deprecated]"; |
| 652 | 652 | ||
| 653 | pv_init_ops.patch = vmi_patch; | 653 | pv_init_ops.patch = vmi_patch; |
| 654 | 654 | ||
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c index 2b7ae366ceb1..5df60a6b6776 100644 --- a/drivers/oprofile/event_buffer.c +++ b/drivers/oprofile/event_buffer.c | |||
| @@ -35,12 +35,23 @@ static size_t buffer_pos; | |||
| 35 | /* atomic_t because wait_event checks it outside of buffer_mutex */ | 35 | /* atomic_t because wait_event checks it outside of buffer_mutex */ |
| 36 | static atomic_t buffer_ready = ATOMIC_INIT(0); | 36 | static atomic_t buffer_ready = ATOMIC_INIT(0); |
| 37 | 37 | ||
| 38 | /* Add an entry to the event buffer. When we | 38 | /* |
| 39 | * get near to the end we wake up the process | 39 | * Add an entry to the event buffer. When we get near to the end we |
| 40 | * sleeping on the read() of the file. | 40 | * wake up the process sleeping on the read() of the file. To protect |
| 41 | * the event_buffer this function may only be called when buffer_mutex | ||
| 42 | * is set. | ||
| 41 | */ | 43 | */ |
| 42 | void add_event_entry(unsigned long value) | 44 | void add_event_entry(unsigned long value) |
| 43 | { | 45 | { |
| 46 | /* | ||
| 47 | * This shouldn't happen since all workqueues or handlers are | ||
| 48 | * canceled or flushed before the event buffer is freed. | ||
| 49 | */ | ||
| 50 | if (!event_buffer) { | ||
| 51 | WARN_ON_ONCE(1); | ||
| 52 | return; | ||
| 53 | } | ||
| 54 | |||
| 44 | if (buffer_pos == buffer_size) { | 55 | if (buffer_pos == buffer_size) { |
| 45 | atomic_inc(&oprofile_stats.event_lost_overflow); | 56 | atomic_inc(&oprofile_stats.event_lost_overflow); |
| 46 | return; | 57 | return; |
| @@ -69,7 +80,6 @@ void wake_up_buffer_waiter(void) | |||
| 69 | 80 | ||
| 70 | int alloc_event_buffer(void) | 81 | int alloc_event_buffer(void) |
| 71 | { | 82 | { |
| 72 | int err = -ENOMEM; | ||
| 73 | unsigned long flags; | 83 | unsigned long flags; |
| 74 | 84 | ||
| 75 | spin_lock_irqsave(&oprofilefs_lock, flags); | 85 | spin_lock_irqsave(&oprofilefs_lock, flags); |
| @@ -80,21 +90,22 @@ int alloc_event_buffer(void) | |||
| 80 | if (buffer_watershed >= buffer_size) | 90 | if (buffer_watershed >= buffer_size) |
| 81 | return -EINVAL; | 91 | return -EINVAL; |
| 82 | 92 | ||
| 93 | buffer_pos = 0; | ||
| 83 | event_buffer = vmalloc(sizeof(unsigned long) * buffer_size); | 94 | event_buffer = vmalloc(sizeof(unsigned long) * buffer_size); |
| 84 | if (!event_buffer) | 95 | if (!event_buffer) |
| 85 | goto out; | 96 | return -ENOMEM; |
| 86 | 97 | ||
| 87 | err = 0; | 98 | return 0; |
| 88 | out: | ||
| 89 | return err; | ||
| 90 | } | 99 | } |
| 91 | 100 | ||
| 92 | 101 | ||
| 93 | void free_event_buffer(void) | 102 | void free_event_buffer(void) |
| 94 | { | 103 | { |
| 104 | mutex_lock(&buffer_mutex); | ||
| 95 | vfree(event_buffer); | 105 | vfree(event_buffer); |
| 96 | 106 | buffer_pos = 0; | |
| 97 | event_buffer = NULL; | 107 | event_buffer = NULL; |
| 108 | mutex_unlock(&buffer_mutex); | ||
| 98 | } | 109 | } |
| 99 | 110 | ||
| 100 | 111 | ||
| @@ -167,6 +178,12 @@ static ssize_t event_buffer_read(struct file *file, char __user *buf, | |||
| 167 | 178 | ||
| 168 | mutex_lock(&buffer_mutex); | 179 | mutex_lock(&buffer_mutex); |
| 169 | 180 | ||
| 181 | /* May happen if the buffer is freed during pending reads. */ | ||
| 182 | if (!event_buffer) { | ||
| 183 | retval = -EINTR; | ||
| 184 | goto out; | ||
| 185 | } | ||
| 186 | |||
| 170 | atomic_set(&buffer_ready, 0); | 187 | atomic_set(&buffer_ready, 0); |
| 171 | 188 | ||
| 172 | retval = -EFAULT; | 189 | retval = -EFAULT; |
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 3815ac1d58b2..9af56723c096 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
| @@ -142,6 +142,11 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock) | |||
| 142 | #ifdef CONFIG_LOCK_STAT | 142 | #ifdef CONFIG_LOCK_STAT |
| 143 | static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], lock_stats); | 143 | static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], lock_stats); |
| 144 | 144 | ||
| 145 | static inline u64 lockstat_clock(void) | ||
| 146 | { | ||
| 147 | return cpu_clock(smp_processor_id()); | ||
| 148 | } | ||
| 149 | |||
| 145 | static int lock_point(unsigned long points[], unsigned long ip) | 150 | static int lock_point(unsigned long points[], unsigned long ip) |
| 146 | { | 151 | { |
| 147 | int i; | 152 | int i; |
| @@ -158,7 +163,7 @@ static int lock_point(unsigned long points[], unsigned long ip) | |||
| 158 | return i; | 163 | return i; |
| 159 | } | 164 | } |
| 160 | 165 | ||
| 161 | static void lock_time_inc(struct lock_time *lt, s64 time) | 166 | static void lock_time_inc(struct lock_time *lt, u64 time) |
| 162 | { | 167 | { |
| 163 | if (time > lt->max) | 168 | if (time > lt->max) |
| 164 | lt->max = time; | 169 | lt->max = time; |
| @@ -234,12 +239,12 @@ static void put_lock_stats(struct lock_class_stats *stats) | |||
| 234 | static void lock_release_holdtime(struct held_lock *hlock) | 239 | static void lock_release_holdtime(struct held_lock *hlock) |
| 235 | { | 240 | { |
| 236 | struct lock_class_stats *stats; | 241 | struct lock_class_stats *stats; |
| 237 | s64 holdtime; | 242 | u64 holdtime; |
| 238 | 243 | ||
| 239 | if (!lock_stat) | 244 | if (!lock_stat) |
| 240 | return; | 245 | return; |
| 241 | 246 | ||
| 242 | holdtime = sched_clock() - hlock->holdtime_stamp; | 247 | holdtime = lockstat_clock() - hlock->holdtime_stamp; |
| 243 | 248 | ||
| 244 | stats = get_lock_stats(hlock_class(hlock)); | 249 | stats = get_lock_stats(hlock_class(hlock)); |
| 245 | if (hlock->read) | 250 | if (hlock->read) |
| @@ -2792,7 +2797,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
| 2792 | hlock->references = references; | 2797 | hlock->references = references; |
| 2793 | #ifdef CONFIG_LOCK_STAT | 2798 | #ifdef CONFIG_LOCK_STAT |
| 2794 | hlock->waittime_stamp = 0; | 2799 | hlock->waittime_stamp = 0; |
| 2795 | hlock->holdtime_stamp = sched_clock(); | 2800 | hlock->holdtime_stamp = lockstat_clock(); |
| 2796 | #endif | 2801 | #endif |
| 2797 | 2802 | ||
| 2798 | if (check == 2 && !mark_irqflags(curr, hlock)) | 2803 | if (check == 2 && !mark_irqflags(curr, hlock)) |
| @@ -3322,7 +3327,7 @@ found_it: | |||
| 3322 | if (hlock->instance != lock) | 3327 | if (hlock->instance != lock) |
| 3323 | return; | 3328 | return; |
| 3324 | 3329 | ||
| 3325 | hlock->waittime_stamp = sched_clock(); | 3330 | hlock->waittime_stamp = lockstat_clock(); |
| 3326 | 3331 | ||
| 3327 | contention_point = lock_point(hlock_class(hlock)->contention_point, ip); | 3332 | contention_point = lock_point(hlock_class(hlock)->contention_point, ip); |
| 3328 | contending_point = lock_point(hlock_class(hlock)->contending_point, | 3333 | contending_point = lock_point(hlock_class(hlock)->contending_point, |
| @@ -3345,8 +3350,7 @@ __lock_acquired(struct lockdep_map *lock, unsigned long ip) | |||
| 3345 | struct held_lock *hlock, *prev_hlock; | 3350 | struct held_lock *hlock, *prev_hlock; |
| 3346 | struct lock_class_stats *stats; | 3351 | struct lock_class_stats *stats; |
| 3347 | unsigned int depth; | 3352 | unsigned int depth; |
| 3348 | u64 now; | 3353 | u64 now, waittime = 0; |
| 3349 | s64 waittime = 0; | ||
| 3350 | int i, cpu; | 3354 | int i, cpu; |
| 3351 | 3355 | ||
| 3352 | depth = curr->lockdep_depth; | 3356 | depth = curr->lockdep_depth; |
| @@ -3374,7 +3378,7 @@ found_it: | |||
| 3374 | 3378 | ||
| 3375 | cpu = smp_processor_id(); | 3379 | cpu = smp_processor_id(); |
| 3376 | if (hlock->waittime_stamp) { | 3380 | if (hlock->waittime_stamp) { |
| 3377 | now = sched_clock(); | 3381 | now = lockstat_clock(); |
| 3378 | waittime = now - hlock->waittime_stamp; | 3382 | waittime = now - hlock->waittime_stamp; |
| 3379 | hlock->holdtime_stamp = now; | 3383 | hlock->holdtime_stamp = now; |
| 3380 | } | 3384 | } |
diff --git a/kernel/sched.c b/kernel/sched.c index 8d25be06db62..e88689522e66 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -676,6 +676,7 @@ inline void update_rq_clock(struct rq *rq) | |||
| 676 | 676 | ||
| 677 | /** | 677 | /** |
| 678 | * runqueue_is_locked | 678 | * runqueue_is_locked |
| 679 | * @cpu: the processor in question. | ||
| 679 | * | 680 | * |
| 680 | * Returns true if the current cpu runqueue is locked. | 681 | * Returns true if the current cpu runqueue is locked. |
| 681 | * This interface allows printk to be called with the runqueue lock | 682 | * This interface allows printk to be called with the runqueue lock |
| @@ -2311,7 +2312,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, | |||
| 2311 | { | 2312 | { |
| 2312 | int cpu, orig_cpu, this_cpu, success = 0; | 2313 | int cpu, orig_cpu, this_cpu, success = 0; |
| 2313 | unsigned long flags; | 2314 | unsigned long flags; |
| 2314 | struct rq *rq; | 2315 | struct rq *rq, *orig_rq; |
| 2315 | 2316 | ||
| 2316 | if (!sched_feat(SYNC_WAKEUPS)) | 2317 | if (!sched_feat(SYNC_WAKEUPS)) |
| 2317 | wake_flags &= ~WF_SYNC; | 2318 | wake_flags &= ~WF_SYNC; |
| @@ -2319,7 +2320,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, | |||
| 2319 | this_cpu = get_cpu(); | 2320 | this_cpu = get_cpu(); |
| 2320 | 2321 | ||
| 2321 | smp_wmb(); | 2322 | smp_wmb(); |
| 2322 | rq = task_rq_lock(p, &flags); | 2323 | rq = orig_rq = task_rq_lock(p, &flags); |
| 2323 | update_rq_clock(rq); | 2324 | update_rq_clock(rq); |
| 2324 | if (!(p->state & state)) | 2325 | if (!(p->state & state)) |
| 2325 | goto out; | 2326 | goto out; |
| @@ -2350,6 +2351,10 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, | |||
| 2350 | set_task_cpu(p, cpu); | 2351 | set_task_cpu(p, cpu); |
| 2351 | 2352 | ||
| 2352 | rq = task_rq_lock(p, &flags); | 2353 | rq = task_rq_lock(p, &flags); |
| 2354 | |||
| 2355 | if (rq != orig_rq) | ||
| 2356 | update_rq_clock(rq); | ||
| 2357 | |||
| 2353 | WARN_ON(p->state != TASK_WAKING); | 2358 | WARN_ON(p->state != TASK_WAKING); |
| 2354 | cpu = task_cpu(p); | 2359 | cpu = task_cpu(p); |
| 2355 | 2360 | ||
| @@ -3656,6 +3661,7 @@ static void update_group_power(struct sched_domain *sd, int cpu) | |||
| 3656 | 3661 | ||
| 3657 | /** | 3662 | /** |
| 3658 | * update_sg_lb_stats - Update sched_group's statistics for load balancing. | 3663 | * update_sg_lb_stats - Update sched_group's statistics for load balancing. |
| 3664 | * @sd: The sched_domain whose statistics are to be updated. | ||
| 3659 | * @group: sched_group whose statistics are to be updated. | 3665 | * @group: sched_group whose statistics are to be updated. |
| 3660 | * @this_cpu: Cpu for which load balance is currently performed. | 3666 | * @this_cpu: Cpu for which load balance is currently performed. |
| 3661 | * @idle: Idle status of this_cpu | 3667 | * @idle: Idle status of this_cpu |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 45068269ebb1..c820b0310a12 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -1393,7 +1393,7 @@ int trace_array_vprintk(struct trace_array *tr, | |||
| 1393 | 1393 | ||
| 1394 | int trace_vprintk(unsigned long ip, const char *fmt, va_list args) | 1394 | int trace_vprintk(unsigned long ip, const char *fmt, va_list args) |
| 1395 | { | 1395 | { |
| 1396 | return trace_array_printk(&global_trace, ip, fmt, args); | 1396 | return trace_array_vprintk(&global_trace, ip, fmt, args); |
| 1397 | } | 1397 | } |
| 1398 | EXPORT_SYMBOL_GPL(trace_vprintk); | 1398 | EXPORT_SYMBOL_GPL(trace_vprintk); |
| 1399 | 1399 | ||
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 23245785927f..98a6cc5c64ed 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
| @@ -933,8 +933,9 @@ static void postfix_clear(struct filter_parse_state *ps) | |||
| 933 | 933 | ||
| 934 | while (!list_empty(&ps->postfix)) { | 934 | while (!list_empty(&ps->postfix)) { |
| 935 | elt = list_first_entry(&ps->postfix, struct postfix_elt, list); | 935 | elt = list_first_entry(&ps->postfix, struct postfix_elt, list); |
| 936 | kfree(elt->operand); | ||
| 937 | list_del(&elt->list); | 936 | list_del(&elt->list); |
| 937 | kfree(elt->operand); | ||
| 938 | kfree(elt); | ||
| 938 | } | 939 | } |
| 939 | } | 940 | } |
| 940 | 941 | ||
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 5881943f0c34..742a32eee8fc 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -157,11 +157,18 @@ uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') | |||
| 157 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') | 157 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') |
| 158 | uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') | 158 | uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') |
| 159 | 159 | ||
| 160 | # If we're on a 64-bit kernel, use -m64 | 160 | # |
| 161 | ifndef NO_64BIT | 161 | # Add -m32 for cross-builds: |
| 162 | ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M)) | 162 | # |
| 163 | M64 := -m64 | 163 | ifdef NO_64BIT |
| 164 | endif | 164 | MBITS := -m32 |
| 165 | else | ||
| 166 | # | ||
| 167 | # If we're on a 64-bit kernel, use -m64: | ||
| 168 | # | ||
| 169 | ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M)) | ||
| 170 | MBITS := -m64 | ||
| 171 | endif | ||
| 165 | endif | 172 | endif |
| 166 | 173 | ||
| 167 | # CFLAGS and LDFLAGS are for the users to override from the command line. | 174 | # CFLAGS and LDFLAGS are for the users to override from the command line. |
| @@ -194,7 +201,7 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition | |||
| 194 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes | 201 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes |
| 195 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement | 202 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement |
| 196 | 203 | ||
| 197 | CFLAGS = $(M64) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) | 204 | CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) |
| 198 | LDFLAGS = -lpthread -lrt -lelf -lm | 205 | LDFLAGS = -lpthread -lrt -lelf -lm |
| 199 | ALL_CFLAGS = $(CFLAGS) | 206 | ALL_CFLAGS = $(CFLAGS) |
| 200 | ALL_LDFLAGS = $(LDFLAGS) | 207 | ALL_LDFLAGS = $(LDFLAGS) |
| @@ -416,7 +423,7 @@ ifeq ($(uname_S),Darwin) | |||
| 416 | endif | 423 | endif |
| 417 | 424 | ||
| 418 | ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) | 425 | ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) |
| 419 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); | 426 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); |
| 420 | endif | 427 | endif |
| 421 | 428 | ||
| 422 | ifdef NO_DEMANGLE | 429 | ifdef NO_DEMANGLE |
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index ea9c15c0cdfe..ce2d5be4f30e 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
| @@ -1287,7 +1287,7 @@ static struct sort_dimension *available_sorts[] = { | |||
| 1287 | 1287 | ||
| 1288 | static LIST_HEAD(sort_list); | 1288 | static LIST_HEAD(sort_list); |
| 1289 | 1289 | ||
| 1290 | static int sort_dimension__add(char *tok, struct list_head *list) | 1290 | static int sort_dimension__add(const char *tok, struct list_head *list) |
| 1291 | { | 1291 | { |
| 1292 | int i; | 1292 | int i; |
| 1293 | 1293 | ||
| @@ -1917,7 +1917,7 @@ static void setup_sorting(void) | |||
| 1917 | 1917 | ||
| 1918 | free(str); | 1918 | free(str); |
| 1919 | 1919 | ||
| 1920 | sort_dimension__add((char *)"pid", &cmp_pid); | 1920 | sort_dimension__add("pid", &cmp_pid); |
| 1921 | } | 1921 | } |
| 1922 | 1922 | ||
| 1923 | static const char *record_args[] = { | 1923 | static const char *record_args[] = { |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 87c424de79ee..8cfb48cbbea0 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
| @@ -691,7 +691,10 @@ static void store_event_type(const char *orgname) | |||
| 691 | FILE *file; | 691 | FILE *file; |
| 692 | int id; | 692 | int id; |
| 693 | 693 | ||
| 694 | sprintf(filename, "/sys/kernel/debug/tracing/events/%s/id", orgname); | 694 | sprintf(filename, "%s/", debugfs_path); |
| 695 | strncat(filename, orgname, strlen(orgname)); | ||
| 696 | strcat(filename, "/id"); | ||
| 697 | |||
| 695 | c = strchr(filename, ':'); | 698 | c = strchr(filename, ':'); |
| 696 | if (c) | 699 | if (c) |
| 697 | *c = '/'; | 700 | *c = '/'; |
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 55b41b9e3834..55c9659a56e2 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
| @@ -618,7 +618,7 @@ static int test_type(enum event_type type, enum event_type expect) | |||
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | static int test_type_token(enum event_type type, char *token, | 620 | static int test_type_token(enum event_type type, char *token, |
| 621 | enum event_type expect, char *expect_tok) | 621 | enum event_type expect, const char *expect_tok) |
| 622 | { | 622 | { |
| 623 | if (type != expect) { | 623 | if (type != expect) { |
| 624 | die("Error: expected type %d but read %d", | 624 | die("Error: expected type %d but read %d", |
| @@ -650,7 +650,7 @@ static int read_expect_type(enum event_type expect, char **tok) | |||
| 650 | return __read_expect_type(expect, tok, 1); | 650 | return __read_expect_type(expect, tok, 1); |
| 651 | } | 651 | } |
| 652 | 652 | ||
| 653 | static int __read_expected(enum event_type expect, char *str, int newline_ok) | 653 | static int __read_expected(enum event_type expect, const char *str, int newline_ok) |
| 654 | { | 654 | { |
| 655 | enum event_type type; | 655 | enum event_type type; |
| 656 | char *token; | 656 | char *token; |
| @@ -668,12 +668,12 @@ static int __read_expected(enum event_type expect, char *str, int newline_ok) | |||
| 668 | return 0; | 668 | return 0; |
| 669 | } | 669 | } |
| 670 | 670 | ||
| 671 | static int read_expected(enum event_type expect, char *str) | 671 | static int read_expected(enum event_type expect, const char *str) |
| 672 | { | 672 | { |
| 673 | return __read_expected(expect, str, 1); | 673 | return __read_expected(expect, str, 1); |
| 674 | } | 674 | } |
| 675 | 675 | ||
| 676 | static int read_expected_item(enum event_type expect, char *str) | 676 | static int read_expected_item(enum event_type expect, const char *str) |
| 677 | { | 677 | { |
| 678 | return __read_expected(expect, str, 0); | 678 | return __read_expected(expect, str, 0); |
| 679 | } | 679 | } |
