virtio: pci: Add and fix consistency checks
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest18 patches 6 repliesIn review
- v218 patches 30 repliesSuperseded
- v111 patches 23 repliesSuperseded
Changes in v3 from the cover letter
- Use CI to test more targets
- Move EA config patch to end for dropping if needed
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | virtio: pci: Allow exclusion of legacy driverdrivers/ drivers/ | +11 | 1 reply | |
| 2/18 | virtio: pci: Fix discovery of device config lengthdrivers/ | +1 | 0 replies | |
| 3/18 | virtio: pci: Bounds check device config accessdrivers/ | +12 | 0 replies | |
| 4/18 | virtio: pci: Bounds check notification writesdrivers/ | +15 | 0 replies | |
| 5/18 | virtio: pci: Check virtio common config sizedrivers/ | +8 | 0 replies | |
| 6/18 | virtio: pci: Check virtio capability is in boundsdrivers/ | +16 | 0 replies | |
| 7/18 | virtio: pci: Read entire capability into memorydrivers/ | +38 | 0 replies | |
| 8/18 | pci: Fix use of flags in dm_pci_map_bar()drivers/ include/ | +6 | 1 reply | |
| 9/18 | pci: Check region ranges are addressabledrivers/ | +16 | 0 replies | |
| 10/18 | pci: Range check address conversionsdrivers/ include/ | +46 | 0 replies | |
| 11/18 | test: pci: Test PCI address conversion functionsarch/ test/ | +103 | 1 reply | |
| 12/18 | pci: Map bars with offset and lengtharch/ drivers/ drivers/ +30 more | +67 | 1 reply | |
| 13/18 | pci: Match region flags using a maskdrivers/ include/ test/ | +67 | 0 replies | |
| 14/18 | pci: Update dm_pci_bus_to_virt() parametersdrivers/ drivers/ include/ | +15 | 1 reply | |
| 15/18 | pci: Add mask parameter to dm_pci_map_bar()arch/ drivers/ drivers/ +30 more | +61 | 1 reply | |
| 16/18 | virtio: pci: Check virtio configs are mappeddrivers/ | +17 | 0 replies | |
| 17/18 | virtio: pci: Make use of dm_pci_map_bar()drivers/ | +8 | 0 replies | |
| 18/18 | pci: Add config for Enhanced Allocationdrivers/ drivers/ | +17 | 0 replies |
Reviews trailers per patch
17 of 18 patches have a Reviewed-by or Acked-by.
| Patch | Bin Meng |
|---|---|
| 1/18 | R-b |
| 2/18 | R-b |
| 3/18 | R-b |
| 4/18 | R-b |
| 5/18 | R-b |
| 6/18 | R-b |
| 7/18 | R-b |
| 8/18 | R-b |
| 9/18 | R-b |
| 10/18 | R-b |
| 11/18 | R-b |
| 12/18 | R-b |
| 13/18 | R-b |
| 14/18 | R-b |
| 15/18 | R-b |
| 16/18 | R-b |
| 17/18 | R-b |
| 18/18 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 00/18] virtio: pci: Add and fix consistency checks
The virtio PCI drivers forgo a number of consistency checks, particularly around pointer validation and bounds checking. This series focuses on the modern driver to add those checks.
The start of the series adds and fixes some basic bounds checks. Later patches ensure PCI addresses fall within the expected regions rather than any arbitrary address. This is acheived by introducing range parameters to a few of the dm_pci_* functions that allow the ranges to be checked.
The series also adds a few new configs to allow parts of virtio and PCI to be disabled where the features may be unused and the current implementations don't have the needed consistencty checks.
Changelog:
v2:
- Refactor dm_pci_* functions, not adding new ones
- Reorder patches per request in v1
v3:
- Use CI to test more targets
- Move EA config patch to end for dropping if needed
Andrew Scull (18):
virtio: pci: Allow exclusion of legacy driver
virtio: pci: Fix discovery of device config length
virtio: pci: Bounds check device config access
virtio: pci: Bounds check notification writes
virtio: pci: Check virtio common config size
virtio: pci: Check virtio capability is in bounds
virtio: pci: Read entire capability into memory
pci: Fix use of flags in dm_pci_map_bar()
pci: Check region ranges are addressable
pci: Range check address conversions
test: pci: Test PCI address conversion functions
pci: Map bars with offset and length
pci: Match region flags using a mask
pci: Update dm_pci_bus_to_virt() parameters
pci: Add mask parameter to dm_pci_map_bar()
virtio: pci: Check virtio configs are mapped
virtio: pci: Make use of dm_pci_map_bar()
pci: Add config for Enhanced Allocation
arch/sandbox/dts/test.dts | 2 +- arch/x86/cpu/baytrail/cpu.c | 2 +- drivers/ata/ahci.c | 9 +- drivers/ata/sata_sil.c | 6 +- drivers/bios_emulator/atibios.c | 4 +- drivers/gpio/octeon_gpio.c | 2 +- drivers/i2c/designware_i2c_pci.c | 3 +- drivers/i2c/intel_i2c.c | 2 +- drivers/i2c/octeon_i2c.c | 2 +- drivers/mmc/octeontx_hsmmc.c | 2 +- drivers/mmc/pci_mmc.c | 2 +- drivers/mtd/nand/raw/octeontx_bch.c | 6 +- drivers/mtd/nand/raw/octeontx_nand.c | 2 +- drivers/net/bnxt/bnxt.c | 9 +- drivers/net/e1000.c | 4 +- drivers/net/fsl_enetc.c | 2 +- drivers/net/fsl_enetc_mdio.c | 2 +- drivers/net/mscc_eswitch/felix_switch.c | 4 +- drivers/net/octeontx/bgx.c | 2 +- drivers/net/octeontx/nic_main.c | 2 +- drivers/net/octeontx/nicvf_main.c | 2 +- drivers/net/octeontx/smi.c | 2 +- drivers/net/octeontx2/cgx.c | 2 +- drivers/net/octeontx2/rvu_af.c | 2 +- drivers/net/octeontx2/rvu_pf.c | 3 +- drivers/net/pch_gbe.c | 2 +- drivers/nvme/nvme_pci.c | 4 +- drivers/pci/Kconfig | 7 + drivers/pci/pci-uclass.c | 185 +++++++++++------------- drivers/spi/octeon_spi.c | 2 +- drivers/usb/host/ehci-pci.c | 3 +- drivers/usb/host/ohci-pci.c | 2 +- drivers/usb/host/xhci-pci.c | 3 +- drivers/virtio/Kconfig | 9 ++ drivers/virtio/Makefile | 3 +- drivers/virtio/virtio_pci_legacy.c | 3 +- drivers/virtio/virtio_pci_modern.c | 143 ++++++++++++------ include/pci.h | 46 ++++-- test/dm/pci.c | 118 ++++++++++++++- 39 files changed, 401 insertions(+), 209 deletions(-)
Signature · 1 line
2.36.0.rc2.479.g8af0fa9b8e-goog