aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-31 18:38:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-31 18:38:27 -0500
commit29d14f083522e5bc762256f68227d267118946c8 (patch)
tree124ae23890efad2ac482f84d525779ed44329875 /arch/x86
parentbbfb239a106d41d793f58befdaf5c806e34ea97e (diff)
parent28fb8a5b6e233fc384fb27f9f91f811b40ba9cf8 (diff)
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Thomas Gleixner: "This is much bigger than typical fixes, but Peter found a category of races that spurred more fixes and more debugging enhancements. Work started before the merge window, but got finished only now. Aside of that this contains the usual small fixes to perf and tools. Nothing particular exciting" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (43 commits) perf: Remove/simplify lockdep annotation perf: Synchronously clean up child events perf: Untangle 'owner' confusion perf: Add flags argument to perf_remove_from_context() perf: Clean up sync_child_event() perf: Robustify event->owner usage and SMP ordering perf: Fix STATE_EXIT usage perf: Update locking order perf: Remove __free_event() perf/bpf: Convert perf_event_array to use struct file perf: Fix NULL deref perf/x86: De-obfuscate code perf/x86: Fix uninitialized value usage perf: Fix race in perf_event_exit_task_context() perf: Fix orphan hole perf stat: Do not clean event's private stats perf hists: Fix HISTC_MEM_DCACHELINE width setting perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed perf tests: Remove wrong semicolon in while loop in CQM test perf: Synchronously free aux pages in case of allocation failure ...
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel.c7
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_uncore.c3
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_uncore.h1
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c20
4 files changed, 27 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index a667078a5180..fed2ab1f1065 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -1960,7 +1960,8 @@ intel_bts_constraints(struct perf_event *event)
1960 1960
1961static int intel_alt_er(int idx, u64 config) 1961static int intel_alt_er(int idx, u64 config)
1962{ 1962{
1963 int alt_idx; 1963 int alt_idx = idx;
1964
1964 if (!(x86_pmu.flags & PMU_FL_HAS_RSP_1)) 1965 if (!(x86_pmu.flags & PMU_FL_HAS_RSP_1))
1965 return idx; 1966 return idx;
1966 1967
@@ -2897,14 +2898,12 @@ static void intel_pmu_cpu_starting(int cpu)
2897 return; 2898 return;
2898 2899
2899 if (!(x86_pmu.flags & PMU_FL_NO_HT_SHARING)) { 2900 if (!(x86_pmu.flags & PMU_FL_NO_HT_SHARING)) {
2900 void **onln = &cpuc->kfree_on_online[X86_PERF_KFREE_SHARED];
2901
2902 for_each_cpu(i, topology_sibling_cpumask(cpu)) { 2901 for_each_cpu(i, topology_sibling_cpumask(cpu)) {
2903 struct intel_shared_regs *pc; 2902 struct intel_shared_regs *pc;
2904 2903
2905 pc = per_cpu(cpu_hw_events, i).shared_regs; 2904 pc = per_cpu(cpu_hw_events, i).shared_regs;
2906 if (pc && pc->core_id == core_id) { 2905 if (pc && pc->core_id == core_id) {
2907 *onln = cpuc->shared_regs; 2906 cpuc->kfree_on_online[0] = cpuc->shared_regs;
2908 cpuc->shared_regs = pc; 2907 cpuc->shared_regs = pc;
2909 break; 2908 break;
2910 } 2909 }
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index f97f8075bf04..3bf41d413775 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -995,6 +995,9 @@ static int __init uncore_pci_init(void)
995 case 87: /* Knights Landing */ 995 case 87: /* Knights Landing */
996 ret = knl_uncore_pci_init(); 996 ret = knl_uncore_pci_init();
997 break; 997 break;
998 case 94: /* SkyLake */
999 ret = skl_uncore_pci_init();
1000 break;
998 default: 1001 default:
999 return 0; 1002 return 0;
1000 } 1003 }
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.h b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
index 07aa2d6bd710..a7086b862156 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.h
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
@@ -336,6 +336,7 @@ int snb_uncore_pci_init(void);
336int ivb_uncore_pci_init(void); 336int ivb_uncore_pci_init(void);
337int hsw_uncore_pci_init(void); 337int hsw_uncore_pci_init(void);
338int bdw_uncore_pci_init(void); 338int bdw_uncore_pci_init(void);
339int skl_uncore_pci_init(void);
339void snb_uncore_cpu_init(void); 340void snb_uncore_cpu_init(void);
340void nhm_uncore_cpu_init(void); 341void nhm_uncore_cpu_init(void);
341int snb_pci2phy_map_init(int devid); 342int snb_pci2phy_map_init(int devid);
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c b/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c
index 0b934820fafd..2bd030ddd0db 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore_snb.c
@@ -8,6 +8,7 @@
8#define PCI_DEVICE_ID_INTEL_HSW_IMC 0x0c00 8#define PCI_DEVICE_ID_INTEL_HSW_IMC 0x0c00
9#define PCI_DEVICE_ID_INTEL_HSW_U_IMC 0x0a04 9#define PCI_DEVICE_ID_INTEL_HSW_U_IMC 0x0a04
10#define PCI_DEVICE_ID_INTEL_BDW_IMC 0x1604 10#define PCI_DEVICE_ID_INTEL_BDW_IMC 0x1604
11#define PCI_DEVICE_ID_INTEL_SKL_IMC 0x191f
11 12
12/* SNB event control */ 13/* SNB event control */
13#define SNB_UNC_CTL_EV_SEL_MASK 0x000000ff 14#define SNB_UNC_CTL_EV_SEL_MASK 0x000000ff
@@ -524,6 +525,14 @@ static const struct pci_device_id bdw_uncore_pci_ids[] = {
524 { /* end: all zeroes */ }, 525 { /* end: all zeroes */ },
525}; 526};
526 527
528static const struct pci_device_id skl_uncore_pci_ids[] = {
529 { /* IMC */
530 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_IMC),
531 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
532 },
533 { /* end: all zeroes */ },
534};
535
527static struct pci_driver snb_uncore_pci_driver = { 536static struct pci_driver snb_uncore_pci_driver = {
528 .name = "snb_uncore", 537 .name = "snb_uncore",
529 .id_table = snb_uncore_pci_ids, 538 .id_table = snb_uncore_pci_ids,
@@ -544,6 +553,11 @@ static struct pci_driver bdw_uncore_pci_driver = {
544 .id_table = bdw_uncore_pci_ids, 553 .id_table = bdw_uncore_pci_ids,
545}; 554};
546 555
556static struct pci_driver skl_uncore_pci_driver = {
557 .name = "skl_uncore",
558 .id_table = skl_uncore_pci_ids,
559};
560
547struct imc_uncore_pci_dev { 561struct imc_uncore_pci_dev {
548 __u32 pci_id; 562 __u32 pci_id;
549 struct pci_driver *driver; 563 struct pci_driver *driver;
@@ -558,6 +572,7 @@ static const struct imc_uncore_pci_dev desktop_imc_pci_ids[] = {
558 IMC_DEV(HSW_IMC, &hsw_uncore_pci_driver), /* 4th Gen Core Processor */ 572 IMC_DEV(HSW_IMC, &hsw_uncore_pci_driver), /* 4th Gen Core Processor */
559 IMC_DEV(HSW_U_IMC, &hsw_uncore_pci_driver), /* 4th Gen Core ULT Mobile Processor */ 573 IMC_DEV(HSW_U_IMC, &hsw_uncore_pci_driver), /* 4th Gen Core ULT Mobile Processor */
560 IMC_DEV(BDW_IMC, &bdw_uncore_pci_driver), /* 5th Gen Core U */ 574 IMC_DEV(BDW_IMC, &bdw_uncore_pci_driver), /* 5th Gen Core U */
575 IMC_DEV(SKL_IMC, &skl_uncore_pci_driver), /* 6th Gen Core */
561 { /* end marker */ } 576 { /* end marker */ }
562}; 577};
563 578
@@ -610,6 +625,11 @@ int bdw_uncore_pci_init(void)
610 return imc_uncore_pci_init(); 625 return imc_uncore_pci_init();
611} 626}
612 627
628int skl_uncore_pci_init(void)
629{
630 return imc_uncore_pci_init();
631}
632
613/* end of Sandy Bridge uncore support */ 633/* end of Sandy Bridge uncore support */
614 634
615/* Nehalem uncore support */ 635/* Nehalem uncore support */