From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Inter VM Communication Date: Tue, 24 Mar 2009 23:06:15 +0200 Message-ID: <49C94B47.2070509@redhat.com> References: <3D9CB4061D1EB3408D4A0B910433453C030275936E@inbmail01.lsi.com> <49C8D5D1.3010902@redhat.com> <49C94587.1020707@cs.ualberta.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Kumar, Venkat" , "kvm@vger.kernel.org" To: Cam Macdonell Return-path: Received: from mx2.redhat.com ([66.187.237.31]:58228 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206AbZCXVFs (ORCPT ); Tue, 24 Mar 2009 17:05:48 -0400 In-Reply-To: <49C94587.1020707@cs.ualberta.ca> Sender: kvm-owner@vger.kernel.org List-ID: Cam Macdonell wrote: >> If you just want to share a page (or a bunch of memory), write a qemu >> PCI device model that exposes that page through a BAR. The guests >> can then map the BAR and access the page. >> >> To share the page, use normal Linux memory sharing, such as shared >> memory segments or mapped files (possibly on /dev/shm). > > I've actually created a patch (and corresponding device driver) that > works this way based on Avi's suggestion of this approach before. I'm > willing to release it of course, but it's in pretty rough form being > my first Qemu/KVM PCI device. Avi (or anyone else), would you mind > having a quick look first before I release it to the list? I'm of course willing to take a look, but I think you should post it directly to the list. More eyes mean more comments, and on this list we usually see constructive criticism. > > I haven't implemented PCI interrupts yet, but would appreciate some > pointers on how to go about this. Call qemu_set_irq(pci_dev->irq[0], 1) when you want your guest to take notice, and qemu_set_irq(pci_dev->irq[0], 0) when service is no longer necessary. You'll also need to set pci_dev->config[PCI_INTERRUPT_PIN] to 1 to let the guest know you're using irq[0]. See virtio or rtl8139.c as examples. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.