Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276396
b: refs/heads/master
c: 69682b6
h: refs/heads/master
v: v3
  • Loading branch information
Mitsuo Hayasaka authored and Ingo Molnar committed Dec 5, 2011
1 parent 5311d60 commit 9c3022a
Show file tree
Hide file tree
Showing 47 changed files with 204 additions and 546 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 232ea344550c4a099d35d9df552509d6748a31c0
refs/heads/master: 69682b625a043b567873e6cda397969b502f0054
6 changes: 3 additions & 3 deletions trunk/arch/arm/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,15 @@ validate_group(struct perf_event *event)
fake_pmu.used_mask = fake_used_mask;

if (!validate_event(&fake_pmu, leader))
return -EINVAL;
return -ENOSPC;

list_for_each_entry(sibling, &leader->sibling_list, group_entry) {
if (!validate_event(&fake_pmu, sibling))
return -EINVAL;
return -ENOSPC;
}

if (!validate_event(&fake_pmu, event))
return -EINVAL;
return -ENOSPC;

return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/mips/kernel/perf_event_mipsxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ static int mipspmu_event_init(struct perf_event *event)
if (!atomic_inc_not_zero(&active_events)) {
if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) {
atomic_dec(&active_events);
return -EINVAL;
return -ENOSPC;
}

mutex_lock(&pmu_reserve_mutex);
Expand Down Expand Up @@ -732,15 +732,15 @@ static int validate_group(struct perf_event *event)
memset(&fake_cpuc, 0, sizeof(fake_cpuc));

if (!validate_event(&fake_cpuc, leader))
return -EINVAL;
return -ENOSPC;

list_for_each_entry(sibling, &leader->sibling_list, group_entry) {
if (!validate_event(&fake_cpuc, sibling))
return -EINVAL;
return -ENOSPC;
}

if (!validate_event(&fake_cpuc, event))
return -EINVAL;
return -ENOSPC;

return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/s390/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,10 @@ static inline pgste_t pgste_update_all(pte_t *ptep, pgste_t pgste)
skey = page_get_storage_key(address);
bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED);
/* Clear page changed & referenced bit in the storage key */
if (bits & _PAGE_CHANGED)
page_set_storage_key(address, skey ^ bits, 1);
else if (bits)
page_reset_referenced(address);
if (bits) {
skey ^= bits;
page_set_storage_key(address, skey, 1);
}
/* Transfer page changed & referenced bit to guest bits in pgste */
pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */
/* Get host changed & referenced bits from pgste */
Expand Down
30 changes: 12 additions & 18 deletions trunk/arch/s390/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
((data & PSW_MASK_EA) && !(data & PSW_MASK_BA))))
/* Invalid psw mask. */
return -EINVAL;
if (addr == (addr_t) &dummy->regs.psw.addr)
/*
* The debugger changed the instruction address,
* reset system call restart, see signal.c:do_signal
*/
task_thread_info(child)->system_call = 0;

*(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;

} else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
Expand Down Expand Up @@ -607,6 +614,11 @@ static int __poke_user_compat(struct task_struct *child,
/* Transfer 31 bit amode bit to psw mask. */
regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) |
(__u64)(tmp & PSW32_ADDR_AMODE);
/*
* The debugger changed the instruction address,
* reset system call restart, see signal.c:do_signal
*/
task_thread_info(child)->system_call = 0;
} else {
/* gpr 0-15 */
*(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;
Expand Down Expand Up @@ -893,14 +905,6 @@ static int s390_last_break_get(struct task_struct *target,
return 0;
}

static int s390_last_break_set(struct task_struct *target,
const struct user_regset *regset,
unsigned int pos, unsigned int count,
const void *kbuf, const void __user *ubuf)
{
return 0;
}

#endif

static int s390_system_call_get(struct task_struct *target,
Expand Down Expand Up @@ -947,7 +951,6 @@ static const struct user_regset s390_regsets[] = {
.size = sizeof(long),
.align = sizeof(long),
.get = s390_last_break_get,
.set = s390_last_break_set,
},
#endif
[REGSET_SYSTEM_CALL] = {
Expand Down Expand Up @@ -1113,14 +1116,6 @@ static int s390_compat_last_break_get(struct task_struct *target,
return 0;
}

static int s390_compat_last_break_set(struct task_struct *target,
const struct user_regset *regset,
unsigned int pos, unsigned int count,
const void *kbuf, const void __user *ubuf)
{
return 0;
}

static const struct user_regset s390_compat_regsets[] = {
[REGSET_GENERAL] = {
.core_note_type = NT_PRSTATUS,
Expand All @@ -1144,7 +1139,6 @@ static const struct user_regset s390_compat_regsets[] = {
.size = sizeof(long),
.align = sizeof(long),
.get = s390_compat_last_break_get,
.set = s390_compat_last_break_set,
},
[REGSET_SYSTEM_CALL] = {
.core_note_type = NT_S390_SYSTEM_CALL,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ static unsigned long __init find_crash_base(unsigned long crash_size,
*msg = "first memory chunk must be at least crashkernel size";
return 0;
}
if (OLDMEM_BASE && crash_size == OLDMEM_SIZE)
if (is_kdump_kernel() && (crash_size == OLDMEM_SIZE))
return OLDMEM_BASE;

for (i = MEMORY_CHUNKS - 1; i >= 0; i--) {
Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/s390/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ void do_signal(struct pt_regs *regs)
regs->svc_code >> 16);
break;
}
/* No longer in a system call */
clear_thread_flag(TIF_SYSCALL);
}
/* No longer in a system call */
clear_thread_flag(TIF_SYSCALL);

if ((is_compat_task() ?
handle_signal32(signr, &ka, &info, oldset, regs) :
Expand All @@ -486,7 +486,6 @@ void do_signal(struct pt_regs *regs)
}

/* No handlers present - check for system call restart */
clear_thread_flag(TIF_SYSCALL);
if (current_thread_info()->system_call) {
regs->svc_code = current_thread_info()->system_call;
switch (regs->gprs[2]) {
Expand All @@ -501,6 +500,9 @@ void do_signal(struct pt_regs *regs)
regs->gprs[2] = regs->orig_gpr2;
set_thread_flag(TIF_SYSCALL);
break;
default:
clear_thread_flag(TIF_SYSCALL);
break;
}
}

Expand Down
23 changes: 1 addition & 22 deletions trunk/arch/x86/include/asm/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@ extern int no_timer_check;
* (mathieu.desnoyers@polymtl.ca)
*
* -johnstul@us.ibm.com "math is hard, lets go shopping!"
*
* In:
*
* ns = cycles * cyc2ns_scale / SC
*
* Although we may still have enough bits to store the value of ns,
* in some cases, we may not have enough bits to store cycles * cyc2ns_scale,
* leading to an incorrect result.
*
* To avoid this, we can decompose 'cycles' into quotient and remainder
* of division by SC. Then,
*
* ns = (quot * SC + rem) * cyc2ns_scale / SC
* = quot * cyc2ns_scale + (rem * cyc2ns_scale) / SC
*
* - sqazi@google.com
*/

DECLARE_PER_CPU(unsigned long, cyc2ns);
Expand All @@ -57,14 +41,9 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset);

static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
{
unsigned long long quot;
unsigned long long rem;
int cpu = smp_processor_id();
unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
quot = (cyc >> CYC2NS_SCALE_FACTOR);
rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1);
ns += quot * per_cpu(cyc2ns, cpu) +
((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR);
ns += cyc * per_cpu(cyc2ns, cpu) >> CYC2NS_SCALE_FACTOR;
return ns;
}

Expand Down
16 changes: 10 additions & 6 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,12 @@ int x86_setup_perfctr(struct perf_event *event)
return -EOPNOTSUPP;
}

/*
* Do not allow config1 (extended registers) to propagate,
* there's no sane user-space generalization yet:
*/
if (attr->type == PERF_TYPE_RAW)
return x86_pmu_extra_regs(event->attr.config, event);
return 0;

if (attr->type == PERF_TYPE_HW_CACHE)
return set_ext_hw_attr(hwc, event);
Expand Down Expand Up @@ -584,7 +588,7 @@ int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
x86_pmu.put_event_constraints(cpuc, cpuc->event_list[i]);
}
}
return num ? -EINVAL : 0;
return num ? -ENOSPC : 0;
}

/*
Expand All @@ -603,7 +607,7 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader,

if (is_x86_event(leader)) {
if (n >= max_count)
return -EINVAL;
return -ENOSPC;
cpuc->event_list[n] = leader;
n++;
}
Expand All @@ -616,7 +620,7 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader,
continue;

if (n >= max_count)
return -EINVAL;
return -ENOSPC;

cpuc->event_list[n] = event;
n++;
Expand Down Expand Up @@ -1312,7 +1316,7 @@ static int validate_event(struct perf_event *event)
c = x86_pmu.get_event_constraints(fake_cpuc, event);

if (!c || !c->weight)
ret = -EINVAL;
ret = -ENOSPC;

if (x86_pmu.put_event_constraints)
x86_pmu.put_event_constraints(fake_cpuc, event);
Expand All @@ -1337,7 +1341,7 @@ static int validate_group(struct perf_event *event)
{
struct perf_event *leader = event->group_leader;
struct cpu_hw_events *fake_cpuc;
int ret = -EINVAL, n;
int ret = -ENOSPC, n;

fake_cpuc = allocate_fake_cpuc();
if (IS_ERR(fake_cpuc))
Expand Down
29 changes: 11 additions & 18 deletions trunk/arch/x86/kernel/cpu/perf_event_amd_ibs.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ static int force_ibs_eilvt_setup(void)
goto out;
}

pr_info("IBS: LVT offset %d assigned\n", offset);
pr_err(FW_BUG "using offset %d for IBS interrupts\n", offset);
pr_err(FW_BUG "workaround enabled for IBS LVT offset\n");

return 0;
out:
Expand Down Expand Up @@ -264,23 +265,19 @@ perf_ibs_cpu_notifier(struct notifier_block *self, unsigned long action, void *h
static __init int amd_ibs_init(void)
{
u32 caps;
int ret = -EINVAL;
int ret;

caps = __get_ibs_caps();
if (!caps)
return -ENODEV; /* ibs not supported by the cpu */

/*
* Force LVT offset assignment for family 10h: The offsets are
* not assigned by the BIOS for this family, so the OS is
* responsible for doing it. If the OS assignment fails, fall
* back to BIOS settings and try to setup this.
*/
if (boot_cpu_data.x86 == 0x10)
force_ibs_eilvt_setup();

if (!ibs_eilvt_valid())
goto out;
if (!ibs_eilvt_valid()) {
ret = force_ibs_eilvt_setup();
if (ret) {
pr_err("Failed to setup IBS, %d\n", ret);
return ret;
}
}

get_online_cpus();
ibs_caps = caps;
Expand All @@ -290,11 +287,7 @@ static __init int amd_ibs_init(void)
smp_call_function(setup_APIC_ibs, NULL, 1);
put_online_cpus();

ret = perf_event_ibs_init();
out:
if (ret)
pr_err("Failed to setup IBS, %d\n", ret);
return ret;
return perf_event_ibs_init();
}

/* Since we need the pci subsystem to init ibs we can't do this earlier: */
Expand Down
8 changes: 0 additions & 8 deletions trunk/arch/x86/kernel/cpu/perf_event_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1545,13 +1545,6 @@ static void intel_clovertown_quirks(void)
x86_pmu.pebs_constraints = NULL;
}

static void intel_sandybridge_quirks(void)
{
printk(KERN_WARNING "PEBS disabled due to CPU errata.\n");
x86_pmu.pebs = 0;
x86_pmu.pebs_constraints = NULL;
}

__init int intel_pmu_init(void)
{
union cpuid10_edx edx;
Expand Down Expand Up @@ -1701,7 +1694,6 @@ __init int intel_pmu_init(void)
break;

case 42: /* SandyBridge */
x86_pmu.quirks = intel_sandybridge_quirks;
case 45: /* SandyBridge, "Romely-EP" */
memcpy(hw_cache_event_ids, snb_hw_cache_event_ids,
sizeof(hw_cache_event_ids));
Expand Down
6 changes: 1 addition & 5 deletions trunk/arch/x86/kernel/cpu/perf_event_intel_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
unsigned long from = cpuc->lbr_entries[0].from;
unsigned long old_to, to = cpuc->lbr_entries[0].to;
unsigned long ip = regs->ip;
int is_64bit = 0;

/*
* We don't need to fixup if the PEBS assist is fault like
Expand Down Expand Up @@ -545,10 +544,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs)
} else
kaddr = (void *)to;

#ifdef CONFIG_X86_64
is_64bit = kernel_ip(to) || !test_thread_flag(TIF_IA32);
#endif
insn_init(&insn, kaddr, is_64bit);
kernel_insn_init(&insn, kaddr);
insn_get_length(&insn);
to += insn.length;
} while (to < ip);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/perf_event_p4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ static int p4_pmu_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign
}

done:
return num ? -EINVAL : 0;
return num ? -ENOSPC : 0;
}

static __initconst const struct x86_pmu p4_pmu = {
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ static inline void stack_overflow_check(struct pt_regs *regs)
#ifdef CONFIG_DEBUG_STACKOVERFLOW
u64 curbase = (u64)task_stack_page(current);

if (user_mode_vm(regs))
return;

WARN_ONCE(regs->sp >= curbase &&
regs->sp <= curbase + THREAD_SIZE &&
regs->sp < curbase + sizeof(struct thread_info) +
Expand Down
Loading

0 comments on commit 9c3022a

Please sign in to comment.