From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEe9a-0004WS-FR for qemu-devel@nongnu.org; Wed, 28 Aug 2013 07:43:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEe9V-00019Q-Ss for qemu-devel@nongnu.org; Wed, 28 Aug 2013 07:43:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEe9V-00018D-JR for qemu-devel@nongnu.org; Wed, 28 Aug 2013 07:43:09 -0400 Message-ID: <521DE2DF.70707@redhat.com> Date: Wed, 28 Aug 2013 13:45:35 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <20130828080723.GD4696@stefanha-thinkpad.muc.redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Would virtio support 64 bit address for vring virtqueue? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Xie, Huawei" Cc: Stefan Hajnoczi , "rusty@rustcorp.com.au" , "qemu-devel@nongnu.org" , Stefan Hajnoczi On 08/28/13 11:22, Xie, Huawei wrote: > Hi Stefan: > I think you mention the descriptor address? I mean the vring PFN register. > /* A 32-bit r/w PFN for the currently selected queue */ > #define VIRTIO_PCI_QUEUE_PFN 8 > > And the linux driver sample code: > iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, > vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); > > -----Original Message----- > From: Stefan Hajnoczi [mailto:stefanha@gmail.com] > Sent: Wednesday, August 28, 2013 4:07 PM > To: Xie, Huawei > Cc: qemu-devel@nongnu.org; rusty@rustcorp.com.au; Stefan Hajnoczi > Subject: Re: [Qemu-devel] Would virtio support 64 bit address for vring virtqueue? > > On Wed, Aug 28, 2013 at 03:18:39AM +0000, Xie, Huawei wrote: >> I am developing virtio user space poll mode network driver. We allocate vring physical memory from huge page. On VMs with less than 4GB memory, it works well. But on VMs with like 8GB memory, huge page are all allocated from high end memory. >> So would virtio support 64bit address for vring virtqueue? > > The vring takes guest physical addresses and the C type is __u64 (see /usr/include/linux/virtio_ring.h). 64-bit addresses are fine. If you mean Queue Address field in the Virtio Header (section 2.2.2 in the virtio-0.9.5 specification), then please see 2.3 Virtqueue Configuration, step 3. You have to divide the guest-phys address by 4096 and store the quotient. The Queue Address field takes a page frame number, not a page frame address. This allows it to address up to 2^32 * 4096 == 16T bytes of RAM. Laszlo