qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 8d018f: virtio: kconfig: memory devices are P


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 8d018f: virtio: kconfig: memory devices are PCI only
Date: Fri, 27 Sep 2024 02:32:18 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 8d018fe59a0beff580ac6b3399d642c4277d9dd0
      
https://github.com/qemu/qemu/commit/8d018fe59a0beff580ac6b3399d642c4277d9dd0
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2024-09-24 (Tue, 24 Sep 2024)

  Changed paths:
    M hw/virtio/Kconfig

  Log Message:
  -----------
  virtio: kconfig: memory devices are PCI only

Virtio memory devices rely on PCI BARs to expose the contents of memory.
Because of this they cannot be used (yet) with virtio-mmio or virtio-ccw.
In fact the code that is common to virtio-mem and virtio-pmem, which
is in hw/virtio/virtio-md-pci.c, is only included if CONFIG_VIRTIO_PCI
is set.  Reproduce the same condition in the Kconfig file, only allowing
VIRTIO_MEM and VIRTIO_PMEM to be defined if the transport supports it.

Without this patch it is possible to create a configuration with
CONFIG_VIRTIO_PCI=n and CONFIG_VIRTIO_MEM=y, but that causes a
linking failure.

Message-ID: <20240906101658.514470-1-pbonzini@redhat.com>
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: 1b063fe2df002052cc2d10799764979b8c583480
      
https://github.com/qemu/qemu/commit/1b063fe2df002052cc2d10799764979b8c583480
  Author: Juraj Marcin <jmarcin@redhat.com>
  Date:   2024-09-24 (Tue, 24 Sep 2024)

  Changed paths:
    M hw/arm/aspeed.c
    M hw/arm/mps2-tz.c
    M hw/core/reset.c
    M hw/hppa/machine.c
    M hw/i386/microvm.c
    M hw/i386/pc.c
    M hw/ppc/pegasos2.c
    M hw/ppc/pnv.c
    M hw/ppc/spapr.c
    M hw/s390x/s390-virtio-ccw.c
    M include/hw/boards.h
    M include/sysemu/reset.h
    M system/runstate.c

  Log Message:
  -----------
  reset: Use ResetType for qemu_devices_reset() and MachineClass::reset()

Currently, both qemu_devices_reset() and MachineClass::reset() use
ShutdownCause for the reason of the reset. However, the Resettable
interface uses ResetState, so ShutdownCause needs to be translated to
ResetType somewhere. Translating it qemu_devices_reset() makes adding
new reset types harder, as they cannot always be matched to a single
ShutdownCause here, and devices may need to check the ResetType to
determine what to reset and if to reset at all.

This patch moves this translation up in the call stack to
qemu_system_reset() and updates all MachineClass children to use the
ResetType instead.

Message-ID: <20240904103722.946194-2-jmarcin@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: 759cbb4ee971da13ddfa8ad73befc2351d542044
      
https://github.com/qemu/qemu/commit/759cbb4ee971da13ddfa8ad73befc2351d542044
  Author: Juraj Marcin <jmarcin@redhat.com>
  Date:   2024-09-24 (Tue, 24 Sep 2024)

  Changed paths:
    M docs/devel/reset.rst
    M hw/i386/pc.c
    M include/hw/resettable.h

  Log Message:
  -----------
  reset: Add RESET_TYPE_WAKEUP

Some devices need to distinguish cold start reset from waking up from a
suspended state. This patch adds new value to the enum, and updates the
i386 wakeup method to use this new reset type.

Message-ID: <20240904103722.946194-3-jmarcin@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: c009a311e93963860cfba917605a4bf903a06bce
      
https://github.com/qemu/qemu/commit/c009a311e93963860cfba917605a4bf903a06bce
  Author: Juraj Marcin <jmarcin@redhat.com>
  Date:   2024-09-24 (Tue, 24 Sep 2024)

  Changed paths:
    M hw/virtio/virtio-mem.c
    M include/hw/virtio/virtio-mem.h

  Log Message:
  -----------
  virtio-mem: Use new Resettable framework instead of LegacyReset

LegacyReset does not pass ResetType to the reset callback method, which
the new Resettable framework uses. Due to this, virtio-mem cannot use
the new RESET_TYPE_WAKEUP to skip the reset during wake-up from a
suspended state.

This patch adds overrides Resettable interface methods in VirtIOMEMClass
to use the new Resettable framework and replaces
qemu_[un]register_reset() calls with qemu_[un]register_resettable().

Message-ID: <20240904103722.946194-4-jmarcin@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: 1f5f49056d0f140568805d66f33396ed5cd90369
      
https://github.com/qemu/qemu/commit/1f5f49056d0f140568805d66f33396ed5cd90369
  Author: Juraj Marcin <jmarcin@redhat.com>
  Date:   2024-09-24 (Tue, 24 Sep 2024)

  Changed paths:
    M hw/virtio/virtio-mem.c
    M hw/virtio/virtio-qmp.c

  Log Message:
  -----------
  virtio-mem: Add support for suspend+wake-up with plugged memory

Before, the virtio-mem device would unplug all the memory with any reset
of the device, including during the wake-up of the guest from a
suspended state. Due to this, the virtio-mem driver in the Linux kernel
disallowed suspend-to-ram requests in the guest when the
VIRTIO_MEM_F_PERSISTENT_SUSPEND feature is not exposed by QEMU.

This patch adds the code to skip the reset on wake-up and exposes
theVIRTIO_MEM_F_PERSISTENT_SUSPEND feature to the guest kernel driver
when suspending is possible in QEMU (currently only x86).

Message-ID: <20240904103722.946194-5-jmarcin@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: 78c8f780d3f0d6d17aa93d6f99ff72960080fdd7
      
https://github.com/qemu/qemu/commit/78c8f780d3f0d6d17aa93d6f99ff72960080fdd7
  Author: Gavin Shan <gshan@redhat.com>
  Date:   2024-09-24 (Tue, 24 Sep 2024)

  Changed paths:
    M backends/hostmem.c

  Log Message:
  -----------
  hostmem: Apply merge property after the memory region is initialized

The semantic change has been introduced by commit 5becdc0ab0 ("hostmem:
simplify the code for merge and dump properties") even it clarifies that
no senmatic change has been introduced. After the commit, the merge
property can be applied even the corresponding memory region isn't
initialized yet. This leads to crash dump by the following command
lines.

  # /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64  \
    -accel kvm  -machine virt -cpu host                      \
    -object memory-backend-ram,id=mem-memN0,size=4096M,merge=off
    :
    qemu-system-aarch64: ../system/memory.c:2419: memory_region_get_ram_ptr: \
    Assertion `mr->ram_block' failed.

Fix it by applying the merge property only when the memory region is
initialized.

Message-ID: <20240915233117.478169-1-gshan@redhat.com>
Fixes: 5becdc0ab083 ("hostmem: simplify the code for merge and dump properties")
Reported-by: Zhenyu Zhang <zhenyzha@redhat.com>
Tested-by: Zhenyu Zhang <zhenyzha@redhat.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: e10cd93872c31332b002c933a798ab0bc51705a4
      
https://github.com/qemu/qemu/commit/e10cd93872c31332b002c933a798ab0bc51705a4
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-09-26 (Thu, 26 Sep 2024)

  Changed paths:
    M backends/hostmem.c
    M docs/devel/reset.rst
    M hw/arm/aspeed.c
    M hw/arm/mps2-tz.c
    M hw/core/reset.c
    M hw/hppa/machine.c
    M hw/i386/microvm.c
    M hw/i386/pc.c
    M hw/ppc/pegasos2.c
    M hw/ppc/pnv.c
    M hw/ppc/spapr.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/virtio/Kconfig
    M hw/virtio/virtio-mem.c
    M hw/virtio/virtio-qmp.c
    M include/hw/boards.h
    M include/hw/resettable.h
    M include/hw/virtio/virtio-mem.h
    M include/sysemu/reset.h
    M system/runstate.c

  Log Message:
  -----------
  Merge tag 'mem-2024-09-24' of https://github.com/davidhildenbrand/qemu into 
staging

Hi,

"Host Memory Backends" and "Memory devices" queue ("mem"):
- Kconfig fix for virtio-based memory devices
- virtio-mem support for suspend+wake-up with plugged memory
- hostmem fix when specifying "merge=off"

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEG9nKrXNcTDpGDfzKTd4Q9wD/g1oFAmbyikMRHGRhdmlkQHJl
# ZGhhdC5jb20ACgkQTd4Q9wD/g1q6MBAAitNST73Shc+j327WvRLHQDkzkAlIYm+M
# E8NqtDiV11h7A0eNVu+5BkY/ejtY0Fduae3nxIkrHjK20eHHpiNPUp3hBNIhkKs3
# vlSaU8FLGdt58CteMGcLYsP2E32WNNTckaFGwGjDmyUEfk+Gug4r/rJAZXDfuuLV
# 083I0/MuUF+ozPA0c2MrOwhoBPerg3a5aflVpbgPwGNrT9BHMjo62Q5QzG3U7mxr
# HnlLAScSXsYg2z+d5XLXkKLAiZ4C7UN4vfUAOZwqkfs7IFUTtFO/ev6e7VZI747n
# XhAqOAKzLqPu7tBPZJIC6jwZAUIv5yM0/v5qhVvVVdu7H0ZMtSCXyvCVtnT25Rsn
# yiA+XvCOb7yQ3hRbBIi60IzjNYfWbvw+oTVIDfXkG35TeNf4ZdjWtAiUmw9s5U9Q
# z0tINsD7VlSkbh5h3PkFw1+xagIuJAVkp673HHTtQsg+xgYK2ur5jhhWJdJlnpzA
# 77CAu07UaqU39ssnC2zeGG1eNRA4uzjwQtREzqH2jMfkw/7UuUeXMF+v/fEuLn6w
# JneSMq/a0gmD42HNae0Y40cn2Akfj6+wFu1rW3djF8F6TeLUSssQhbQSHCMwGoOg
# qX7O/3SeSRzlnp3Zyx9Tr7s+BkMz0EGGDe17GQwTQUX2t5wR5iXoGqpKZgOBA8En
# 6uUIcjBUckc=
# =PExj
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 24 Sep 2024 10:45:39 BST
# gpg:                using RSA key 1BD9CAAD735C4C3A460DFCCA4DDE10F700FF835A
# gpg:                issuer "david@redhat.com"
# gpg: Good signature from "David Hildenbrand <david@redhat.com>" [marginal]
# gpg:                 aka "David Hildenbrand <davidhildenbrand@gmail.com>" 
[full]
# gpg:                 aka "David Hildenbrand <hildenbr@in.tum.de>" [unknown]
# Primary key fingerprint: 1BD9 CAAD 735C 4C3A 460D  FCCA 4DDE 10F7 00FF 835A

* tag 'mem-2024-09-24' of https://github.com/davidhildenbrand/qemu:
  hostmem: Apply merge property after the memory region is initialized
  virtio-mem: Add support for suspend+wake-up with plugged memory
  virtio-mem: Use new Resettable framework instead of LegacyReset
  reset: Add RESET_TYPE_WAKEUP
  reset: Use ResetType for qemu_devices_reset() and MachineClass::reset()
  virtio: kconfig: memory devices are PCI only

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/a53b93164518...e10cd93872c3

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



reply via email to

[Prev in Thread] Current Thread [Next in Thread]