[PATCH 02/12] perf/x86/intel/uncore: Fix ICX UPI and M3UPI box control offset

From: Zide Chen

Date: Fri Dec 04 2026 - 22:35:06 EST


skx_upi_uncore_pci_init_box() and ivbep_uncore_pci_init_box() hardcoded
SKX_UPI_PCI_PMON_BOX_CTL (0x378) and SNBEP_PCI_PMON_BOX_CTL (0xf4).
When shared with ICX (icx_uncore_upi and icx_uncore_m3upi), these
hardcoded offsets caused init writes to hit unrelated PCI configuration
space instead of the ICX-specific box control registers at 0x318 and
0xa0.

Use uncore_pci_box_ctl() to get the box control offset from the uncore
type. Existing IVB-EP and SKX users of ivbep_uncore_pci_init_box() are
unaffected because their box_ctl already equals
SNBEP_PCI_PMON_BOX_CTL (0xf4). skx_uncore_upi is likewise unaffected
because its box_ctl is SKX_UPI_PCI_PMON_BOX_CTL (0x378).

Fixes: 2b3b76b5ec67 ("perf/x86/intel/uncore: Add Ice Lake server uncore support")
Signed-off-by: Zide Chen <zide.chen@xxxxxxxxx>
---
arch/x86/events/intel/uncore_snbep.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 36f56163e07e..35212195b379 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -1525,7 +1525,7 @@ static int ivbep_uncore_pci_init_box(struct intel_uncore_box *box)
{
struct pci_dev *pdev = box->pci_dev;

- return pci_write_config_dword(pdev, SNBEP_PCI_PMON_BOX_CTL,
+ return pci_write_config_dword(pdev, uncore_pci_box_ctl(box),
IVBEP_PMON_BOX_CTL_INT);
}

@@ -4177,7 +4177,7 @@ static int skx_upi_uncore_pci_init_box(struct intel_uncore_box *box)
struct pci_dev *pdev = box->pci_dev;

__set_bit(UNCORE_BOX_FLAG_CTL_OFFS8, &box->flags);
- return pci_write_config_dword(pdev, SKX_UPI_PCI_PMON_BOX_CTL,
+ return pci_write_config_dword(pdev, uncore_pci_box_ctl(box),
IVBEP_PMON_BOX_CTL_INT);
}

--
2.56.1