From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FXjlH-0005dz-AL for qemu-devel@nongnu.org; Sun, 23 Apr 2006 14:56:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FXjlF-0005d7-F3 for qemu-devel@nongnu.org; Sun, 23 Apr 2006 14:56:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FXjlF-0005cy-7w for qemu-devel@nongnu.org; Sun, 23 Apr 2006 14:56:45 -0400 Received: from [65.74.133.6] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FXjnJ-0000ZK-2I for qemu-devel@nongnu.org; Sun, 23 Apr 2006 14:58:53 -0400 From: Paul Brook Subject: Re: [Qemu-devel] new MIPS instructions Date: Sun, 23 Apr 2006 19:56:37 +0100 References: <444BB919.3060403@bellard.org> <20060423174847.GA9279@networkno.de> <444BCA67.6020300@gmail.com> In-Reply-To: <444BCA67.6020300@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604231956.38445.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Sunday 23 April 2006 19:41, Dirk Behme wrote: > Thiemo Seufer wrote: > > Fabrice Bellard wrote: > >>I suggest adding a parameter to cpu_mips_init() telling the exact CPU > >>model which is emulated. Optionnal features (such as the FPU) could be > >>specified with an additionnal parameter. > > > > Probably with an additional switch "emulate everything we know about", > > which would be especially useful for usermode emulation where CPU > > specifics don't matter that much. > > Good points, but I don't know which is the best way to go ;) > I think there are pros for both ways: The way the Arm emulation handles this is to have a set of features that are checked by the emulation code. Or at least that's the idea, current CVS doesn't actually enforce most of these. CPU selection is done by CPU model. This selects which features are available, and cpu specific info (Device IDs, etc). If neccy for usermode emulation you can invent a fictional CPU that contains the superset of all features. I think ppc does something similar. Ideally there would be a common mechanism, but that doesn't exist. The important thing is to make the emulation conditional, even if the initial implementation just uses compile time constants. Once the conditionals are there it's relatively easy to wire them up to whatever cpu selection mechanisms qemu invents. Paul