qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Padmanabhan S N <paddusn@yahoo.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Converting host virtual addresses to guest physical
Date: Tue, 12 Sep 2017 11:36:25 +0100	[thread overview]
Message-ID: <20170912103625.GF6123@stefanha-x1.localdomain> (raw)
In-Reply-To: <129545317.4985876.1504789379418@mail.yahoo.com>

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

      reply	other threads:[~2017-09-12 10:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 message]

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=20170912103625.GF6123@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=paddusn@yahoo.com \
    --cc=qemu-devel@nongnu.org \
    /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).