qemu-kvm/kvm-virtio-kconfig-memory-devices-are-PCI-only.patch
Jon Maloy eace179c9a * Mon Apr 14 2025 Jon Maloy <jmaloy@redhat.com> - 9.1.0-18
- kvm-virtio-kconfig-memory-devices-are-PCI-only.patch [RHEL-72977]
- kvm-hw-s390-ccw-device-Convert-to-three-phase-reset.patch [RHEL-72977]
- kvm-hw-s390-virtio-ccw-Convert-to-three-phase-reset.patch [RHEL-72977]
- kvm-target-s390-Convert-CPU-to-Resettable-interface.patch [RHEL-72977]
- kvm-reset-Use-ResetType-for-qemu_devices_reset-and-Machi.patch [RHEL-72977]
- kvm-reset-Add-RESET_TYPE_WAKEUP.patch [RHEL-72977]
- kvm-virtio-mem-Use-new-Resettable-framework-instead-of-L.patch [RHEL-72977]
- kvm-virtio-mem-Add-support-for-suspend-wake-up-with-plug.patch [RHEL-72977]
- kvm-virtio-mem-unplug-memory-only-during-system-resets-n.patch [RHEL-72977]
- kvm-s390x-s390-virtio-ccw-don-t-crash-on-weird-RAM-sizes.patch [RHEL-72977]
- kvm-s390x-s390-virtio-hcall-remove-hypercall-registratio.patch [RHEL-72977]
- kvm-s390x-s390-virtio-hcall-prepare-for-more-diag500-hyp.patch [RHEL-72977]
- kvm-s390x-rename-s390-virtio-hcall-to-s390-hypercall.patch [RHEL-72977]
- kvm-s390x-s390-virtio-ccw-move-setting-the-maximum-guest.patch [RHEL-72977]
- kvm-s390x-introduce-s390_get_memory_limit.patch [RHEL-72977]
- kvm-s390x-s390-hypercall-introduce-DIAG500-STORAGE_LIMIT.patch [RHEL-72977]
- kvm-s390x-s390-stattrib-kvm-prepare-for-memory-devices-a.patch [RHEL-72977]
- kvm-s390x-s390-skeys-prepare-for-memory-devices.patch [RHEL-72977]
- kvm-s390x-s390-virtio-ccw-prepare-for-memory-devices.patch [RHEL-72977]
- kvm-s390x-pv-prepare-for-memory-devices.patch [RHEL-72977]
- kvm-s390x-remember-the-maximum-page-size.patch [RHEL-72977]
- kvm-s390x-virtio-ccw-add-support-for-virtio-based-memory.patch [RHEL-72977]
- kvm-s390x-virtio-mem-support.patch [RHEL-72977]
- kvm-hw-virtio-Also-include-md-stubs-in-case-CONFIG_VIRTI.patch [RHEL-72977]
- kvm-virtio-mem-don-t-warn-about-THP-sizes-on-a-kernel-wi.patch [RHEL-72977]
- kvm-redhat-Enable-virtio-mem-on-s390x.patch [RHEL-72977]
- Resolves: RHEL-72977
  ([IBM 9.7 FEAT] KVM: Enable virtio-mem support - qemu part)
2025-04-14 18:57:58 -04:00

88 lines
2.7 KiB
Diff

From a582cf6f68febba05e20548f643c8be637eab7b8 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Fri, 6 Sep 2024 12:16:58 +0200
Subject: [PATCH 01/26] virtio: kconfig: memory devices are PCI only
RH-Author: Thomas Huth <thuth@redhat.com>
RH-MergeRequest: 351: Enable virtio-mem support on s390x
RH-Jira: RHEL-72977
RH-Acked-by: David Hildenbrand <david@redhat.com>
RH-Acked-by: Juraj Marcin <None>
RH-Commit: [1/26] 0f0eab06b6f79f84c2e8d4fee28309b3c7c57414 (thuth/qemu-kvm-cs)
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>
(cherry picked from commit 8d018fe59a0beff580ac6b3399d642c4277d9dd0)
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/virtio/Kconfig | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/virtio/Kconfig b/hw/virtio/Kconfig
index aa63ff7fd4..0afec2ae92 100644
--- a/hw/virtio/Kconfig
+++ b/hw/virtio/Kconfig
@@ -16,6 +16,7 @@ config VIRTIO_PCI
default y if PCI_DEVICES
depends on PCI
select VIRTIO
+ select VIRTIO_MD_SUPPORTED
config VIRTIO_MMIO
bool
@@ -35,10 +36,17 @@ config VIRTIO_CRYPTO
default y
depends on VIRTIO
+# not all virtio transports support memory devices; if none does,
+# no need to include the code
+config VIRTIO_MD_SUPPORTED
+ bool
+
config VIRTIO_MD
bool
+ depends on VIRTIO_MD_SUPPORTED
select MEM_DEVICE
+# selected by the board if it has the required support code
config VIRTIO_PMEM_SUPPORTED
bool
@@ -46,9 +54,11 @@ config VIRTIO_PMEM
bool
default y
depends on VIRTIO
+ depends on VIRTIO_MD_SUPPORTED
depends on VIRTIO_PMEM_SUPPORTED
select VIRTIO_MD
+# selected by the board if it has the required support code
config VIRTIO_MEM_SUPPORTED
bool
@@ -57,6 +67,7 @@ config VIRTIO_MEM
default y
depends on VIRTIO
depends on LINUX
+ depends on VIRTIO_MD_SUPPORTED
depends on VIRTIO_MEM_SUPPORTED
select VIRTIO_MD
--
2.48.1