diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-03-11 09:57:39 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2025-03-11 17:01:14 +0100 |
commit | 80ce7bb5cf0157fa835ecaabeaed90fc282830c9 (patch) | |
tree | 3bfed40001d1bfa569f227fe6bad12d5b15eb1f1 | |
parent | 514c29678715c6b27e09fef8e3594dc1dba6820b (diff) | |
download | qemu-80ce7bb5cf0157fa835ecaabeaed90fc282830c9.zip qemu-80ce7bb5cf0157fa835ecaabeaed90fc282830c9.tar.gz qemu-80ce7bb5cf0157fa835ecaabeaed90fc282830c9.tar.bz2 |
hw/vfio/common: Get target page size using runtime helpers
Prefer runtime helpers to get target page size.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250305153929.43687-3-philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20250311085743.21724-5-philmd@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r-- | hw/vfio/common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index b1596b6..1a0d929 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -30,6 +30,7 @@ #include "exec/address-spaces.h" #include "exec/memory.h" #include "exec/ram_addr.h" +#include "exec/target_page.h" #include "hw/hw.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" @@ -393,13 +394,14 @@ static void vfio_register_ram_discard_listener(VFIOContainerBase *bcontainer, MemoryRegionSection *section) { RamDiscardManager *rdm = memory_region_get_ram_discard_manager(section->mr); + int target_page_size = qemu_target_page_size(); VFIORamDiscardListener *vrdl; /* Ignore some corner cases not relevant in practice. */ - g_assert(QEMU_IS_ALIGNED(section->offset_within_region, TARGET_PAGE_SIZE)); + g_assert(QEMU_IS_ALIGNED(section->offset_within_region, target_page_size)); g_assert(QEMU_IS_ALIGNED(section->offset_within_address_space, - TARGET_PAGE_SIZE)); - g_assert(QEMU_IS_ALIGNED(int128_get64(section->size), TARGET_PAGE_SIZE)); + target_page_size)); + g_assert(QEMU_IS_ALIGNED(int128_get64(section->size), target_page_size)); vrdl = g_new0(VFIORamDiscardListener, 1); vrdl->bcontainer = bcontainer; |