]> www.infradead.org Git - users/jedix/linux-maple.git/commit
misc: pci_endpoint_test: Add consecutive BAR test
authorNiklas Cassel <cassel@kernel.org>
Sat, 16 Nov 2024 03:20:45 +0000 (04:20 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 21 Jan 2025 15:44:14 +0000 (09:44 -0600)
commitd6658d3338f84173fb55c9d6c6cdfa57f879712d
treeabf77eda6e1bff7309c53d27bd6a629953318289
parent0d292a1e6d90ff899342734d9ecfda59394daa42
misc: pci_endpoint_test: Add consecutive BAR test

Add a more advanced BAR test that writes all BARs in one go, and then reads
them back and verifies that the value matches the BAR number bitwise OR'ed
with offset, this allows us to verify:

  - The BAR number was what we intended to read
  - The offset was what we intended to read

This allows us to detect potential address translation issues on the EP.

Reading back the BAR directly after writing will not allow us to detect the
case where inbound address translation on the endpoint incorrectly causes
multiple BARs to be redirected to the same memory region (within the EP).

Link: https://lore.kernel.org/r/20241116032045.2574168-2-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/misc/pci_endpoint_test.c
include/uapi/linux/pcitest.h
tools/pci/pcitest.c
tools/pci/pcitest.sh