From: Ian Campbell Subject: Re: Hypervisor to dom0 communication Date: Tue, 13 Nov 2012 09:59:51 +0000 Message-ID: <1352800791.7491.21.camel@zakaz.uk.xensource.com> References: <50A16639.2090209@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50A16639.2090209@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-11-12 at 21:12 +0000, Razvan Cojocaru wrote: > Hello, > > I'm interested in establishing a communication channel between the Xen > hypervisor and a dom0 userspace application. Ideally this would be a > 2-way channel, with the hypervisor asynchronously notifying this > application, and then (for certain types of messages) wait for a reply > from the userspace consumer. Sounds a lot like the model used by the IOREQs, this is the mechanism for dispatching MMIO emulation to the qemu process for HVM domains. > What would you recommend for my case? Where (if anywhere) might I be > able to find a clear, concise, example of allocating and sharing memory > pages containing a ring buffer used for hypervisor <-> dom0 userspace > communication (hopefully even simpler that trace.c)? I think I'd look at the ioreq stuff in preference to the trace stuff. You probably want to use a normal evtchn rather than VIRQ. The code which handles HVM_PARAM_BUFIOREQ_PFN and HVM_PARAM_BUFIOREQ_EVTCHN should give a reasonable starting point (I think, I'm not actually the familiar with this bit of Xen). It might also be useful if you describe your actual end-goal -- i.e. what you are ultimately trying to achieve. It may be that there are better approaches or even existing solutions or things which are already close to your needs. Ian.