aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKan Liang <kan.liang@intel.com>2015-12-03 16:00:11 -0500
committerIngo Molnar <mingo@kernel.org>2016-01-06 05:15:36 -0500
commitd6980ef32570e2a26e05b1183788f4b70f1f27d0 (patch)
tree5d9bc41ddd1d0ee7176c216563ee766ec80accd2
parentd3bcd64bbc35076a80c56918c905ddb167d097d8 (diff)
perf/x86/intel/uncore: Add Broadwell-EP uncore support
The uncore subsystem for Broadwell-EP is similar to Haswell-EP. There are some differences in pci device IDs, box number and constraints. This patch extends the Broadwell-DE codes to support Broadwell-EP. Signed-off-by: Kan Liang <kan.liang@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vince Weaver <vincent.weaver@maine.edu> Link: http://lkml.kernel.org/r/1449176411-9499-1-git-send-email-kan.liang@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_uncore.c2
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c152
2 files changed, 149 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 61215a69b03d..b63271c09248 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -966,6 +966,7 @@ static int __init uncore_pci_init(void)
966 case 63: /* Haswell-EP */ 966 case 63: /* Haswell-EP */
967 ret = hswep_uncore_pci_init(); 967 ret = hswep_uncore_pci_init();
968 break; 968 break;
969 case 79: /* BDX-EP */
969 case 86: /* BDX-DE */ 970 case 86: /* BDX-DE */
970 ret = bdx_uncore_pci_init(); 971 ret = bdx_uncore_pci_init();
971 break; 972 break;
@@ -1287,6 +1288,7 @@ static int __init uncore_cpu_init(void)
1287 case 63: /* Haswell-EP */ 1288 case 63: /* Haswell-EP */
1288 hswep_uncore_cpu_init(); 1289 hswep_uncore_cpu_init();
1289 break; 1290 break;
1291 case 79: /* BDX-EP */
1290 case 86: /* BDX-DE */ 1292 case 86: /* BDX-DE */
1291 bdx_uncore_cpu_init(); 1293 bdx_uncore_cpu_init();
1292 break; 1294 break;
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c b/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
index f0f4fcba252e..f2ddfccfaa36 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
@@ -2338,7 +2338,7 @@ int hswep_uncore_pci_init(void)
2338} 2338}
2339/* end of Haswell-EP uncore support */ 2339/* end of Haswell-EP uncore support */
2340 2340
2341/* BDX-DE uncore support */ 2341/* BDX uncore support */
2342 2342
2343static struct intel_uncore_type bdx_uncore_ubox = { 2343static struct intel_uncore_type bdx_uncore_ubox = {
2344 .name = "ubox", 2344 .name = "ubox",
@@ -2360,13 +2360,14 @@ static struct event_constraint bdx_uncore_cbox_constraints[] = {
2360 UNCORE_EVENT_CONSTRAINT(0x09, 0x3), 2360 UNCORE_EVENT_CONSTRAINT(0x09, 0x3),
2361 UNCORE_EVENT_CONSTRAINT(0x11, 0x1), 2361 UNCORE_EVENT_CONSTRAINT(0x11, 0x1),
2362 UNCORE_EVENT_CONSTRAINT(0x36, 0x1), 2362 UNCORE_EVENT_CONSTRAINT(0x36, 0x1),
2363 UNCORE_EVENT_CONSTRAINT(0x3e, 0x1),
2363 EVENT_CONSTRAINT_END 2364 EVENT_CONSTRAINT_END
2364}; 2365};
2365 2366
2366static struct intel_uncore_type bdx_uncore_cbox = { 2367static struct intel_uncore_type bdx_uncore_cbox = {
2367 .name = "cbox", 2368 .name = "cbox",
2368 .num_counters = 4, 2369 .num_counters = 4,
2369 .num_boxes = 8, 2370 .num_boxes = 24,
2370 .perf_ctr_bits = 48, 2371 .perf_ctr_bits = 48,
2371 .event_ctl = HSWEP_C0_MSR_PMON_CTL0, 2372 .event_ctl = HSWEP_C0_MSR_PMON_CTL0,
2372 .perf_ctr = HSWEP_C0_MSR_PMON_CTR0, 2373 .perf_ctr = HSWEP_C0_MSR_PMON_CTR0,
@@ -2379,9 +2380,24 @@ static struct intel_uncore_type bdx_uncore_cbox = {
2379 .format_group = &hswep_uncore_cbox_format_group, 2380 .format_group = &hswep_uncore_cbox_format_group,
2380}; 2381};
2381 2382
2383static struct intel_uncore_type bdx_uncore_sbox = {
2384 .name = "sbox",
2385 .num_counters = 4,
2386 .num_boxes = 4,
2387 .perf_ctr_bits = 48,
2388 .event_ctl = HSWEP_S0_MSR_PMON_CTL0,
2389 .perf_ctr = HSWEP_S0_MSR_PMON_CTR0,
2390 .event_mask = HSWEP_S_MSR_PMON_RAW_EVENT_MASK,
2391 .box_ctl = HSWEP_S0_MSR_PMON_BOX_CTL,
2392 .msr_offset = HSWEP_SBOX_MSR_OFFSET,
2393 .ops = &hswep_uncore_sbox_msr_ops,
2394 .format_group = &hswep_uncore_sbox_format_group,
2395};
2396
2382static struct intel_uncore_type *bdx_msr_uncores[] = { 2397static struct intel_uncore_type *bdx_msr_uncores[] = {
2383 &bdx_uncore_ubox, 2398 &bdx_uncore_ubox,
2384 &bdx_uncore_cbox, 2399 &bdx_uncore_cbox,
2400 &bdx_uncore_sbox,
2385 &hswep_uncore_pcu, 2401 &hswep_uncore_pcu,
2386 NULL, 2402 NULL,
2387}; 2403};
@@ -2396,7 +2412,7 @@ void bdx_uncore_cpu_init(void)
2396static struct intel_uncore_type bdx_uncore_ha = { 2412static struct intel_uncore_type bdx_uncore_ha = {
2397 .name = "ha", 2413 .name = "ha",
2398 .num_counters = 4, 2414 .num_counters = 4,
2399 .num_boxes = 1, 2415 .num_boxes = 2,
2400 .perf_ctr_bits = 48, 2416 .perf_ctr_bits = 48,
2401 SNBEP_UNCORE_PCI_COMMON_INIT(), 2417 SNBEP_UNCORE_PCI_COMMON_INIT(),
2402}; 2418};
@@ -2404,7 +2420,7 @@ static struct intel_uncore_type bdx_uncore_ha = {
2404static struct intel_uncore_type bdx_uncore_imc = { 2420static struct intel_uncore_type bdx_uncore_imc = {
2405 .name = "imc", 2421 .name = "imc",
2406 .num_counters = 5, 2422 .num_counters = 5,
2407 .num_boxes = 2, 2423 .num_boxes = 8,
2408 .perf_ctr_bits = 48, 2424 .perf_ctr_bits = 48,
2409 .fixed_ctr_bits = 48, 2425 .fixed_ctr_bits = 48,
2410 .fixed_ctr = SNBEP_MC_CHy_PCI_PMON_FIXED_CTR, 2426 .fixed_ctr = SNBEP_MC_CHy_PCI_PMON_FIXED_CTR,
@@ -2424,6 +2440,19 @@ static struct intel_uncore_type bdx_uncore_irp = {
2424 .format_group = &snbep_uncore_format_group, 2440 .format_group = &snbep_uncore_format_group,
2425}; 2441};
2426 2442
2443static struct intel_uncore_type bdx_uncore_qpi = {
2444 .name = "qpi",
2445 .num_counters = 4,
2446 .num_boxes = 3,
2447 .perf_ctr_bits = 48,
2448 .perf_ctr = SNBEP_PCI_PMON_CTR0,
2449 .event_ctl = SNBEP_PCI_PMON_CTL0,
2450 .event_mask = SNBEP_QPI_PCI_PMON_RAW_EVENT_MASK,
2451 .box_ctl = SNBEP_PCI_PMON_BOX_CTL,
2452 .num_shared_regs = 1,
2453 .ops = &snbep_uncore_qpi_ops,
2454 .format_group = &snbep_uncore_qpi_format_group,
2455};
2427 2456
2428static struct event_constraint bdx_uncore_r2pcie_constraints[] = { 2457static struct event_constraint bdx_uncore_r2pcie_constraints[] = {
2429 UNCORE_EVENT_CONSTRAINT(0x10, 0x3), 2458 UNCORE_EVENT_CONSTRAINT(0x10, 0x3),
@@ -2432,6 +2461,8 @@ static struct event_constraint bdx_uncore_r2pcie_constraints[] = {
2432 UNCORE_EVENT_CONSTRAINT(0x23, 0x1), 2461 UNCORE_EVENT_CONSTRAINT(0x23, 0x1),
2433 UNCORE_EVENT_CONSTRAINT(0x25, 0x1), 2462 UNCORE_EVENT_CONSTRAINT(0x25, 0x1),
2434 UNCORE_EVENT_CONSTRAINT(0x26, 0x3), 2463 UNCORE_EVENT_CONSTRAINT(0x26, 0x3),
2464 UNCORE_EVENT_CONSTRAINT(0x28, 0x3),
2465 UNCORE_EVENT_CONSTRAINT(0x2c, 0x3),
2435 UNCORE_EVENT_CONSTRAINT(0x2d, 0x3), 2466 UNCORE_EVENT_CONSTRAINT(0x2d, 0x3),
2436 EVENT_CONSTRAINT_END 2467 EVENT_CONSTRAINT_END
2437}; 2468};
@@ -2445,18 +2476,65 @@ static struct intel_uncore_type bdx_uncore_r2pcie = {
2445 SNBEP_UNCORE_PCI_COMMON_INIT(), 2476 SNBEP_UNCORE_PCI_COMMON_INIT(),
2446}; 2477};
2447 2478
2479static struct event_constraint bdx_uncore_r3qpi_constraints[] = {
2480 UNCORE_EVENT_CONSTRAINT(0x01, 0x7),
2481 UNCORE_EVENT_CONSTRAINT(0x07, 0x7),
2482 UNCORE_EVENT_CONSTRAINT(0x08, 0x7),
2483 UNCORE_EVENT_CONSTRAINT(0x09, 0x7),
2484 UNCORE_EVENT_CONSTRAINT(0x0a, 0x7),
2485 UNCORE_EVENT_CONSTRAINT(0x0e, 0x7),
2486 UNCORE_EVENT_CONSTRAINT(0x10, 0x3),
2487 UNCORE_EVENT_CONSTRAINT(0x11, 0x3),
2488 UNCORE_EVENT_CONSTRAINT(0x13, 0x1),
2489 UNCORE_EVENT_CONSTRAINT(0x14, 0x3),
2490 UNCORE_EVENT_CONSTRAINT(0x15, 0x3),
2491 UNCORE_EVENT_CONSTRAINT(0x1f, 0x3),
2492 UNCORE_EVENT_CONSTRAINT(0x20, 0x3),
2493 UNCORE_EVENT_CONSTRAINT(0x21, 0x3),
2494 UNCORE_EVENT_CONSTRAINT(0x22, 0x3),
2495 UNCORE_EVENT_CONSTRAINT(0x23, 0x3),
2496 UNCORE_EVENT_CONSTRAINT(0x25, 0x3),
2497 UNCORE_EVENT_CONSTRAINT(0x26, 0x3),
2498 UNCORE_EVENT_CONSTRAINT(0x28, 0x3),
2499 UNCORE_EVENT_CONSTRAINT(0x29, 0x3),
2500 UNCORE_EVENT_CONSTRAINT(0x2c, 0x3),
2501 UNCORE_EVENT_CONSTRAINT(0x2d, 0x3),
2502 UNCORE_EVENT_CONSTRAINT(0x2e, 0x3),
2503 UNCORE_EVENT_CONSTRAINT(0x2f, 0x3),
2504 UNCORE_EVENT_CONSTRAINT(0x33, 0x3),
2505 UNCORE_EVENT_CONSTRAINT(0x34, 0x3),
2506 UNCORE_EVENT_CONSTRAINT(0x36, 0x3),
2507 UNCORE_EVENT_CONSTRAINT(0x37, 0x3),
2508 UNCORE_EVENT_CONSTRAINT(0x38, 0x3),
2509 UNCORE_EVENT_CONSTRAINT(0x39, 0x3),
2510 EVENT_CONSTRAINT_END
2511};
2512
2513static struct intel_uncore_type bdx_uncore_r3qpi = {
2514 .name = "r3qpi",
2515 .num_counters = 3,
2516 .num_boxes = 3,
2517 .perf_ctr_bits = 48,
2518 .constraints = bdx_uncore_r3qpi_constraints,
2519 SNBEP_UNCORE_PCI_COMMON_INIT(),
2520};
2521
2448enum { 2522enum {
2449 BDX_PCI_UNCORE_HA, 2523 BDX_PCI_UNCORE_HA,
2450 BDX_PCI_UNCORE_IMC, 2524 BDX_PCI_UNCORE_IMC,
2451 BDX_PCI_UNCORE_IRP, 2525 BDX_PCI_UNCORE_IRP,
2526 BDX_PCI_UNCORE_QPI,
2452 BDX_PCI_UNCORE_R2PCIE, 2527 BDX_PCI_UNCORE_R2PCIE,
2528 BDX_PCI_UNCORE_R3QPI,
2453}; 2529};
2454 2530
2455static struct intel_uncore_type *bdx_pci_uncores[] = { 2531static struct intel_uncore_type *bdx_pci_uncores[] = {
2456 [BDX_PCI_UNCORE_HA] = &bdx_uncore_ha, 2532 [BDX_PCI_UNCORE_HA] = &bdx_uncore_ha,
2457 [BDX_PCI_UNCORE_IMC] = &bdx_uncore_imc, 2533 [BDX_PCI_UNCORE_IMC] = &bdx_uncore_imc,
2458 [BDX_PCI_UNCORE_IRP] = &bdx_uncore_irp, 2534 [BDX_PCI_UNCORE_IRP] = &bdx_uncore_irp,
2535 [BDX_PCI_UNCORE_QPI] = &bdx_uncore_qpi,
2459 [BDX_PCI_UNCORE_R2PCIE] = &bdx_uncore_r2pcie, 2536 [BDX_PCI_UNCORE_R2PCIE] = &bdx_uncore_r2pcie,
2537 [BDX_PCI_UNCORE_R3QPI] = &bdx_uncore_r3qpi,
2460 NULL, 2538 NULL,
2461}; 2539};
2462 2540
@@ -2465,6 +2543,10 @@ static const struct pci_device_id bdx_uncore_pci_ids[] = {
2465 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f30), 2543 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f30),
2466 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_HA, 0), 2544 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_HA, 0),
2467 }, 2545 },
2546 { /* Home Agent 1 */
2547 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f38),
2548 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_HA, 1),
2549 },
2468 { /* MC0 Channel 0 */ 2550 { /* MC0 Channel 0 */
2469 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fb0), 2551 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fb0),
2470 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 0), 2552 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 0),
@@ -2473,14 +2555,74 @@ static const struct pci_device_id bdx_uncore_pci_ids[] = {
2473 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fb1), 2555 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fb1),
2474 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 1), 2556 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 1),
2475 }, 2557 },
2558 { /* MC0 Channel 2 */
2559 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fb4),
2560 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 2),
2561 },
2562 { /* MC0 Channel 3 */
2563 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fb5),
2564 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 3),
2565 },
2566 { /* MC1 Channel 0 */
2567 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fd0),
2568 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 4),
2569 },
2570 { /* MC1 Channel 1 */
2571 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fd1),
2572 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 5),
2573 },
2574 { /* MC1 Channel 2 */
2575 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fd4),
2576 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 6),
2577 },
2578 { /* MC1 Channel 3 */
2579 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fd5),
2580 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IMC, 7),
2581 },
2476 { /* IRP */ 2582 { /* IRP */
2477 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f39), 2583 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f39),
2478 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IRP, 0), 2584 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_IRP, 0),
2479 }, 2585 },
2586 { /* QPI0 Port 0 */
2587 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f32),
2588 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_QPI, 0),
2589 },
2590 { /* QPI0 Port 1 */
2591 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f33),
2592 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_QPI, 1),
2593 },
2594 { /* QPI1 Port 2 */
2595 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f3a),
2596 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_QPI, 2),
2597 },
2480 { /* R2PCIe */ 2598 { /* R2PCIe */
2481 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f34), 2599 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f34),
2482 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_R2PCIE, 0), 2600 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_R2PCIE, 0),
2483 }, 2601 },
2602 { /* R3QPI0 Link 0 */
2603 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f36),
2604 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_R3QPI, 0),
2605 },
2606 { /* R3QPI0 Link 1 */
2607 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f37),
2608 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_R3QPI, 1),
2609 },
2610 { /* R3QPI1 Link 2 */
2611 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f3e),
2612 .driver_data = UNCORE_PCI_DEV_DATA(BDX_PCI_UNCORE_R3QPI, 2),
2613 },
2614 { /* QPI Port 0 filter */
2615 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f86),
2616 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, 0),
2617 },
2618 { /* QPI Port 1 filter */
2619 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f96),
2620 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, 1),
2621 },
2622 { /* QPI Port 2 filter */
2623 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f46),
2624 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, 2),
2625 },
2484 { /* end: all zeroes */ } 2626 { /* end: all zeroes */ }
2485}; 2627};
2486 2628
@@ -2500,4 +2642,4 @@ int bdx_uncore_pci_init(void)
2500 return 0; 2642 return 0;
2501} 2643}
2502 2644
2503/* end of BDX-DE uncore support */ 2645/* end of BDX uncore support */