qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Converting host virtual addresses to guest physical
       [not found] <129545317.4985876.1504789379418.ref@mail.yahoo.com>
@ 2017-09-07 13:02 ` Padmanabhan S N
  2017-09-12 10:36   ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Padmanabhan S N @ 2017-09-07 13:02 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

I'm developing a new block backend driver. Since my Guest RAM is coming out of shared memory (memory-backend-file,mem-path=/dev/shmem/foo), while performing the IO I would like to pass QEMUIOVector buffers directly to another user-space process running on the same host to enable zerocopy. Can someone help me understand the different memory regions that are mapped in the qemu process address space and how they map to each other ?
1. My guest is configured with 1G RAM. /proc/<pid>/maps on the qemu process shows two 1G regions that are mapped. One of them is /dev/shmem/foo, which I believe corresponds to the guest physical memory. What is the other 1G region ? 
2. The QEMUIOVector buffers point to this 'other' 1G region that I referred above. How do I convert these pointers to locations in the /dev/shmem/foo region ? My plan is to convert the QEMUIOVector buffer pointer to a region in /dev/shmem/foo and pass that pointer to another userspace process that also has the /dev/shmem/foo region mapped.
I understand vhost-user might be the right way to approach this problem. However I'm currently working with qemu-2.8 and it looks neither vhost-user-scsi nor vhost-user-blk are available in that version. If you believe there is a better approach to solve this problem, let me know.

Thanks,Paddy.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] Converting host virtual addresses to guest physical
  2017-09-07 13:02 ` [Qemu-devel] Converting host virtual addresses to guest physical Padmanabhan S N
@ 2017-09-12 10:36   ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2017-09-12 10:36 UTC (permalink / raw)
  To: Padmanabhan S N; +Cc: qemu-devel@nongnu.org

On Thu, Sep 07, 2017 at 01:02:59PM +0000, Padmanabhan S N via Qemu-devel wrote:
> I'm developing a new block backend driver. Since my Guest RAM is coming out of shared memory (memory-backend-file,mem-path=/dev/shmem/foo), while performing the IO I would like to pass QEMUIOVector buffers directly to another user-space process running on the same host to enable zerocopy. Can someone help me understand the different memory regions that are mapped in the qemu process address space and how they map to each other ?
> 1. My guest is configured with 1G RAM. /proc/<pid>/maps on the qemu process shows two 1G regions that are mapped. One of them is /dev/shmem/foo, which I believe corresponds to the guest physical memory. What is the other 1G region ? 
> 2. The QEMUIOVector buffers point to this 'other' 1G region that I referred above. How do I convert these pointers to locations in the /dev/shmem/foo region ? My plan is to convert the QEMUIOVector buffer pointer to a region in /dev/shmem/foo and pass that pointer to another userspace process that also has the /dev/shmem/foo region mapped.

Please post the full QEMU command-line and /proc/<pid>/maps.

> I understand vhost-user might be the right way to approach this problem. However I'm currently working with qemu-2.8 and it looks neither vhost-user-scsi nor vhost-user-blk are available in that version. If you believe there is a better approach to solve this problem, let me know.

Are you sure that QEMU 2.8 will still be relevant by the time your block
driver is production-ready?

Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-12 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <129545317.4985876.1504789379418.ref@mail.yahoo.com>
2017-09-07 13:02 ` [Qemu-devel] Converting host virtual addresses to guest physical Padmanabhan S N
2017-09-12 10:36   ` Stefan Hajnoczi

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).