From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
"Xie, Huawei" <huawei.xie@intel.com>,
"rusty@rustcorp.com.au" <rusty@rustcorp.com.au>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] Would virtio support 64 bit address for vring virtqueue?
Date: Wed, 28 Aug 2013 14:20:45 +0200 [thread overview]
Message-ID: <521DEB1D.9090405@de.ibm.com> (raw)
In-Reply-To: <521DE2DF.70707@redhat.com>
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
next prev parent reply other threads:[~2013-08-28 12:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 3:18 [Qemu-devel] Would virtio support 64 bit address for vring virtqueue? Xie, Huawei
2013-08-28 8:07 ` Stefan Hajnoczi
2013-08-28 9:22 ` Xie, Huawei
2013-08-28 11:45 ` Laszlo Ersek
2013-08-28 12:20 ` Christian Borntraeger [this message]
2013-08-28 15:30 ` Xie, Huawei
2013-08-28 17:35 ` Anthony Liguori
2013-08-28 21:02 ` H. Peter Anvin
2013-08-28 21:28 ` Anthony Liguori
2013-08-28 21:38 ` Richard Henderson
2013-08-28 10:16 ` Xie, Huawei
2013-09-04 6:52 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=521DEB1D.9090405@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=huawei.xie@intel.com \
--cc=lersek@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rusty@rustcorp.com.au \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).