Skip to content

Commit

Permalink
virtio: fix vring_align() on 64-bit windows
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
0xabu authored and mstsirkin committed Mar 28, 2017
1 parent c53598e commit b8adbc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/hw/virtio/virtio.h
Expand Up @@ -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;
Expand Down

0 comments on commit b8adbc6

Please sign in to comment.