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:
"Misc fixes: two Intel uncore driver fixes, a CPU-hotplug fix and a
build dependencies fix"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/x86/intel/uncore: Fix boot crash on SBOX PMU on Haswell-EP
perf/x86/intel/uncore: Fix IRP uncore register offsets on Haswell EP
perf: Fix corruption of sibling list with hotplug
perf/x86: Fix embarrasing typo

+51 -8
+1 -1
arch/x86/Kconfig
··· 144 144 145 145 config PERF_EVENTS_INTEL_UNCORE 146 146 def_bool y 147 - depends on PERF_EVENTS && SUP_SUP_INTEL && PCI 147 + depends on PERF_EVENTS && CPU_SUP_INTEL && PCI 148 148 149 149 config OUTPUT_FORMAT 150 150 string
+45 -4
arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
··· 486 486 .attrs = snbep_uncore_qpi_formats_attr, 487 487 }; 488 488 489 - #define SNBEP_UNCORE_MSR_OPS_COMMON_INIT() \ 490 - .init_box = snbep_uncore_msr_init_box, \ 489 + #define __SNBEP_UNCORE_MSR_OPS_COMMON_INIT() \ 491 490 .disable_box = snbep_uncore_msr_disable_box, \ 492 491 .enable_box = snbep_uncore_msr_enable_box, \ 493 492 .disable_event = snbep_uncore_msr_disable_event, \ 494 493 .enable_event = snbep_uncore_msr_enable_event, \ 495 494 .read_counter = uncore_msr_read_counter 495 + 496 + #define SNBEP_UNCORE_MSR_OPS_COMMON_INIT() \ 497 + __SNBEP_UNCORE_MSR_OPS_COMMON_INIT(), \ 498 + .init_box = snbep_uncore_msr_init_box \ 496 499 497 500 static struct intel_uncore_ops snbep_uncore_msr_ops = { 498 501 SNBEP_UNCORE_MSR_OPS_COMMON_INIT(), ··· 1922 1919 .format_group = &hswep_uncore_cbox_format_group, 1923 1920 }; 1924 1921 1922 + /* 1923 + * Write SBOX Initialization register bit by bit to avoid spurious #GPs 1924 + */ 1925 + static void hswep_uncore_sbox_msr_init_box(struct intel_uncore_box *box) 1926 + { 1927 + unsigned msr = uncore_msr_box_ctl(box); 1928 + 1929 + if (msr) { 1930 + u64 init = SNBEP_PMON_BOX_CTL_INT; 1931 + u64 flags = 0; 1932 + int i; 1933 + 1934 + for_each_set_bit(i, (unsigned long *)&init, 64) { 1935 + flags |= (1ULL << i); 1936 + wrmsrl(msr, flags); 1937 + } 1938 + } 1939 + } 1940 + 1941 + static struct intel_uncore_ops hswep_uncore_sbox_msr_ops = { 1942 + __SNBEP_UNCORE_MSR_OPS_COMMON_INIT(), 1943 + .init_box = hswep_uncore_sbox_msr_init_box 1944 + }; 1945 + 1925 1946 static struct attribute *hswep_uncore_sbox_formats_attr[] = { 1926 1947 &format_attr_event.attr, 1927 1948 &format_attr_umask.attr, ··· 1971 1944 .event_mask = HSWEP_S_MSR_PMON_RAW_EVENT_MASK, 1972 1945 .box_ctl = HSWEP_S0_MSR_PMON_BOX_CTL, 1973 1946 .msr_offset = HSWEP_SBOX_MSR_OFFSET, 1974 - .ops = &snbep_uncore_msr_ops, 1947 + .ops = &hswep_uncore_sbox_msr_ops, 1975 1948 .format_group = &hswep_uncore_sbox_format_group, 1976 1949 }; 1977 1950 ··· 2052 2025 SNBEP_UNCORE_PCI_COMMON_INIT(), 2053 2026 }; 2054 2027 2028 + static unsigned hswep_uncore_irp_ctrs[] = {0xa0, 0xa8, 0xb0, 0xb8}; 2029 + 2030 + static u64 hswep_uncore_irp_read_counter(struct intel_uncore_box *box, struct perf_event *event) 2031 + { 2032 + struct pci_dev *pdev = box->pci_dev; 2033 + struct hw_perf_event *hwc = &event->hw; 2034 + u64 count = 0; 2035 + 2036 + pci_read_config_dword(pdev, hswep_uncore_irp_ctrs[hwc->idx], (u32 *)&count); 2037 + pci_read_config_dword(pdev, hswep_uncore_irp_ctrs[hwc->idx] + 4, (u32 *)&count + 1); 2038 + 2039 + return count; 2040 + } 2041 + 2055 2042 static struct intel_uncore_ops hswep_uncore_irp_ops = { 2056 2043 .init_box = snbep_uncore_pci_init_box, 2057 2044 .disable_box = snbep_uncore_pci_disable_box, 2058 2045 .enable_box = snbep_uncore_pci_enable_box, 2059 2046 .disable_event = ivbep_uncore_irp_disable_event, 2060 2047 .enable_event = ivbep_uncore_irp_enable_event, 2061 - .read_counter = ivbep_uncore_irp_read_counter, 2048 + .read_counter = hswep_uncore_irp_read_counter, 2062 2049 }; 2063 2050 2064 2051 static struct intel_uncore_type hswep_uncore_irp = {
+5 -3
kernel/events/core.c
··· 1562 1562 1563 1563 if (!task) { 1564 1564 /* 1565 - * Per cpu events are removed via an smp call and 1566 - * the removal is always successful. 1565 + * Per cpu events are removed via an smp call. The removal can 1566 + * fail if the CPU is currently offline, but in that case we 1567 + * already called __perf_remove_from_context from 1568 + * perf_event_exit_cpu. 1567 1569 */ 1568 1570 cpu_function_call(event->cpu, __perf_remove_from_context, &re); 1569 1571 return; ··· 8119 8117 8120 8118 static void __perf_event_exit_context(void *__info) 8121 8119 { 8122 - struct remove_event re = { .detach_group = false }; 8120 + struct remove_event re = { .detach_group = true }; 8123 8121 struct perf_event_context *ctx = __info; 8124 8122 8125 8123 perf_pmu_rotate_stop(ctx->pmu);