Commit 0d05d9365c for qemu.org
commit 0d05d9365c04da3776c630064439c7c0f2723eda
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: Fri Mar 13 06:34:33 2026 +0100
hw/s390x/vfio: Replace TARGET_PAGE_BITS -> qemu_target_page_bits()
Get the target page bits at runtime.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20260313062055.2188-4-philmd@linaro.org>
diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
index 8ce44dbecc..7c754b656d 100644
--- a/hw/s390x/s390-pci-vfio.c
+++ b/hw/s390x/s390-pci-vfio.c
@@ -22,6 +22,7 @@
#include "hw/vfio/pci.h"
#include "hw/vfio/vfio-container-legacy.h"
#include "hw/vfio/vfio-helpers.h"
+#include "exec/target_page.h"
/*
* Get the current DMA available count from vfio. Returns true if vfio is
@@ -150,7 +151,7 @@ static void s390_pci_read_base(S390PCIBusDevice *pbdev,
* to request that the guest free DMA mappings as necessary.
*/
if (!pbdev->rtr_avail) {
- vfio_size = pbdev->iommu->max_dma_limit << TARGET_PAGE_BITS;
+ vfio_size = pbdev->iommu->max_dma_limit << qemu_target_page_bits();
if (vfio_size > 0 && vfio_size < cap->end_dma - cap->start_dma + 1) {
pbdev->zpci_fn.edma = cap->start_dma + vfio_size - 1;
}