From: Sergio Lopez <slp@redhat.com>
To: virtio-comment@lists.linux.dev
Cc: dmitry.osipenko@collabora.com, parav@nvidia.com, mst@redhat.com,
Sergio Lopez <slp@redhat.com>
Subject: [PATCH v2 0/3] shared-mem: introduce page alignment restrictions
Date: Mon, 31 Mar 2025 11:05:45 -0400 [thread overview]
Message-ID: <20250331150548.50595-1-slp@redhat.com> (raw)
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.
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/20250214-virtio-shm-page-size-v2-0-aa1619e6908b@redhat.com/
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
shared-mem.tex | 6 ++++++
transport-mmio.tex | 8 ++++++++
transport-pci.tex | 10 +++++++++-
3 files changed, 23 insertions(+), 1 deletion(-)
--
2.49.0
next reply other threads:[~2025-03-31 15:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 15:05 Sergio Lopez [this message]
2025-03-31 15:05 ` [PATCH v2 1/3] shared-mem: introduce page alignment restrictions Sergio Lopez
2025-03-31 16:16 ` Michael S. Tsirkin
2025-03-31 16:40 ` Sergio Lopez Pascual
2025-04-01 9:14 ` Michael S. Tsirkin
2025-04-01 9:22 ` Parav Pandit
2025-04-01 9:33 ` Sergio Lopez Pascual
2025-04-01 9:37 ` Parav Pandit
2025-04-01 10:18 ` Michael S. Tsirkin
2025-04-02 9:04 ` Parav Pandit
2025-04-01 9:26 ` Sergio Lopez Pascual
2025-04-01 10:09 ` Michael S. Tsirkin
2025-04-01 10:46 ` Sergio Lopez Pascual
2025-03-31 15:05 ` [PATCH v2 2/3] transport-pci: introduce page_shift field for SHM Sergio Lopez
2025-03-31 15:05 ` [PATCH v2 3/3] transport-mmio: introduce SHMPageShift register Sergio Lopez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250331150548.50595-1-slp@redhat.com \
--to=slp@redhat.com \
--cc=dmitry.osipenko@collabora.com \
--cc=mst@redhat.com \
--cc=parav@nvidia.com \
--cc=virtio-comment@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox