qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] softmmu/memory_mapping: optimize dump/tpm for virtio-mem
@ 2021-07-26 16:03 David Hildenbrand
  2021-07-26 16:03 ` [PATCH v3 1/4] tpm: mark correct memory region range dirty when clearing RAM David Hildenbrand
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: David Hildenbrand @ 2021-07-26 16:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Stefan Berger, Eduardo Habkost,
	David Hildenbrand, Michael S. Tsirkin, Dr. David Alan Gilbert,
	Peter Xu, Alex Williamson, Paolo Bonzini, Claudio Fontana,
	Marc-André Lureau, Igor Mammedov, Alex Bennée,
	Stefan Berger

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.

v2 -> v4:
- "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(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH v3 0/4] softmmu/memory_mapping: optimize dump/tpm for virtio-mem
@ 2021-07-21  8:38 David Hildenbrand
  2021-07-21  8:38 ` [PATCH v3 3/4] softmmu/memory_mapping: factor out adding physical memory ranges David Hildenbrand
  0 siblings, 1 reply; 8+ messages in thread
From: David Hildenbrand @ 2021-07-21  8:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Stefan Berger, Eduardo Habkost,
	David Hildenbrand, Michael S. Tsirkin, Dr. David Alan Gilbert,
	Peter Xu, Alex Williamson, Paolo Bonzini, Claudio Fontana,
	Marc-André Lureau, Igor Mammedov, Alex Bennée,
	Stefan Berger

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 RamDiscardManager 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 RamDiscardManager infrastructure
introduced to handle virtio-mem + VFIO properly.

v2 -> v3:
- "softmmu/memory_mapping: reuse qemu_get_guest_simple_memory_mapping()"
-- Dropped
- Assed ACKs / RBs

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         |  4 ++-
 softmmu/memory_mapping.c | 64 ++++++++++++++++++++++++++--------------
 2 files changed, 45 insertions(+), 23 deletions(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-26 17:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26 16:03 [PATCH v3 0/4] softmmu/memory_mapping: optimize dump/tpm for virtio-mem David Hildenbrand
2021-07-26 16:03 ` [PATCH v3 1/4] tpm: mark correct memory region range dirty when clearing RAM David Hildenbrand
2021-07-26 16:57   ` Peter Xu
2021-07-26 16:58     ` David Hildenbrand
2021-07-26 16:03 ` [PATCH v3 2/4] softmmu/memory_mapping: never merge ranges accross memory regions David Hildenbrand
2021-07-26 16:03 ` [PATCH v3 3/4] softmmu/memory_mapping: factor out adding physical memory ranges David Hildenbrand
2021-07-26 16:03 ` [PATCH v3 4/4] softmmu/memory_mapping: optimize for RamDiscardManager sections David Hildenbrand
  -- strict thread matches above, loose matches on Subject: below --
2021-07-21  8:38 [PATCH v3 0/4] softmmu/memory_mapping: optimize dump/tpm for virtio-mem David Hildenbrand
2021-07-21  8:38 ` [PATCH v3 3/4] softmmu/memory_mapping: factor out adding physical memory ranges David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).