Skip to content

Commit 41a134a

Browse files
Andi KleenIngo Molnar
authored andcommitted
perf/x86/intel/uncore: Fix IRP uncore register offsets on Haswell EP
The counter register offsets for the IRP box PMU for Haswell-EP were incorrect. The offsets actually changed over IvyBridge EP. Fix them to the correct values. For this we need to fork the read function from the IVB and use an own counter array. Tested-by: [email protected] Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 226424e commit 41a134a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,13 +2025,27 @@ static struct intel_uncore_type hswep_uncore_imc = {
20252025
SNBEP_UNCORE_PCI_COMMON_INIT(),
20262026
};
20272027

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+
20282042
static struct intel_uncore_ops hswep_uncore_irp_ops = {
20292043
.init_box = snbep_uncore_pci_init_box,
20302044
.disable_box = snbep_uncore_pci_disable_box,
20312045
.enable_box = snbep_uncore_pci_enable_box,
20322046
.disable_event = ivbep_uncore_irp_disable_event,
20332047
.enable_event = ivbep_uncore_irp_enable_event,
2034-
.read_counter = ivbep_uncore_irp_read_counter,
2048+
.read_counter = hswep_uncore_irp_read_counter,
20352049
};
20362050

20372051
static struct intel_uncore_type hswep_uncore_irp = {

0 commit comments

Comments
 (0)