Skip to content

hw/pci: reserve IO and mem for pci-2-pci bridges with no devices attached

Marcel Apfelbaum qemu-devel 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 posting 2/21 patch 5 repliesIn review
  2. v6 Latest2 patches 2 repliesIn review
  3. v52 patches 2 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v42 patches2 repliesSuperseded
v3 posting 1/22 patches6 repliesSuperseded
v21 patch0 repliesSuperseded
v11 patch14 repliesSuperseded

Changes in v6 from the cover letter

- Minor, fixed a typo in the subject

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2hw/pci: reserve IO and mem for pci-2-pci bridges with no devices attachedsrc/fw/pciinit.c src/hw/pci.c src/hw/pci.h+23 -01 reply
2/2hw/pci: check if pci2pci bridges implement optional limit registerssrc/fw/pciinit.c src/hw/pci.c src/hw/pci.h+37 -71 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMichael S. Tsirkin
1/2R-b A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [Qemu-devel] [PATCH V6 0/2] hw/pci: reserve IO and mem for pci-2-pci bridges with no devices attached

v5 -> v6:
- Minor, fixed a typo in the subject

v4 -> v5
- Addressed Michael S. Tsirkin's comments (patch 2/2):
- Open-coded pci_config_is_reserved() method.

v3 -> v4:
- Addressed Kevin O'Connor's comments:
- Refactored a for loop in patch 1/2.
- Addressed Michael S. Tsirkin's comments (patch 2/2):
- Removed not needed method
- Test only base registers (dropped limits tests)
- Renamed a helper method
- Used 0xFF to test if the memory is reserved
- Simplified code in pci_bridge_has_region
- I did keep the code that restores base's address as I don't want to modify the registers in a 'query' method. (as replied on the mail thread)

v2 -> v3:
- Addressed Michael S. Tsirkin's comments:
- I/O and Prefetchable Memory are optional. Do not allocate ranges if they are not implemented (2/2).
- Note that 2/2 patch can be seen as a separate fix. However, it is related to ranges reservation.

v1 -> v2:
- Thanks Gerd Hoffmann for the review.
- Addressed Michael S. Tsirkin's comments:
- Limit capabilities query to 256 iterations, to make sure we don't get into an infinite loop with a broken device.

If a pci-2-pci bridge supports hot-plug functionality but there are no devices connected to it, reserve IO/mem in order to be able to attach devices later. Do not waste space, use minimum allowed.

Marcel Apfelbaum (2):
hw/pci: reserve IO and mem for pci-2-pci bridges with no devices
attached
hw/pci: check if pci2pci bridges implement optional limit registers

 src/fw/pciinit.c | 12 +++++-------
 src/hw/pci.c     | 45 +++++++++++++++++++++++++++++++++++++++++++++
 src/hw/pci.h     | 10 ++++++++++
 3 files changed, 60 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.3.1