qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] virtio-mem: Implement support for suspend+wake-up with plugged memory
@ 2024-08-06 16:07 Juraj Marcin
  2024-08-06 16:07 ` [PATCH 1/4] reset: Use ResetType for qemu_devices_reset() and MachineClass->reset() Juraj Marcin
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Juraj Marcin @ 2024-08-06 16:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: David Hildenbrand, Peter Maydell

Currently, the virtio-mem device would unplug all the memory with any
reset request, including when the machine wakes up from a suspended
state (deep sleep). This would lead to a loss of the contents of the
guest memory and therefore is disabled by the virtio-mem Linux Kernel
driver unless the VIRTIO_MEM_F_PERSISTENT_SUSPEND virtio feature is
exposed. [1]

To make deep sleep with virtio-mem possible, we need to differentiate
cold start reset from wake-up reset. The first patch updates
qemu_system_reset() and MachineClass children to accept ResetType
instead of ShutdownCause, which then could be passed down the device
tree. The second patch then introduces the new reset type for the
wake-up event and updates the i386 wake-up method (only architecture
using the explicit wake-up method).

The third patch replaces LegacyReset with the Resettable interface in
virtio-mem, so the memory device can access the reset type in the hold
phase. The last patch of the series implements the final support in the
hold phase of the virtio-mem reset callback and exposes
VIRTIO_MEM_F_PERSISTENT_SUSPEND to the kernel.

[1]: https://lore.kernel.org/all/20240318120645.105664-1-david@redhat.com/

Juraj Marcin (4):
  reset: Use ResetType for qemu_devices_reset() and
    MachineClass->reset()
  reset: Add RESET_TYPE_WAKEUP
  virtio-mem: Implement Resettable interface instead of using
    LegacyReset
  virtio-mem: Add support for suspend+wake-up with plugged memory

 docs/devel/reset.rst           |  7 +++++
 hw/arm/aspeed.c                |  4 +--
 hw/arm/mps2-tz.c               |  4 +--
 hw/core/reset.c                |  7 ++---
 hw/hppa/machine.c              |  4 +--
 hw/i386/microvm.c              |  4 +--
 hw/i386/pc.c                   |  6 ++---
 hw/ppc/pegasos2.c              |  4 +--
 hw/ppc/pnv.c                   |  4 +--
 hw/ppc/spapr.c                 |  6 ++---
 hw/s390x/s390-virtio-ccw.c     |  4 +--
 hw/virtio/virtio-mem.c         | 49 ++++++++++++++++++++++++----------
 hw/virtio/virtio-qmp.c         |  3 +++
 include/hw/boards.h            |  3 ++-
 include/hw/resettable.h        |  2 ++
 include/hw/virtio/virtio-mem.h |  4 +++
 include/sysemu/reset.h         |  5 ++--
 system/runstate.c              | 13 +++++++--
 18 files changed, 89 insertions(+), 44 deletions(-)

-- 
2.45.2



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

end of thread, other threads:[~2024-08-09 13:23 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-06 16:07 [PATCH 0/4] virtio-mem: Implement support for suspend+wake-up with plugged memory Juraj Marcin
2024-08-06 16:07 ` [PATCH 1/4] reset: Use ResetType for qemu_devices_reset() and MachineClass->reset() Juraj Marcin
2024-08-06 16:39   ` David Hildenbrand
2024-08-07 10:03     ` Juraj Marcin
2024-08-08 12:32   ` Peter Maydell
2024-08-06 16:07 ` [PATCH 2/4] reset: Add RESET_TYPE_WAKEUP Juraj Marcin
2024-08-06 16:41   ` David Hildenbrand
2024-08-08 12:18   ` Peter Maydell
2024-08-08 15:28     ` Juraj Marcin
2024-08-08 15:31       ` David Hildenbrand
2024-08-08 15:56         ` Peter Maydell
2024-08-08 16:04           ` David Hildenbrand
2024-08-08 16:17             ` Peter Maydell
2024-08-08 16:29               ` David Hildenbrand
2024-08-08 17:30                 ` Peter Maydell
2024-08-08 18:07                   ` David Hildenbrand
2024-08-06 16:07 ` [PATCH 3/4] virtio-mem: Implement Resettable interface instead of using LegacyReset Juraj Marcin
2024-08-06 16:42   ` David Hildenbrand
2024-08-08 12:25   ` Peter Maydell
2024-08-08 12:37     ` David Hildenbrand
2024-08-08 15:47       ` Peter Maydell
2024-08-09 13:06         ` Juraj Marcin
2024-08-06 16:07 ` [PATCH 4/4] virtio-mem: Add support for suspend+wake-up with plugged memory Juraj Marcin
2024-08-06 16:43   ` 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).