From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58248 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUbzy-0006nj-Dq for qemu-devel@nongnu.org; Mon, 20 Dec 2010 04:25:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUbzx-00028l-1X for qemu-devel@nongnu.org; Mon, 20 Dec 2010 04:25:42 -0500 Received: from mel.act-europe.fr ([194.98.77.210]:48223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUbzw-00025H-QC for qemu-devel@nongnu.org; Mon, 20 Dec 2010 04:25:41 -0500 Message-ID: <4D0F20FB.6070601@adacore.com> Date: Mon, 20 Dec 2010 10:25:15 +0100 From: Fabien Chouteau MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 5/6] [RFC] Emulation of Leon3. References: <5c4895c6f9c6ebd80262c494563726dd59a7ff93.1291397462.git.chouteau@adacore.com> <3ecbaf8fc01bebd2b2f2fb2c709642b2a1db7ff0.1291397462.git.chouteau@adacore.com> <7c24465a442966eba3ae4e2bb03da4463e0f8644.1291397462.git.chouteau@adacore.com> <4CFE1D10.7020009@adacore.com> <4D0640FA.3010300@adacore.com> <4D08FF20.5020809@adacore.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On 12/17/2010 08:14 PM, Blue Swirl wrote: > On Wed, Dec 15, 2010 at 5:47 PM, Fabien Chouteau wrote: >> On 12/13/2010 07:18 PM, Blue Swirl wrote: >>> >>> On Mon, Dec 13, 2010 at 3:51 PM, Fabien Chouteau >>> wrote: >>>> >>>> On 12/11/2010 10:56 AM, Blue Swirl wrote: >>>>> >>>>> On Tue, Dec 7, 2010 at 11:40 AM, Fabien Chouteau >>>>> wrote: >>>>>> >>>>>> On 12/06/2010 06:53 PM, Blue Swirl wrote: >>>>>>> >>>>>>> On Mon, Dec 6, 2010 at 9:26 AM, Fabien Chouteau >>>>>>> wrote: >>>>>>> >>>>>>>> +#if !defined(CONFIG_USER_ONLY) >>>>>>>> + /* Leon3 shutdown */ >>>>>>>> + if (intno == 0x80&& env->version == 0xf3000000) { >>>>>>>> + leon3_shutdown(); >>>>>>>> + } >>>>>>> >>>>>>> This looks like a hack. Should a trap instruction initiate a shutdown? >>>>>> >>>>>> Yes, on Leon3 "ta 0x0" initiates a shutdown. >>>>> >>>>> Then this should be handled during translation. A Leon3 specific CPU >>>>> feature should be added and used much like CHECK_IU_FEATURE (in >>>>> translate.c). Then execution speed would not be affected for non-Leon3 >>>>> CPUs. >>>>> >>>> >>>> OK, but I don't see how to request a shutdown during translation. >>> >>> Just create a helper which calls shutdown, translator should insert a >>> call to that. >> >> I think I understand what you mean, but I don't see why this would be faster >> than my solution. > > Shutdown is not performance critical, but interrupt handling is. > I understand that, but why is it faster to do it during translation? I don't see how one "if" statement in "do_interrupt" will even slightly impact the performances, and why it will be slower than the same "if' statement in the translation. BTW, I didn't use the "unlikely" function, but this will even more reduce the impact... -- Fabien Chouteau