From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHKiT-0002vP-M4 for qemu-devel@nongnu.org; Mon, 29 Dec 2008 11:11:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHKiR-0002uG-Bg for qemu-devel@nongnu.org; Mon, 29 Dec 2008 11:11:40 -0500 Received: from [199.232.76.173] (port=56341 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHKiR-0002uD-86 for qemu-devel@nongnu.org; Mon, 29 Dec 2008 11:11:39 -0500 Received: from fg-out-1718.google.com ([72.14.220.159]:51188) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LHKiQ-0003PT-Nz for qemu-devel@nongnu.org; Mon, 29 Dec 2008 11:11:39 -0500 Received: by fg-out-1718.google.com with SMTP id l26so1696133fgb.8 for ; Mon, 29 Dec 2008 08:11:36 -0800 (PST) Message-ID: <761ea48b0812290811x4cc2f0c8ne35b8f9a652fa730@mail.gmail.com> Date: Mon, 29 Dec 2008 17:11:35 +0100 From: "Laurent Desnogues" Subject: Re: [Qemu-devel] User mode emulation and TCG_OPF_CALL_CLOBBER In-Reply-To: <20081229113553.GB14024@edgar.se.axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <761ea48b0812260632u2d25f2c7i86c27911c4e9cb2b@mail.gmail.com> <20081229104607.GA14024@edgar.se.axis.com> <20081229113553.GB14024@edgar.se.axis.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 Mon, Dec 29, 2008 at 12:35 PM, Edgar E. Iglesias wrote: > On Mon, Dec 29, 2008 at 11:46:07AM +0100, Edgar E. Iglesias wrote: >> On Fri, Dec 26, 2008 at 03:32:06PM +0100, Laurent Desnogues wrote: >> > Hello, >> > >> > while looking at generated code for a user mode emulated program >> > I noticed some registers were saved/restored for qemu_{ld,st} >> > operations. My understanding is that this is only needed for softmmu >> > (and even in that case for the slow path as a comment in tcg.c says) >> > since in that case, a call to a helper might be generated. >> > >> > This register save & restore behavior is enabled by the op flag >> > TCG_OPF_CALL_CLOBBER. >> > >> > A quick test on ARM target and x86_64 host for a SPEC2000 test >> > shows removing that flag speeds up execution by about 15%. >> > >> > Did I understand things correctly? If so what would be the best >> >> Hello Laurent, >> >> I think you did and I think what you propose kind of makes sense but >> unfortunately your patch exposes errors on my setup. >> >> The i386 backend's ld64 seems to clobber registers (eax/edx) behind >> tcg's back and with your patch at least CRIS no longer passes it's testsuite >> on i386 hosts. (Actually, I can't see how the plain tcg_gen_ld_i64 can work >> reliably with the i386 backend from svn.) > > I see now. AFAICT, only qemu_ld64 has issues and only if you remove the > clobber flag. Well even if that din't break qemu_ld64 on i386 (which it does), lack of saves before doing a memory access that could generate a signal is a killer. Trash the idea :) Laurent