From: Andrew Baumann Date: Fri, 24 Mar 2017 23:19:43 +0000 (-0700) Subject: virtio: fix vring_align() on 64-bit windows X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b8adbc657802482e4da1767bf983ebfdf9bfe9fc;p=qemu.git virtio: fix vring_align() on 64-bit windows long is 32-bits on 64-bit windows, which caused the top half of the address to be truncated; this patch changes it to use the QEMU_ALIGN_UP macro which does not suffer the same problem Signed-off-by: Andrew Baumann Reviewed-by: Eric Blake Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Weil Reviewed-by: Philippe Mathieu-Daudé --- diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 15efcf2057..7b6edbafd7 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -34,7 +34,7 @@ struct VirtQueue; static inline hwaddr vring_align(hwaddr addr, unsigned long align) { - return (addr + align - 1) & ~(align - 1); + return QEMU_ALIGN_UP(addr, align); } typedef struct VirtQueue VirtQueue;