Skip to content

Cp pci domain fix - #1268

Open
manoj-freyr wants to merge 5 commits into
release/rvs-1.5.xfrom
cp-pci-domain-fix
Open

Cp pci domain fix#1268
manoj-freyr wants to merge 5 commits into
release/rvs-1.5.xfrom
cp-pci-domain-fix

Conversation

@manoj-freyr

Copy link
Copy Markdown
Collaborator

Fix PEQT segfault and kernel_driver detection on multi-domain PCIe systems

PEQT, SMQT, and PESM matched PCI devices to GPUs using only bus/dev/func
(location_id) and ignored the PCIe domain. On systems with multiple domains
(e.g. 0000: and 0001:), unrelated devices can share the same location_id
— a GPU at 0000:05:00.0 and a bridge at 0001:05:00.0 both map to 0x0500.
Those modules then ran PCIe capability queries on the wrong device; libpci
state (notably dev->access) was corrupted and get_kernel_driver() segfaulted
dereferencing it.

Use domlocation2gpu(domain, location_id) so only the intended GPU BDF is
matched.

Clanmup and Hardening changes:

  • get_kernel_driver: read /sys/bus/pci/devices//driver instead of
    libpci dev->access/readlink, avoiding bad access pointers while still
    reporting amdgpu.
  • get_pwr_budgeting: skip when config access is unavailable; continue the
    DSR loop on failed/empty reads instead of aborting mid-query.
  • PEQT dynamic power-budget capabilities: validate map lookups before use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant