From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33221 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Poeds-0007vL-Bh for qemu-devel@nongnu.org; Sun, 13 Feb 2011 11:17:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Poedr-0002Mu-0T for qemu-devel@nongnu.org; Sun, 13 Feb 2011 11:17:44 -0500 Received: from gate.crashing.org ([63.228.1.57]:37806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Poedq-0002Mg-Ni for qemu-devel@nongnu.org; Sun, 13 Feb 2011 11:17:42 -0500 Subject: Re: [Qemu-devel] Re: [PATCH 15/15] Implement the bus structure for PAPR virtual IO From: Benjamin Herrenschmidt In-Reply-To: <28596383-B15A-4932-A03C-8C45F5D777D1@suse.de> References: <1297522467-5975-1-git-send-email-david@gibson.dropbear.id.au> <1297522467-5975-16-git-send-email-david@gibson.dropbear.id.au> <1BA55C28-0AAF-46A5-A14F-04B0B61419DB@suse.de> <1297544424.14982.628.camel@pasglop> <1297552503.14982.637.camel@pasglop> <20110213111450.GD18294@yookeroo> <28596383-B15A-4932-A03C-8C45F5D777D1@suse.de> Content-Type: text/plain; charset="UTF-8" Date: Sun, 13 Feb 2011 10:17:34 -0600 Message-ID: <1297613854.14982.656.camel@pasglop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Blue Swirl , Paul Mackerras , "qemu-devel@nongnu.org List" , anton@samba.org, David Gibson On Sun, 2011-02-13 at 13:40 +0100, Alexander Graf wrote: > > We can surely move it to dynamic later on. I think the "proper" way > would be to populate a qdev bus and have the individual hypercall > receivers register themselves through -device creations. But Blue > really is the expert here :). Why would you want to go through a bus for all hcalls ? (ie including the ones that aren't device related ?). That doesn't quite "tick" but I'm sure I'm missing part of the picture here :-) A simple dispatch table based approach is the most efficient and simple way to do that (after a switch/case) in my opinion, this is more/less what we have done internally, with a pair of calls for "modules" to register hcalls if they need to. The hcalls numbers are fixed and specified in sPAPR. BTW. We are still missing in this picture RTAS. I suppose David is still cleaning up those patches. Basically, we use a 5 instruction trampoline that calls a private h-call, the RTAS emulation is entirely in qemu. This has to be done that way for various reasons, but essentially RTAS under pHyp also more/less turns into private pHyp calls under the hood. Cheers, Ben.