Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
"Two kernel side fixes:

- an Intel uncore PMU driver potential crash fix
- a kprobes/perf-call-graph interaction fix"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/x86/intel: Use rdmsrl_safe() when initializing RAPL PMU
kprobes/x86: Fix page-fault handling logic

+16 -12
+9 -3
arch/x86/kernel/cpu/perf_event_intel_rapl.c
··· 535 535 struct rapl_pmu *pmu = per_cpu(rapl_pmu, cpu); 536 536 int phys_id = topology_physical_package_id(cpu); 537 537 u64 ms; 538 + u64 msr_rapl_power_unit_bits; 538 539 539 540 if (pmu) 540 541 return 0; 541 542 542 543 if (phys_id < 0) 544 + return -1; 545 + 546 + if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) 543 547 return -1; 544 548 545 549 pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); ··· 559 555 * 560 556 * we cache in local PMU instance 561 557 */ 562 - rdmsrl(MSR_RAPL_POWER_UNIT, pmu->hw_unit); 563 - pmu->hw_unit = (pmu->hw_unit >> 8) & 0x1FULL; 558 + pmu->hw_unit = (msr_rapl_power_unit_bits >> 8) & 0x1FULL; 564 559 pmu->pmu = &rapl_pmu_class; 565 560 566 561 /* ··· 680 677 cpu_notifier_register_begin(); 681 678 682 679 for_each_online_cpu(cpu) { 683 - rapl_cpu_prepare(cpu); 680 + ret = rapl_cpu_prepare(cpu); 681 + if (ret) 682 + goto out; 684 683 rapl_cpu_init(cpu); 685 684 } 686 685 ··· 705 700 hweight32(rapl_cntr_mask), 706 701 ktime_to_ms(pmu->timer_interval)); 707 702 703 + out: 708 704 cpu_notifier_register_done(); 709 705 710 706 return 0;
+7 -9
arch/x86/kernel/kprobes/core.c
··· 897 897 struct kprobe *cur = kprobe_running(); 898 898 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 899 899 900 - switch (kcb->kprobe_status) { 901 - case KPROBE_HIT_SS: 902 - case KPROBE_REENTER: 900 + if (unlikely(regs->ip == (unsigned long)cur->ainsn.insn)) { 901 + /* This must happen on single-stepping */ 902 + WARN_ON(kcb->kprobe_status != KPROBE_HIT_SS && 903 + kcb->kprobe_status != KPROBE_REENTER); 903 904 /* 904 905 * We are here because the instruction being single 905 906 * stepped caused a page fault. We reset the current ··· 915 914 else 916 915 reset_current_kprobe(); 917 916 preempt_enable_no_resched(); 918 - break; 919 - case KPROBE_HIT_ACTIVE: 920 - case KPROBE_HIT_SSDONE: 917 + } else if (kcb->kprobe_status == KPROBE_HIT_ACTIVE || 918 + kcb->kprobe_status == KPROBE_HIT_SSDONE) { 921 919 /* 922 920 * We increment the nmissed count for accounting, 923 921 * we can also use npre/npostfault count for accounting ··· 945 945 * fixup routine could not handle it, 946 946 * Let do_page_fault() fix it. 947 947 */ 948 - break; 949 - default: 950 - break; 951 948 } 949 + 952 950 return 0; 953 951 } 954 952