[PATCH 0/4] guest_memfd: Fix handling for conversions of MMIO ranges

Michael Roth posted 4 patches 2 days, 18 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260527223036.4614-1-michael.roth@amd.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>
accel/kvm/kvm-all.c | 167 +++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 125 insertions(+), 42 deletions(-)
[PATCH 0/4] guest_memfd: Fix handling for conversions of MMIO ranges
Posted by Michael Roth 2 days, 18 hours ago
This patchset is also available at:

  https://github.com/amdese/qemu/commits/gmem-fix-mmio-conversions-v1

and is based on top of qemu master (3f89b5de5b)


Overview
--------

Calls to kvm_convert_memory() currently only produce the intended behavior
if the entire range is within an MMIO hole/region, or is completely covered
by a guest_memfd-backed region.

In reality this is not the case:

  1) some ranges contain multiple regions (e.g. multiple guest NUMA nodes
     backed by separate guest_memfd backends).
  2) some ranges contain multiple MMIO holes (e.g. a range that contains
     2 non-adjacent regions, or a single region followed by a hole)

These scenarios bring about multiple unhandled corner cases that this series
is meant to address.

The section-by-section processing is also heavily guided by requirements that
will come about when enabling in-place conversion support (where memory
attribute tracking will move down into each guest_memfd instance and further
require region-by-region processing of each range). That will be posted as a
follow-up series based on this patchset.


NOTES/TODO
----------

- If TDX folks could test this that would be appreciated as SNP guests don't
  seem to trigger some of the original cases that were introduced for TDX
  guests and I only have access to SNP systems atm.


Thanks,

Mike

----------------------------------------------------------------
Ashish Kalra (1):
      accel/kvm: Fix kvm_convert_memory() calls crossing memory regions

Michael Roth (3):
      accel/kvm: Add helper for handling conversions of MMIO holes
      accel/kvm: Fix handling of MMIO holes at start of conversion ranges
      accel/kvm: Fix handling of conversion ranges with multiple MMIO holes

 accel/kvm/kvm-all.c | 167 +++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 125 insertions(+), 42 deletions(-)