[PATCH v2 0/5] tests/qtest: Rework libqos PCI BAR handling to support fuzzing

Navid Emamdoost posted 5 patches 2 days, 9 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251127001247.1672873-1-navidem@google.com
Maintainers: John Snow <jsnow@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, Keith Busch <kbusch@kernel.org>, Klaus Jensen <its@irrelevant.dk>, Jesper Devantier <foss@defmacro.it>
tests/qtest/ahci-test.c                 |  8 +++++++
tests/qtest/fuzz/generic_fuzz_configs.h |  8 +++++++
tests/qtest/ide-test.c                  |  2 +-
tests/qtest/libqos/pci.c                | 29 +++++++++++++++++++---
tests/qtest/libqos/pci.h                |  3 ++-
tests/qtest/nvme-test.c                 | 32 ++++++++++++++++++-------
tests/qtest/tco-test.c                  |  2 +-
7 files changed, 69 insertions(+), 15 deletions(-)
[PATCH v2 0/5] tests/qtest: Rework libqos PCI BAR handling to support fuzzing
Posted by Navid Emamdoost 2 days, 9 hours ago
Hi Peter,

Thank you for the excellent feedback on the first version of this series.
I have implemented your suggestions in this new version of the patch series.

The original prerequisite patch (which used #ifdef CONFIG_FUZZ) has been
expanded into a 4-patch series that makes the libqos PCI API safer and more
robust for all use cases. This involved fixing several tests in the suite
that were performing invalid memory accesses, which the new API now
correctly catches.

The final patch in the series, which adds the pcie-pci-bridge fuzzer,
remains unchanged.

---

Changes in v2:

- Reworked the prerequisite from a single #ifdef-based patch into a
4-patch series that improves the core libqos API.
- (1/5) The core change now adds a size field to QPCIBar and moves
bounds checking into the accessor functions.
- (2/5) The qpci_legacy_iomap function is updated to require a size,
and its callers (ide-test, tco-test) are fixed.
- (3/5) ahci-test is fixed to check only implemented ports.
- (4/5) nvme-test is reworked to be compatible with the new strict
BAR checks.
- (5/5) The fuzzer patch is unchanged.


Navid Emamdoost (5):
  libqos: pci: Handle zero-sized BARs gracefully
  libqos: pci: Require size for legacy I/O port mapping
  tests/qtest: ahci-test: Check only implemented ports in verify_state
  tests/qtest: Rework nvmetest_oob_cmb_test for BAR check
  tests/qtest/fuzz: Add generic fuzzer for pcie-pci-bridge

 tests/qtest/ahci-test.c                 |  8 +++++++
 tests/qtest/fuzz/generic_fuzz_configs.h |  8 +++++++
 tests/qtest/ide-test.c                  |  2 +-
 tests/qtest/libqos/pci.c                | 29 +++++++++++++++++++---
 tests/qtest/libqos/pci.h                |  3 ++-
 tests/qtest/nvme-test.c                 | 32 ++++++++++++++++++-------
 tests/qtest/tco-test.c                  |  2 +-
 7 files changed, 69 insertions(+), 15 deletions(-)

-- 
2.52.0.158.g65b55ccf14-goog