shared-mem: introduce page alignment restrictions
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 10 repliesIn review
- v23 patches 11 repliesSuperseded
- v13 patches 10 repliesSuperseded
Changes in v3 from the cover letter
- Reintroduce the VIRTIO_F_SHM_PAGE_SIZE feature bit, but limit its scope to page alignment restrictions, still exposing page shift data in the transports unconditionally (thanks Michael S. Tsirkin)
- Adjust the feature bits to reflect we're using another one (thanks Parav Pandit).
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | shared-mem: introduce page alignment restrictionscontent.tex shared-mem.tex | +15 | 2 replies | |
| 2/3 | transport-pci: introduce page_shift field for SHMtransport-pci.tex | +9 | 0 replies | |
| 3/3 | transport-mmio: introduce SHMPageShift registertransport-mmio.tex | +8 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/3] shared-mem: introduce page alignment restrictions
There's an incresing number of machines supporting multiple page sizes and, on these machines, the host and a guest can be running with different pages sizes.
In addition to this, there might be devices that have a required and/or preferred page size for mapping memory.
In this series we extend the "Shared Memory Regions" with a subsection explaining the posible existence of page alignment restrictions when the VIRTIO_F_SHM_PAGE_SIZE feature has been negotiated.
For the device to provide the page size information to the driver, we need to extend the PCI and MMIO transports. For the former, we borrow 8 bits from the 16 bit padding in virtio_pci_cap to hold a page_shift field which can be used to derive the page size by using the following
formula: (page_size = 1 << (page_shift + 12)).
For MMIO, we add a the SHMPageShift register at offset 0x0c4, also holding the page_shift value. Since MMIO registers are 32 bit wide, we could have asked the device to directly provide page_size instead of page_shift, but seems reasonable to be consistent across transports.
An implementation of the changes proposed in this series has been published as an RFC to the LKML, to be used as a reference:
https://lore.kernel.org/all/[email protected]/
v3:
- Reintroduce the VIRTIO_F_SHM_PAGE_SIZE feature bit, but limit its scope to page alignment restrictions, still exposing page shift data in the transports unconditionally (thanks Michael S. Tsirkin)
- Adjust the feature bits to reflect we're using another one (thanks Parav Pandit).
v2:
- Remove the VIRTIO_F_SHM_PAGE_SIZE feature bit, exposing page_shift in the transports unconditionally (thanks Parav Pandit).
- Didn't pick up R-b due to the significant change between revisions.
Sergio Lopez (3):
shared-mem: introduce page alignment restrictions
transport-pci: introduce page_shift field for SHM
transport-mmio: introduce SHMPageShift register
content.tex | 10 ++++++++-- shared-mem.tex | 7 +++++++ transport-mmio.tex | 8 ++++++++ transport-pci.tex | 10 +++++++++- 4 files changed, 32 insertions(+), 3 deletions(-)
Signature · 1 line
2.49.0