diff options
39 files changed, 236 insertions, 128 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 89a47b5aff0..04e6c819b28 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 ff968842ce5..6b057778477 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/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c index 704dd396257..77df726180b 100644 --- a/arch/s390/hypfs/hypfs_diag.c +++ b/arch/s390/hypfs/hypfs_diag.c | |||
| @@ -438,7 +438,7 @@ static int diag204_probe(void) | |||
| 438 | } | 438 | } |
| 439 | if (diag204((unsigned long)SUBC_STIB6 | | 439 | if (diag204((unsigned long)SUBC_STIB6 | |
| 440 | (unsigned long)INFO_EXT, pages, buf) >= 0) { | 440 | (unsigned long)INFO_EXT, pages, buf) >= 0) { |
| 441 | diag204_store_sc = SUBC_STIB7; | 441 | diag204_store_sc = SUBC_STIB6; |
| 442 | diag204_info_type = INFO_EXT; | 442 | diag204_info_type = INFO_EXT; |
| 443 | goto out; | 443 | goto out; |
| 444 | } | 444 | } |
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 802c8ab247f..0729f36c2fe 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c | |||
| @@ -31,9 +31,9 @@ void __cpuinit print_cpu_info(void) | |||
| 31 | 31 | ||
| 32 | static int show_cpuinfo(struct seq_file *m, void *v) | 32 | static int show_cpuinfo(struct seq_file *m, void *v) |
| 33 | { | 33 | { |
| 34 | static const char *hwcap_str[9] = { | 34 | static const char *hwcap_str[10] = { |
| 35 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", | 35 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", |
| 36 | "edat", "etf3eh" | 36 | "edat", "etf3eh", "highgprs" |
| 37 | }; | 37 | }; |
| 38 | struct _lowcore *lc; | 38 | struct _lowcore *lc; |
| 39 | unsigned long n = (unsigned long) v - 1; | 39 | unsigned long n = (unsigned long) v - 1; |
| @@ -48,7 +48,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
| 48 | num_online_cpus(), loops_per_jiffy/(500000/HZ), | 48 | num_online_cpus(), loops_per_jiffy/(500000/HZ), |
| 49 | (loops_per_jiffy/(5000/HZ))%100); | 49 | (loops_per_jiffy/(5000/HZ))%100); |
| 50 | seq_puts(m, "features\t: "); | 50 | seq_puts(m, "features\t: "); |
| 51 | for (i = 0; i < 9; i++) | 51 | for (i = 0; i < 10; i++) |
| 52 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) | 52 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) |
| 53 | seq_printf(m, "%s ", hwcap_str[i]); | 53 | seq_printf(m, "%s ", hwcap_str[i]); |
| 54 | seq_puts(m, "\n"); | 54 | seq_puts(m, "\n"); |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 68d9223b145..3eb84931d2a 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 a3dcc6d5d25..2c48e267256 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 f9d44f8e0df..99b4fb553bf 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 6729703547a..3db37425210 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 442d8d47a41..160db1003cf 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 e0b5e4b5acc..7a2ee3a6b8e 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 35c37b7f717..5e1091be9dc 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/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index adf5f273868..cb3c72c45aa 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c | |||
| @@ -1242,13 +1242,13 @@ int ldc_bind(struct ldc_channel *lp, const char *name) | |||
| 1242 | snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name); | 1242 | snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name); |
| 1243 | 1243 | ||
| 1244 | err = request_irq(lp->cfg.rx_irq, ldc_rx, | 1244 | err = request_irq(lp->cfg.rx_irq, ldc_rx, |
| 1245 | IRQF_SAMPLE_RANDOM | IRQF_SHARED, | 1245 | IRQF_SAMPLE_RANDOM | IRQF_DISABLED | IRQF_SHARED, |
| 1246 | lp->rx_irq_name, lp); | 1246 | lp->rx_irq_name, lp); |
| 1247 | if (err) | 1247 | if (err) |
| 1248 | return err; | 1248 | return err; |
| 1249 | 1249 | ||
| 1250 | err = request_irq(lp->cfg.tx_irq, ldc_tx, | 1250 | err = request_irq(lp->cfg.tx_irq, ldc_tx, |
| 1251 | IRQF_SAMPLE_RANDOM | IRQF_SHARED, | 1251 | IRQF_SAMPLE_RANDOM | IRQF_DISABLED | IRQF_SHARED, |
| 1252 | lp->tx_irq_name, lp); | 1252 | lp->tx_irq_name, lp); |
| 1253 | if (err) { | 1253 | if (err) { |
| 1254 | free_irq(lp->cfg.rx_irq, lp); | 1254 | free_irq(lp->cfg.rx_irq, lp); |
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 04db9274389..fa5936e1c3b 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
| @@ -437,7 +437,7 @@ static const struct sparc_pmu niagara2_pmu = { | |||
| 437 | .lower_shift = 6, | 437 | .lower_shift = 6, |
| 438 | .event_mask = 0xfff, | 438 | .event_mask = 0xfff, |
| 439 | .hv_bit = 0x8, | 439 | .hv_bit = 0x8, |
| 440 | .irq_bit = 0x03, | 440 | .irq_bit = 0x30, |
| 441 | .upper_nop = 0x220, | 441 | .upper_nop = 0x220, |
| 442 | .lower_nop = 0x220, | 442 | .lower_nop = 0x220, |
| 443 | }; | 443 | }; |
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index a70a5e1904d..1886d37d411 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
| @@ -265,7 +265,7 @@ static void flush_dcache(unsigned long pfn) | |||
| 265 | struct page *page; | 265 | struct page *page; |
| 266 | 266 | ||
| 267 | page = pfn_to_page(pfn); | 267 | page = pfn_to_page(pfn); |
| 268 | if (page && page_mapping(page)) { | 268 | if (page) { |
| 269 | unsigned long pg_flags; | 269 | unsigned long pg_flags; |
| 270 | 270 | ||
| 271 | pg_flags = page->flags; | 271 | pg_flags = page->flags; |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c876bace8fd..07e01149e3b 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 8aebcc41041..efb38994859 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 dd0f5b32489..9357473c8da 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 39120619951..74656d1d4e3 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 d915d956e66..ec1de97600e 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 dcb00d27851..be2573448ed 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 699f7eeb896..cd022121cab 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 596d54c660a..3af2dff58b2 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 31e6f6cfe53..d430e4c3019 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 2b7ae366ceb..5df60a6b677 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/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 53b8c255360..aaccc8ecfa8 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
| @@ -2533,6 +2533,7 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, | |||
| 2533 | { | 2533 | { |
| 2534 | struct dasd_ccw_req *cqr; | 2534 | struct dasd_ccw_req *cqr; |
| 2535 | struct ccw1 *ccw; | 2535 | struct ccw1 *ccw; |
| 2536 | unsigned long *idaw; | ||
| 2536 | 2537 | ||
| 2537 | cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device); | 2538 | cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device); |
| 2538 | 2539 | ||
| @@ -2546,9 +2547,17 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, | |||
| 2546 | 2547 | ||
| 2547 | ccw = cqr->cpaddr; | 2548 | ccw = cqr->cpaddr; |
| 2548 | ccw->cmd_code = CCW_CMD_RDC; | 2549 | ccw->cmd_code = CCW_CMD_RDC; |
| 2549 | ccw->cda = (__u32)(addr_t)rdc_buffer; | 2550 | if (idal_is_needed(rdc_buffer, rdc_buffer_size)) { |
| 2550 | ccw->count = rdc_buffer_size; | 2551 | idaw = (unsigned long *) (cqr->data); |
| 2552 | ccw->cda = (__u32)(addr_t) idaw; | ||
| 2553 | ccw->flags = CCW_FLAG_IDA; | ||
| 2554 | idaw = idal_create_words(idaw, rdc_buffer, rdc_buffer_size); | ||
| 2555 | } else { | ||
| 2556 | ccw->cda = (__u32)(addr_t) rdc_buffer; | ||
| 2557 | ccw->flags = 0; | ||
| 2558 | } | ||
| 2551 | 2559 | ||
| 2560 | ccw->count = rdc_buffer_size; | ||
| 2552 | cqr->startdev = device; | 2561 | cqr->startdev = device; |
| 2553 | cqr->memdev = device; | 2562 | cqr->memdev = device; |
| 2554 | cqr->expires = 10*HZ; | 2563 | cqr->expires = 10*HZ; |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 0be7c15f45c..417b97cd3f9 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
| @@ -3216,6 +3216,7 @@ int dasd_eckd_restore_device(struct dasd_device *device) | |||
| 3216 | struct dasd_eckd_characteristics temp_rdc_data; | 3216 | struct dasd_eckd_characteristics temp_rdc_data; |
| 3217 | int is_known, rc; | 3217 | int is_known, rc; |
| 3218 | struct dasd_uid temp_uid; | 3218 | struct dasd_uid temp_uid; |
| 3219 | unsigned long flags; | ||
| 3219 | 3220 | ||
| 3220 | private = (struct dasd_eckd_private *) device->private; | 3221 | private = (struct dasd_eckd_private *) device->private; |
| 3221 | 3222 | ||
| @@ -3228,7 +3229,8 @@ int dasd_eckd_restore_device(struct dasd_device *device) | |||
| 3228 | rc = dasd_eckd_generate_uid(device, &private->uid); | 3229 | rc = dasd_eckd_generate_uid(device, &private->uid); |
| 3229 | dasd_get_uid(device->cdev, &temp_uid); | 3230 | dasd_get_uid(device->cdev, &temp_uid); |
| 3230 | if (memcmp(&private->uid, &temp_uid, sizeof(struct dasd_uid)) != 0) | 3231 | if (memcmp(&private->uid, &temp_uid, sizeof(struct dasd_uid)) != 0) |
| 3231 | dev_err(&device->cdev->dev, "The UID of the DASD has changed\n"); | 3232 | dev_err(&device->cdev->dev, "The UID of the DASD has " |
| 3233 | "changed\n"); | ||
| 3232 | if (rc) | 3234 | if (rc) |
| 3233 | goto out_err; | 3235 | goto out_err; |
| 3234 | dasd_set_uid(device->cdev, &private->uid); | 3236 | dasd_set_uid(device->cdev, &private->uid); |
| @@ -3256,9 +3258,9 @@ int dasd_eckd_restore_device(struct dasd_device *device) | |||
| 3256 | "device: %s", rc, dev_name(&device->cdev->dev)); | 3258 | "device: %s", rc, dev_name(&device->cdev->dev)); |
| 3257 | goto out_err; | 3259 | goto out_err; |
| 3258 | } | 3260 | } |
| 3259 | spin_lock(get_ccwdev_lock(device->cdev)); | 3261 | spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); |
| 3260 | memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data)); | 3262 | memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data)); |
| 3261 | spin_unlock(get_ccwdev_lock(device->cdev)); | 3263 | spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); |
| 3262 | 3264 | ||
| 3263 | /* add device to alias management */ | 3265 | /* add device to alias management */ |
| 3264 | dasd_alias_add_device(device); | 3266 | dasd_alias_add_device(device); |
diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c index daaec185ed3..a4f68e5b9c9 100644 --- a/drivers/s390/char/sclp_async.c +++ b/drivers/s390/char/sclp_async.c | |||
| @@ -62,7 +62,7 @@ static struct notifier_block call_home_panic_nb = { | |||
| 62 | .priority = INT_MAX, | 62 | .priority = INT_MAX, |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | static int proc_handler_callhome(ctl_table *ctl, int write, struct file *filp, | 65 | static int proc_handler_callhome(struct ctl_table *ctl, int write, |
| 66 | void __user *buffer, size_t *count, | 66 | void __user *buffer, size_t *count, |
| 67 | loff_t *ppos) | 67 | loff_t *ppos) |
| 68 | { | 68 | { |
| @@ -100,7 +100,7 @@ static struct ctl_table callhome_table[] = { | |||
| 100 | { | 100 | { |
| 101 | .procname = "callhome", | 101 | .procname = "callhome", |
| 102 | .mode = 0644, | 102 | .mode = 0644, |
| 103 | .proc_handler = &proc_handler_callhome, | 103 | .proc_handler = proc_handler_callhome, |
| 104 | }, | 104 | }, |
| 105 | { .ctl_name = 0 } | 105 | { .ctl_name = 0 } |
| 106 | }; | 106 | }; |
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index 178724f2a4c..b9d2a007e93 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c | |||
| @@ -705,21 +705,6 @@ out_driver: | |||
| 705 | } | 705 | } |
| 706 | __initcall(sclp_vt220_tty_init); | 706 | __initcall(sclp_vt220_tty_init); |
| 707 | 707 | ||
| 708 | #ifdef CONFIG_SCLP_VT220_CONSOLE | ||
| 709 | |||
| 710 | static void | ||
| 711 | sclp_vt220_con_write(struct console *con, const char *buf, unsigned int count) | ||
| 712 | { | ||
| 713 | __sclp_vt220_write((const unsigned char *) buf, count, 1, 1, 0); | ||
| 714 | } | ||
| 715 | |||
| 716 | static struct tty_driver * | ||
| 717 | sclp_vt220_con_device(struct console *c, int *index) | ||
| 718 | { | ||
| 719 | *index = 0; | ||
| 720 | return sclp_vt220_driver; | ||
| 721 | } | ||
| 722 | |||
| 723 | static void __sclp_vt220_flush_buffer(void) | 708 | static void __sclp_vt220_flush_buffer(void) |
| 724 | { | 709 | { |
| 725 | unsigned long flags; | 710 | unsigned long flags; |
| @@ -776,6 +761,21 @@ static void sclp_vt220_pm_event_fn(struct sclp_register *reg, | |||
| 776 | } | 761 | } |
| 777 | } | 762 | } |
| 778 | 763 | ||
| 764 | #ifdef CONFIG_SCLP_VT220_CONSOLE | ||
| 765 | |||
| 766 | static void | ||
| 767 | sclp_vt220_con_write(struct console *con, const char *buf, unsigned int count) | ||
| 768 | { | ||
| 769 | __sclp_vt220_write((const unsigned char *) buf, count, 1, 1, 0); | ||
| 770 | } | ||
| 771 | |||
| 772 | static struct tty_driver * | ||
| 773 | sclp_vt220_con_device(struct console *c, int *index) | ||
| 774 | { | ||
| 775 | *index = 0; | ||
| 776 | return sclp_vt220_driver; | ||
| 777 | } | ||
| 778 | |||
| 779 | static int | 779 | static int |
| 780 | sclp_vt220_notify(struct notifier_block *self, | 780 | sclp_vt220_notify(struct notifier_block *self, |
| 781 | unsigned long event, void *data) | 781 | unsigned long event, void *data) |
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index 64f57ef2763..0c0705b91c2 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
| @@ -162,9 +162,10 @@ tapeblock_requeue(struct work_struct *work) { | |||
| 162 | spin_lock_irq(&device->blk_data.request_queue_lock); | 162 | spin_lock_irq(&device->blk_data.request_queue_lock); |
| 163 | while ( | 163 | while ( |
| 164 | !blk_queue_plugged(queue) && | 164 | !blk_queue_plugged(queue) && |
| 165 | (req = blk_fetch_request(queue)) && | 165 | blk_peek_request(queue) && |
| 166 | nr_queued < TAPEBLOCK_MIN_REQUEUE | 166 | nr_queued < TAPEBLOCK_MIN_REQUEUE |
| 167 | ) { | 167 | ) { |
| 168 | req = blk_fetch_request(queue); | ||
| 168 | if (rq_data_dir(req) == WRITE) { | 169 | if (rq_data_dir(req) == WRITE) { |
| 169 | DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); | 170 | DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); |
| 170 | spin_unlock_irq(&device->blk_data.request_queue_lock); | 171 | spin_unlock_irq(&device->blk_data.request_queue_lock); |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 2ee093ec86e..2490b741e16 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
| @@ -1250,8 +1250,7 @@ static int io_subchannel_probe(struct subchannel *sch) | |||
| 1250 | unsigned long flags; | 1250 | unsigned long flags; |
| 1251 | struct ccw_dev_id dev_id; | 1251 | struct ccw_dev_id dev_id; |
| 1252 | 1252 | ||
| 1253 | cdev = sch_get_cdev(sch); | 1253 | if (cio_is_console(sch->schid)) { |
| 1254 | if (cdev) { | ||
| 1255 | rc = sysfs_create_group(&sch->dev.kobj, | 1254 | rc = sysfs_create_group(&sch->dev.kobj, |
| 1256 | &io_subchannel_attr_group); | 1255 | &io_subchannel_attr_group); |
| 1257 | if (rc) | 1256 | if (rc) |
| @@ -1260,13 +1259,13 @@ static int io_subchannel_probe(struct subchannel *sch) | |||
| 1260 | "0.%x.%04x (rc=%d)\n", | 1259 | "0.%x.%04x (rc=%d)\n", |
| 1261 | sch->schid.ssid, sch->schid.sch_no, rc); | 1260 | sch->schid.ssid, sch->schid.sch_no, rc); |
| 1262 | /* | 1261 | /* |
| 1263 | * This subchannel already has an associated ccw_device. | 1262 | * The console subchannel already has an associated ccw_device. |
| 1264 | * Throw the delayed uevent for the subchannel, register | 1263 | * Throw the delayed uevent for the subchannel, register |
| 1265 | * the ccw_device and exit. This happens for all early | 1264 | * the ccw_device and exit. |
| 1266 | * devices, e.g. the console. | ||
| 1267 | */ | 1265 | */ |
| 1268 | dev_set_uevent_suppress(&sch->dev, 0); | 1266 | dev_set_uevent_suppress(&sch->dev, 0); |
| 1269 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); | 1267 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); |
| 1268 | cdev = sch_get_cdev(sch); | ||
| 1270 | cdev->dev.groups = ccwdev_attr_groups; | 1269 | cdev->dev.groups = ccwdev_attr_groups; |
| 1271 | device_initialize(&cdev->dev); | 1270 | device_initialize(&cdev->dev); |
| 1272 | ccw_device_register(cdev); | 1271 | ccw_device_register(cdev); |
diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c index 1e8f02f440e..d3c824dc235 100644 --- a/drivers/watchdog/riowd.c +++ b/drivers/watchdog/riowd.c | |||
| @@ -206,7 +206,7 @@ static int __devinit riowd_probe(struct of_device *op, | |||
| 206 | 206 | ||
| 207 | dev_set_drvdata(&op->dev, p); | 207 | dev_set_drvdata(&op->dev, p); |
| 208 | riowd_device = p; | 208 | riowd_device = p; |
| 209 | err = 0; | 209 | return 0; |
| 210 | 210 | ||
| 211 | out_iounmap: | 211 | out_iounmap: |
| 212 | of_iounmap(&op->resource[0], p->regs, 2); | 212 | of_iounmap(&op->resource[0], p->regs, 2); |
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 3815ac1d58b..9af56723c09 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 8d25be06db6..e88689522e6 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 45068269ebb..c820b0310a1 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 23245785927..98a6cc5c64e 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 5881943f0c3..742a32eee8f 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 ea9c15c0cdf..ce2d5be4f30 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 87c424de79e..8cfb48cbbea 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 55b41b9e383..55c9659a56e 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 | } |
