Skip to content

softmmu/memory_mapping: optimize dump/tpm for virtio-mem

David Hildenbrand qemu-devel 6 versions – Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 3 repliesApplied
  2. v3 posting 2/24 patches 2 repliesSuperseded
  3. v3 posting 1/24 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v2 posting 2/25 patches16 repliesSuperseded
v2 posting 1/25 patches0 repliesSuperseded
v15 patches1 replySuperseded

Changes in v4 from the cover letter

- "tpm: mark correct memory region range dirty when clearing RAM" -- Finally get it right :) I tried triggering that code without luck. So I ended up forcing that call path, verifying that the offset into memory regions is now correct.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/4tpm: mark correct memory region range dirty when clearing RAMhw/tpm/tpm_ppi.c+4 -11 reply
2/4softmmu/memory_mapping: never merge ranges accross memory regionssoftmmu/memory_mapping.c+2 -10 replies
3/4softmmu/memory_mapping: factor out adding physical memory rangessoftmmu/memory_mapping.c+20 -210 replies
4/4softmmu/memory_mapping: optimize for RamDiscardManager sectionssoftmmu/memory_mapping.c+20 -00 replies

Reviews trailers per patch

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

PatchStefan BergerPeter Xu
1/4A-b R-b
2/4A-b R-b
3/4R-b R-b
4/4R-b

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

Read the v4 thread

Cover letter [PATCH v4 0/4] softmmu/memory_mapping: optimize dump/tpm for virtio-mem

Minor fixes and cleanups, followed by an optimization for virtio-mem regarding guest dumps and tpm.

virtio-mem logically plugs/unplugs memory within a sparse memory region and notifies via the RamDiscardMgr interface when parts become plugged (populated) or unplugged (discarded).

Currently, guest_phys_blocks_append() appends the whole (sparse) virtio-mem managed region and therefore tpm code might zero the hole region and dump code will dump the whole region. Let's only add logically plugged (populated) parts of that region, skipping over logically unplugged (discarded) parts by reusing the RamDiscardMgr infrastructure introduced to handle virtio-mem + VFIO properly.

v3 -> v4:
- "tpm: mark correct memory region range dirty when clearing RAM" -- Finally get it right :) I tried triggering that code without luck. So I ended up forcing that call path, verifying that the offset into memory regions is now correct.

v2 -> v3:
- "tpm: mark correct memory region range dirty when clearing RAM" -- Fix calculation of offset into memory region (thanks Peter!)
- "softmmu/memory_mapping: reuse qemu_get_guest_simple_memory_mapping()" -- Dropped

v1 -> v2:
- "softmmu/memory_mapping: factor out adding physical memory ranges" -- Simplify based on RamDiscardManager changes: add using a MemoryRegionSection
- "softmmu/memory_mapping: optimize for RamDiscardManager sections" -- Simplify based on RamDiscardManager changes

David Hildenbrand (4):
tpm: mark correct memory region range dirty when clearing RAM softmmu/memory_mapping: never merge ranges accross memory regions softmmu/memory_mapping: factor out adding physical memory ranges softmmu/memory_mapping: optimize for RamDiscardManager sections

 hw/tpm/tpm_ppi.c         |  5 +++-
 softmmu/memory_mapping.c | 64 ++++++++++++++++++++++++++--------------
 2 files changed, 46 insertions(+), 23 deletions(-)
Signature · 1 line
2.31.1