From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEek6-00008I-QH for qemu-devel@nongnu.org; Wed, 28 Aug 2013 08:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEejz-0004p1-J8 for qemu-devel@nongnu.org; Wed, 28 Aug 2013 08:20:58 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:48346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEejz-0004op-6j for qemu-devel@nongnu.org; Wed, 28 Aug 2013 08:20:51 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Aug 2013 13:10:59 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id D50A42190056 for ; Wed, 28 Aug 2013 13:25:37 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7SCKYsa524708 for ; Wed, 28 Aug 2013 12:20:34 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7SCKjSW018558 for ; Wed, 28 Aug 2013 06:20:46 -0600 Message-ID: <521DEB1D.9090405@de.ibm.com> Date: Wed, 28 Aug 2013 14:20:45 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <20130828080723.GD4696@stefanha-thinkpad.muc.redhat.com> <521DE2DF.70707@redhat.com> In-Reply-To: <521DE2DF.70707@redhat.com> 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: Laszlo Ersek Cc: Stefan Hajnoczi , "Xie, Huawei" , "rusty@rustcorp.com.au" , "qemu-devel@nongnu.org" , Stefan Hajnoczi On 28/08/13 13:45, Laszlo Ersek wrote: > 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. To be even more precise. This is only true for virtio-pci. virtio-ccw on s390x can define the queue address as 64bit. Christian