From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKGKk-0004YJ-9Y for qemu-devel@nongnu.org; Fri, 26 Jun 2009 14:39:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKGKg-0004WL-Rx for qemu-devel@nongnu.org; Fri, 26 Jun 2009 14:39:34 -0400 Received: from [199.232.76.173] (port=40861 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKGKg-0004WI-Pz for qemu-devel@nongnu.org; Fri, 26 Jun 2009 14:39:30 -0400 Received: from mx20.gnu.org ([199.232.41.8]:4087) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MKGKg-0002sV-Hi for qemu-devel@nongnu.org; Fri, 26 Jun 2009 14:39:30 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MKGKb-0005d9-Di for qemu-devel@nongnu.org; Fri, 26 Jun 2009 14:39:25 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [RFC PATCH] s390x-linux-user Date: Fri, 26 Jun 2009 19:39:21 +0100 References: <200906261849.43746.uli@suse.de> <200906261859.03172.paul@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906261939.22647.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl > > OTOH, tweaking the TCG interface so that it works as an interpreter > > shouldn't be all that hard. It's something I've been considering to do > > for a while, and would mean that you can build both interpreter and > > translator from the same source. > > Like by adding an interpreter TCG target? If it were in C only, it > could also serve as a portable (low performance) translator runtime. There are a couple of different options. You could spit out bytecode (or even some simplified form of an existing ISA) then run that though an interpreter. This is gets you a portable target, and behaves much like a native TCG target. The alternative is to replace TCG altogether, and have tcg_gen_* perform the operation immediately as the code is translated. You need a couple of tricks to cope with conditional banches, but as long as you don't allow loops this isn't too hairy. This is more invasive, gives you a pure interpreter, so may be the fastest option for heavily self-modifying guest code. Paul