From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L5P9A-0003M2-00 for qemu-devel@nongnu.org; Wed, 26 Nov 2008 13:29:56 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L5P98-0003Kv-6L for qemu-devel@nongnu.org; Wed, 26 Nov 2008 13:29:55 -0500 Received: from [199.232.76.173] (port=58302 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L5P97-0003KY-HQ for qemu-devel@nongnu.org; Wed, 26 Nov 2008 13:29:53 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:33574) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L5P97-0007be-35 for qemu-devel@nongnu.org; Wed, 26 Nov 2008 13:29:53 -0500 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e38.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id mAQISppR022950 for ; Wed, 26 Nov 2008 11:28:51 -0700 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mAQITpa7130376 for ; Wed, 26 Nov 2008 11:29:51 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mAQITpaR010745 for ; Wed, 26 Nov 2008 11:29:51 -0700 From: Hollis Blanchard In-Reply-To: <1227723726-15662-1-git-send-email-hollisb@us.ibm.com> References: <1227650239-14162-1-git-send-email-aliguori@us.ibm.com> <1227723726-15662-1-git-send-email-hollisb@us.ibm.com> Content-Type: text/plain Date: Wed, 26 Nov 2008 12:29:50 -0600 Message-Id: <1227724190.6562.9.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] Remove TARGET_PAGE_SIZE from virtio interface Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Avi Kivity On Wed, 2008-11-26 at 12:22 -0600, Hollis Blanchard wrote: > > diff --git a/hw/virtio.h b/hw/virtio.h > index 1df8f83..c23f38c 100644 > --- a/hw/virtio.h > +++ b/hw/virtio.h > @@ -47,6 +47,11 @@ > /* This means don't interrupt guest when buffer consumed. */ > #define VRING_AVAIL_F_NO_INTERRUPT 1 > > +static inline vring_align(unsigned long addr, unsigned long align) > +{ > + return (addr + align - 1) & ~(align - 1); > +} > + > typedef struct VirtQueue VirtQueue; > typedef struct VirtIODevice VirtIODevice; OK, obviously this doesn't need to be named "vring_align". I was going to just build VIRTIO_PCI_VRING_ALIGN into this function, but in the future we'll need to accommodate KVM_S390_VIRTIO_RING_ALIGN, so we would need to pass in a parameter from virtqueue_init(). Of course, I'm not sure how the S390 code will fit here anyways, since virtio.c is both virtio ring and virtio PCI. I haven't found an existing "align" function in qemu though... -- Hollis Blanchard IBM Linux Technology Center