All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Christian Bornträger" <borntraeger@de.ibm.com>
Cc: Avi Kivity <avi@redhat.com>, Cam Macdonell <cam@cs.ualberta.ca>,
	kvm@vger.kernel.org, Rusty Russell <rusty@rustcorp.com.au>,
	Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Subject: Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts.
Date: Wed, 20 May 2009 08:26:46 -0500	[thread overview]
Message-ID: <4A140516.6080706@codemonkey.ws> (raw)
In-Reply-To: <200905200933.07661.borntraeger@de.ibm.com>

Christian Bornträger wrote:
> Am Dienstag 19 Mai 2009 20:39:24 schrieb Anthony Liguori:
>   
>> Perhaps something that maps closer to the current add_buf/get_buf API.
>> Something like:
>>
>> struct iovec *(*map_buf)(struct virtqueue *vq, unsigned int *out_num,
>> unsigned int *in_num);
>> void (*unmap_buf)(struct virtqueue *vq, struct iovec *iov, unsigned int
>> out_num, unsigned int in_num);
>>
>> There's symmetry here which is good.  The one bad thing about it is
>> forces certain memory to be read-only and other memory to be
>> read-write.  I don't see that as a bad thing though.
>>
>> I think we'll need an interface like this so support driver domains too
>> since "backend".  To put it another way, in QEMU, map_buf ==
>> virtqueue_pop and unmap_buf == virtqueue_push.
>>     
>
>
> You are proposing that the guest should define some guest memory to be used as 
> shared memory (some kind of replacement), right?

No.  map_buf() returns a mapped region of memory.  Where that memory 
comes from is up to the transport.  It can be the result of an ioremap 
of a PCI BAR.

The model of virtio frontends today is:

 o add buffer of guest's memory
 o let backend do something with it
 o get back buffer of guest's memory

The backend model (as implemented by QEMU) is:

 o get buffer of mapped front-end memory
 o do something with memory
 o give buffer back

For implementing persistent shared memory, you need a vring with enough 
elements to hold all of the shared memory regions at one time.  This 
becomes more practical with indirect scatter/gather entries.

Of course, whether vring is used at all is a transport detail.

Regards,

Anthony Liguori

  reply	other threads:[~2009-05-20 13:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07 16:26 [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts Cam Macdonell
2009-05-18 14:07 ` Christian Borntraeger
2009-05-18 14:26   ` Avi Kivity
2009-05-19  9:00     ` Christian Bornträger
2009-05-19  9:10       ` Avi Kivity
2009-05-19 16:51         ` Cam Macdonell
2009-05-20  2:58           ` Rusty Russell
2009-05-20  7:33             ` Christian Bornträger
2009-05-20  8:45               ` Avi Kivity
2009-05-20  9:07                 ` Christian Bornträger
2009-05-20  9:11                   ` Avi Kivity
2009-05-20  9:20                     ` Christian Bornträger
2009-05-25  6:18               ` Rusty Russell
2009-05-20  8:07             ` François Diakhate
2009-05-19 18:39       ` Anthony Liguori
2009-05-20  7:33         ` Christian Bornträger
2009-05-20 13:26           ` Anthony Liguori [this message]
2009-05-18 16:56   ` Cam Macdonell

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=4A140516.6080706@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cam@cs.ualberta.ca \
    --cc=ehrhardt@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.