]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
misc: pci_endpoint_test: Add BAR subrange mapping test case
authorKoichiro Den <den@valinux.co.jp>
Sat, 24 Jan 2026 14:50:11 +0000 (23:50 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 29 Jan 2026 23:42:29 +0000 (17:42 -0600)
commit8cf82bb558517503a81f8e3c49914c0836360aa6
treeaad5c16b237a4e7b588cc94d6f0f357bab3cca47
parent6c5e6101423b0dbda417d92d1552a4e2c669a76c
misc: pci_endpoint_test: Add BAR subrange mapping test case

Add a new PCITEST_BAR_SUBRANGE ioctl to exercise EPC BAR subrange
mapping end-to-end.

The test programs a simple 2-subrange layout on the endpoint (via
pci-epf-test) and verifies that:
  - the endpoint-provided per-subrange signature bytes are observed at
    the expected PCIe BAR offsets, and
  - writes to each subrange are routed to the correct backing region
    (i.e. the submap order is applied rather than accidentally working
    due to an identity mapping).

Return -EOPNOTSUPP when the endpoint does not advertise subrange
mapping, -ENODATA when the BAR is disabled, and -EBUSY when the BAR is
reserved for the test register space.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260124145012.2794108-8-den@valinux.co.jp
drivers/misc/pci_endpoint_test.c
include/uapi/linux/pcitest.h