Yes, it was originally designed with the 16TB limit in mind. PCI doesn't support 64-bit PIO operations so it would have required a high/low register and additional magic.
When/if we switch to an MMIO region, we can switch to using a proper 64-bit register for setting up queues. Regards, Anthony Liguori On Wed, Aug 28, 2013 at 10:30 AM, Xie, Huawei <huawei....@intel.com> wrote: > I know it is PFN, that is why I want to use the high 12bit for combined write > in another reply, to fully address 64 bit address. > Is the 16TB address space what it is originally designed for? If it is, that > will basically solve the problem. I will try later. > Thanks for reminder > > -----Original Message----- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Wednesday, August 28, 2013 7:46 PM > To: Xie, Huawei > Cc: Stefan Hajnoczi; ru...@rustcorp.com.au; qemu-devel@nongnu.org; Stefan > Hajnoczi > Subject: Re: [Qemu-devel] Would virtio support 64 bit address for vring > virtqueue? > > 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:stefa...@gmail.com] >> Sent: Wednesday, August 28, 2013 4:07 PM >> To: Xie, Huawei >> Cc: qemu-devel@nongnu.org; ru...@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 > >