Re: R/W HG memory mappings with kvm?

2009-08-31 Thread Stephen Donnelly
On Mon, Aug 31, 2009 at 8:44 PM, Avi Kivitya...@redhat.com wrote: On 08/31/2009 01:33 AM, Stephen Donnelly wrote: We can't duplicate mm/ in kvm.  However, mm/memory.c says:  * The way we recognize COWed pages within VM_PFNMAP mappings is through the  * rules set up by remap_pfn_range

Re: R/W HG memory mappings with kvm?

2009-08-30 Thread Stephen Donnelly
On Thu, Aug 27, 2009 at 4:08 PM, Avi Kivitya...@redhat.com wrote: On 08/27/2009 05:34 AM, Stephen Donnelly wrote: On Mon, Aug 24, 2009 at 4:55 PM, Avi Kivitya...@redhat.com  wrote: On 08/24/2009 12:59 AM, Stephen Donnelly wrote: On Thu, Aug 20, 2009 at 12:14 AM, Avi Kivitya...@redhat.com

Re: R/W HG memory mappings with kvm?

2009-08-26 Thread Stephen Donnelly
On Mon, Aug 24, 2009 at 4:55 PM, Avi Kivitya...@redhat.com wrote: On 08/24/2009 12:59 AM, Stephen Donnelly wrote: On Thu, Aug 20, 2009 at 12:14 AM, Avi Kivitya...@redhat.com  wrote: On 08/13/2009 07:07 AM, Stephen Donnelly wrote: npages = get_user_pages_fast(addr, 1, 1, page); returns

Re: R/W HG memory mappings with kvm?

2009-08-26 Thread Stephen Donnelly
On Wed, Aug 26, 2009 at 10:22 PM, Avi Kivitya...@redhat.com wrote: On 08/24/2009 07:55 AM, Avi Kivity wrote: On 08/24/2009 12:59 AM, Stephen Donnelly wrote: On Thu, Aug 20, 2009 at 12:14 AM, Avi Kivitya...@redhat.com  wrote: On 08/13/2009 07:07 AM, Stephen Donnelly wrote: npages

Re: R/W HG memory mappings with kvm?

2009-08-12 Thread Stephen Donnelly
On Wed, Jul 29, 2009 at 11:06 AM, Stephen Donnellysfdonne...@gmail.com wrote: On Tue, Jul 28, 2009 at 8:54 PM, Avi Kivitya...@redhat.com wrote: On 07/28/2009 12:32 AM, Stephen Donnelly wrote: You need a variant of qemu_ram_alloc() that accepts an fd and offset and mmaps that. I had a go

Re: R/W HG memory mappings with kvm?

2009-07-28 Thread Stephen Donnelly
On Tue, Jul 28, 2009 at 8:54 PM, Avi Kivitya...@redhat.com wrote: On 07/28/2009 12:32 AM, Stephen Donnelly wrote: What I don't understand is how to turn the host address returned from mmap into a ram_addr_t to pass to pci_register_bar. Memory must be allocated using the qemu RAM functions

Re: R/W HG memory mappings with kvm?

2009-07-27 Thread Stephen Donnelly
Hi Cam, Sorry I haven't answered your email from last Thursday.  I'll answer it shortly. Thanks, I'm still chipping away at it slowly. On Thu, Jul 9, 2009 at 6:01 PM, Cam Macdonellc...@cs.ualberta.ca wrote: The memory for the device allocated as a POSIX shared memory object and then

Re: R/W HG memory mappings with kvm?

2009-07-12 Thread Stephen Donnelly
On Sat, Jul 11, 2009 at 5:03 AM, Cam Macdonellc...@cs.ualberta.ca wrote: Oops, I realize now that I passed the driver patch both times.  Here is the old patch. http://patchwork.kernel.org/patch/22363/ What are you compiling against?  the git tree or a particular version? The above patch

Re: R/W HG memory mappings with kvm?

2009-07-09 Thread Stephen Donnelly
On Thu, Jul 9, 2009 at 6:01 PM, Cam Macdonellc...@cs.ualberta.ca wrote: Is there a corresponding qemu patch for the backend to the guest pci driver? Oops right.   For some reason I can't my driver patch in patchwork. http://kerneltrap.org/mailarchive/linux-kvm/2009/5/7/5665734 Thanks for

Re: R/W HG memory mappings with kvm?

2009-07-08 Thread Stephen Donnelly
Shared memory is fully coherent.  You can use the ordinary x86 bus lock operations for concurrent read-modify-write access, and the memory barrier instructions to prevent reordering.  Just like ordinary shared memory. Okay, I think I was confused by the 'dirty' code. Is that just to do with

Re: R/W HG memory mappings with kvm?

2009-07-08 Thread Stephen Donnelly
On Thu, Jul 9, 2009 at 9:45 AM, Cam Macdonellc...@cs.ualberta.ca wrote: Hi Stephen, Here is the latest patch that supports interrupts.  I am currently working on a broadcast mechanism that should be ready fairly soon. http://patchwork.kernel.org/patch/22368/ I have some test scripts that

Re: R/W HG memory mappings with kvm?

2009-07-07 Thread Stephen Donnelly
On Mon, Jul 6, 2009 at 7:38 PM, Avi Kivitya...@redhat.com wrote: I see virtio_pci uses cpu_physical_memory_map() which provides either read or write mappings and notes Use only for reads OR writes - not for read-modify-write operations. Right, these are for unidirectional transient DMA.

R/W HG memory mappings with kvm?

2009-07-05 Thread Stephen Donnelly
I am looking at how to do memory mapped IO between host and guests under kvm. I expect to use the PCI emulation layer to present a PCI device to the guest. I see virtio_pci uses cpu_physical_memory_map() which provides either read or write mappings and notes Use only for reads OR writes - not for