Re: [PATCH] qemu: define and use VIRTIO_PFN_SHIFT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2008-11-05 at 22:49 -0600, Hollis Blanchard wrote:

> diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c
> --- a/qemu/hw/virtio.c
> +++ b/qemu/hw/virtio.c
> @@ -56,6 +56,10 @@
>   */
>  #define wmb() do { } while (0)
>  
> +#define VRING_PAGE_SIZE (1<<12)
> +
> +#define ALIGN(x, a)  (((x)+(a)-1) & ~((a)-1))

Might be better to do:

#define VRING_PAGE_SIZE (1<<12)
#define VRING_PAGE_MASK ~(VRING_PAGE_SIZE - 1)
#define VRING_PAGE_ALIGN(x) (((x) + VRING_PAGE_SIZE - 1) & VRING_PAGE_MASK)

Cheers,
Mark

--
To unsubscribe from this list: send the line "unsubscribe kvm-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux KVM Devel]     [Linux Virtualization]     [Big List of Linux Books]     [Linux SCSI]     [Yosemite Forum]

  Powered by Linux