]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtio: fix vring_align() on 64-bit windows
authorAndrew Baumann <Andrew.Baumann@microsoft.com>
Fri, 24 Mar 2017 23:19:43 +0000 (16:19 -0700)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 28 Mar 2017 23:35:24 +0000 (02:35 +0300)
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 <Andrew.Baumann@microsoft.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
include/hw/virtio/virtio.h

index 15efcf20571152814876e9a1cd9219c53983178f..7b6edbafd7141c3b4e73a28bd61f5323d87c5f1d 100644 (file)
@@ -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;