I’m debugging PCIe enumeration and configuration on x86-64 with a PCIe switch between the RC and endpoints. I want to add printks
in Linux kernel to observe CONFIG 0
and CONFIG 1
TLP handling.
Which kernel source files are responsible for triggering and processing these TLPs?
I’ve reviewed drivers/pci but need guidance on pinpointing the code paths. Any debugging tips or references to related documentation would be appreciated.
If I understood your question correctly:
Kernel files: PCIe enum and config typically involve files in drivers/pci/
directory. Important files:
pci.c
for core enumeration logic.setup-bus.c
for PCI bus setup.access.c
for configuration space access.TLP handling: AFAIK CONFIG 0
and CONFIG 1
TLPs relate to PCI config transactions, processed in arch-specific code: arch/x86/
.
And debugging:
printk()
in related functions like pci_scan_bus()
or pci_read_config_*
.CONFIG_DEBUG_KERNEL
) and PCI debugging logs.Related docs: https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt , https://www.kernel.org/doc/html/v5.5/PCI/index.html