From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9K7s-0002AB-Mc for qemu-devel@nongnu.org; Thu, 29 Sep 2011 13:10:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9K7p-0007GW-Rd for qemu-devel@nongnu.org; Thu, 29 Sep 2011 13:10:24 -0400 Received: from gw.ac.upc.es ([147.83.30.3]:35562 helo=gw.ac.upc.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9K7p-0007GC-I4 for qemu-devel@nongnu.org; Thu, 29 Sep 2011 13:10:21 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20110929134727.19559.54734.stgit@ginnungagap.bsc.es> <4E847834.7070805@codemonkey.ws> Date: Thu, 29 Sep 2011 19:10:18 +0200 In-Reply-To: <4E847834.7070805@codemonkey.ws> (Anthony Liguori's message of "Thu, 29 Sep 2011 08:52:52 -0500") Message-ID: <87bou39sw5.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC][PATCH 0/5] backdoor: lightweight guest-to-QEMU backdoor channel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Zhi Yong Wu , qemu-devel@nongnu.org Anthony Liguori writes: > On 09/29/2011 08:47 AM, Llu=C3=ADs Vilanova wrote: >> Provides the ability for the guest to communicate with user-provided cod= e inside >> QEMU itself, using a lightweight mechanism. >>=20 >> See first commit for a full description. >>=20 >> Signed-off-by: Llu=C3=ADs Vilanova > We already have two "backdoors" in QEMU: ivshmem and virtio-serial. Can = you > discuss why these are insufficient for your purposes? The main point is that I want the user to be able to provide (at compile ti= me, although it could also be done through dlopen or similar) her own implement= ation of what to do immediately after the backdoor channel is invoked *and* to be= able to use QEMU internal routines from that code. I also want the mechanism to = be as lightweight as possible (i.e., no OS involvement through syscalls to use the device); right now, channel invocation is reduced to just a single write to memory. Is this possible to achieve with virtio-serial or ivshmem? Maybe I just mis= sed the details in them that would allow me to do that without yet another devi= ce. > Also, what's the advantage of having a backdoor mechanism both for softmm= u and > user? I can't think of a practical use-case for it. The intent is to have the same guest interface to interact with the user-implemented backdoor code, regardless of which QEMU "mode" we're runni= ng on (user or softmmu). In the use-mode case, now I can link the application against the backdoor interface library and add some calls to the backdoor in the points I'm interested in. Then moving the app into softmmu would just work without fur= ther changes (provided the guest uses the softmmu-capable version of the library= ). The contents of the user implementation can be arbitrary, although my targe= t is to use it coupled together with the patchset for tracing guest code at the = TCG level (which I haven't sent yet in its new form). Thus you could add just a= pair of lines in the guest code to enable tracing of the executed guest instruct= ions only for whichever part of the program you're interested in. Lluis --=20 "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth