From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRQJF-00035s-3I for qemu-devel@nongnu.org; Fri, 27 Feb 2015 14:10:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRQJ9-00082h-6O for qemu-devel@nongnu.org; Fri, 27 Feb 2015 14:10:48 -0500 Received: from cantor2.suse.de ([195.135.220.15]:43652 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRQJ8-00081n-Sf for qemu-devel@nongnu.org; Fri, 27 Feb 2015 14:10:43 -0500 Message-ID: <54F0C130.8040106@suse.de> Date: Fri, 27 Feb 2015 20:10:40 +0100 From: =?windows-1252?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1424894306-26740-1-git-send-email-ehabkost@redhat.com> <1424894306-26740-5-git-send-email-ehabkost@redhat.com> <54EE477F.4000106@suse.de> <20150226155949.GA3513@thinpad.lan.raisama.net> <54F07AD3.1090400@suse.de> <20150227190115.GB15482@thinpad.lan.raisama.net> In-Reply-To: <20150227190115.GB15482@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 04/11] target-i386: Rename cpu_x86_init() to cpu_x86_init_user() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Peter Maydell , qemu-devel@nongnu.org, Paolo Bonzini Am 27.02.2015 um 20:01 schrieb Eduardo Habkost: > On Fri, Feb 27, 2015 at 03:10:27PM +0100, Andreas F=E4rber wrote: >> Am 26.02.2015 um 16:59 schrieb Eduardo Habkost: >>> On Wed, Feb 25, 2015 at 11:06:55PM +0100, Andreas F=E4rber wrote: >>>> Am 25.02.2015 um 20:58 schrieb Eduardo Habkost: >>>>> The function is used only for CONFIG_USER, so make its purpose clea= r. >>>>> >>>>> Reviewed-by: Paolo Bonzini >>>>> Signed-off-by: Eduardo Habkost >>>>> --- >>>>> target-i386/cpu.c | 2 +- >>>>> target-i386/cpu.h | 4 ++-- >>>>> 2 files changed, 3 insertions(+), 3 deletions(-) >>>> >>>> Please don't. I happily got all architectures aligned that it's at l= east >>>> cpu_something_init, and it only happens to be user-only for x86. It = is >>>> rather the legacy function that was used in both system and user. >>> >>> If that's a legacy function, what are the steps you plan to follow to >>> eliminate it? I would be glad to help eliminating legacy code. >>> >>> Initialization of CPUs in *-user and *-softmmu is different in i386, = so >>> we are going to have different code for both. How do you think I shou= ld >>> name the *-user-specific CPU init function in target-i386, then? >> >> I would prefer to leave its name as it is (unless we are renaming all, >> which would probably be a waste of effort giving the next steps) and >> simply not use it in PC code. If you want to enforce this, you could >> #ifdef CONFIG_USER_ONLY it. >> >> For some targets - as can be seen in your uc32 patch - there is alread= y >> a cpu_generic_init() that calls into the CPUClass hooks of the given C= PU >> type. I would like to call that from linux-user directly (or from a >> lightweight wrapper to be shared between linux-user and bsd-user, I >> assume we're going need some target-specific #ifdefs) and drop >> cpu_init() in its current form. In particular I want to somehow move t= he >> realized=3Dtrue part out of it, which means either inlining it into do= zens >> of machines or finishing the recursive realization work so that we onl= y >> need one central realized=3Dtrue for /machine. >=20 > Moving realized=3Dtrue outside cpu_generic_init() would make lots of se= nse > for PC, as we already need to perform additional steps in the PC init > code before realizing the CPU (and I expect the list of PC-specific CPU > initialization steps to grow). And when we do this, cpu_x86_init() > (used by CONFIG_USER) and cpu_x86_create() (used by PC) can become the > same function. >=20 > But I don't see how to implement this without requiring changing machin= e > code case-by-case, as existing machine code may expect realized=3Dtrue = to > be set very early and break if you don't set it immediately after > cpu_*_init(). In other words, even if we implement recursive > realization, we may need to inline realize=3Dtrue on all machines as an > intermediate (and automated) step, and then change machines to just rel= y > on recursive realization, one by one. Yes, that's why it's not done yet, it takes a lot of review and testing. It is not going to be a pure Coccinelle patch. :) Doing that for the inlining is an idea I had not yet considered, thanks. On my qom-cpu-x86 branch I have already moved realized=3Dtrue for the PC, in order to make a CPU core object its parent. Regards, Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)