qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3] virtio: fix vring_align() on 64-bit windows
@ 2017-03-24 23:19 Andrew Baumann
  2017-03-28 18:38 ` [Qemu-devel] [PATCH v3 for-2.9?] " Stefan Weil
  2017-03-28 20:09 ` [Qemu-devel] [PATCH v3] " Michael S. Tsirkin
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Baumann @ 2017-03-24 23:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Blake, Stefan Weil, Michael S . Tsirkin, Andrew Baumann

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>
---
 include/hw/virtio/virtio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 15efcf2..7b6edba 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;
-- 
2.8.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-28 20:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-24 23:19 [Qemu-devel] [PATCH v3] virtio: fix vring_align() on 64-bit windows Andrew Baumann
2017-03-28 18:38 ` [Qemu-devel] [PATCH v3 for-2.9?] " Stefan Weil
2017-03-28 18:51   ` Eric Blake
2017-03-28 18:56     ` Andrew Baumann
2017-03-28 19:25       ` Stefan Weil
2017-03-28 20:02       ` [Qemu-devel] [PATCH v3 for-2.9] " Stefan Weil
2017-03-28 20:11         ` Michael S. Tsirkin
2017-03-28 20:19           ` Stefan Weil
2017-03-28 19:12   ` [Qemu-devel] [PATCH v3 for-2.9?] " Philippe Mathieu-Daudé
2017-03-28 20:09 ` [Qemu-devel] [PATCH v3] " Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).