From bbf2c3bbb9c9e97f12dfe49f85dac8cc1f0c5d97 Mon Sep 17 00:00:00 2001 From: Joao Martins Date: Sun, 5 Mar 2023 18:12:29 -0500 Subject: [PATCH v3 14/13] vfio/common: Fix 32-bit builds Signed-off-by: Joao Martins --- hw/vfio/common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 9b909f856722..eecff5bb16c6 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1554,7 +1554,7 @@ vfio_device_feature_dma_logging_start_create(VFIOContainer *container) return NULL; } - control->ranges = (__aligned_u64)ranges; + control->ranges = (__u64)(uintptr_t)ranges; if (tracking->max32) { ranges->iova = tracking->min32; ranges->length = (tracking->max32 - tracking->min32) + 1; @@ -1578,7 +1578,7 @@ static void vfio_device_feature_dma_logging_start_destroy( struct vfio_device_feature_dma_logging_control *control = (struct vfio_device_feature_dma_logging_control *)feature->data; struct vfio_device_feature_dma_logging_range *ranges = - (struct vfio_device_feature_dma_logging_range *)control->ranges; + (struct vfio_device_feature_dma_logging_range *)(uintptr_t) control->ranges; g_free(ranges); g_free(feature); @@ -1646,7 +1646,7 @@ static int vfio_device_dma_logging_report(VFIODevice *vbasedev, hwaddr iova, { uint64_t buf[DIV_ROUND_UP(sizeof(struct vfio_device_feature) + sizeof(struct vfio_device_feature_dma_logging_report), - sizeof(__aligned_u64))] = {}; + sizeof(__u64))] = {}; struct vfio_device_feature *feature = (struct vfio_device_feature *)buf; struct vfio_device_feature_dma_logging_report *report = (struct vfio_device_feature_dma_logging_report *)feature->data; @@ -1654,7 +1654,7 @@ static int vfio_device_dma_logging_report(VFIODevice *vbasedev, hwaddr iova, report->iova = iova; report->length = size; report->page_size = qemu_real_host_page_size(); - report->bitmap = (__aligned_u64)bitmap; + report->bitmap = (__u64)(uintptr_t)bitmap; feature->argsz = sizeof(buf); feature->flags = -- 2.17.2