From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHAHs-00067x-LG for qemu-devel@nongnu.org; Wed, 04 Sep 2013 06:26:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHAHk-0007vW-8o for qemu-devel@nongnu.org; Wed, 04 Sep 2013 06:26:12 -0400 Sender: Paolo Bonzini Message-ID: <52270ABA.7090102@redhat.com> Date: Wed, 04 Sep 2013 12:26:02 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1378285521-3230-1-git-send-email-afaerber@suse.de> <1378285521-3230-4-git-send-email-afaerber@suse.de> In-Reply-To: <1378285521-3230-4-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC qom-cpu 03/41] cpu: Turn cpu_get_tb_cpu_state() into a CPUClass hook List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: Peter Maydell , Jia Liu , Anthony Green , qemu-devel@nongnu.org, Alexander Graf , Blue Swirl , Max Filippov , Michael Walle , PowerPC , Paul Brook , "Edgar E. Iglesias" , Guan Xuetao , Aurelien Jarno , Richard Henderson Il 04/09/2013 11:04, Andreas Färber ha scritto: > static inline TranslationBlock *tb_find_fast(CPUArchState *env) > { > + CPUState *cpu = ENV_GET_CPU(env); > + CPUClass *cc = CPU_GET_CLASS(cpu); > TranslationBlock *tb; > - target_ulong cs_base, pc; > + vaddr cs_base, pc; > int flags; > > /* we record a subset of the CPU state. It will > always be the same before a given translated block > is executed. */ > - cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); > + cc->get_tb_cpu_state(cpu, &pc, &cs_base, &flags); I'm afraid you cannot turn inline functions into indirect calls like this in hot paths. One alternative would be to hoist the function call to the beginning of cpu_exec, and ensure that any place that modifies the result calls cpu_exit. It may be a problem for SPARC's npc stuff, for which I have no idea how it works. Another is to change cpu-exec.c into a file that is #included by target-*/helper.c or something like that. This way cpu-exec.c can still use the inline functions. Paolo