From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWT26-0002Z3-PM for qemu-devel@nongnu.org; Mon, 21 May 2012 09:52:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWT1z-0001sm-Ug for qemu-devel@nongnu.org; Mon, 21 May 2012 09:52:22 -0400 Message-ID: <4FBA4889.9080804@suse.de> Date: Mon, 21 May 2012 15:52:09 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1336608729-30289-1-git-send-email-afaerber@suse.de> In-Reply-To: <1336608729-30289-1-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH next v2 00/74] QOM CPUState, part 3: CPU reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: Peter Maydell , Riku Voipio , qemu-devel@nongnu.org, Blue Swirl , Max Filippov , Michael Walle , Paolo Bonzini , qemu-ppc , Anthony Liguori , Igor Mammedov , "Edgar E. Iglesias" , Aurelien Jarno , Richard Henderson On 05/10/2012 02:10 AM, Andreas F=C3=A4rber wrote: > Hello, > > Based on my CPUState patches for 1.1 (qom-cpu-1.1) this series kills of= f the > cpu_state_reset() function, which had been renamed as an interim soluti= on > to free the identifier "cpu_reset" for QOM. > > The interested observer may note that the earlier sh4 SH7750 patches (t= hat > have been deferred due to time constraints for 1.1) were a test run and > serve as template for propagating xxxCPU throughout the code base: > > (i) In target-specific code, accessing CPUxxxState* is a cheap pointer > dereference from xxxCPU (&cpu->env), so xxxCPU should be preferred for = any > static helper functions and QOM/qdev state structs because fields in CP= UState > and in xxxCPU will increase over time. In state structs this also paves > the way for QOM child<> or link<> properties. > > (ii) In TCG helpers, the target's xxxCPU can be obtained via xxx_env_ge= t_cpu(). > Be aware that this incurs one QOM cast. > > (iii) In generic code, the base CPU can be obtained via ENV_GET_CPU() m= acro. > Note that this incurs two QOM casts, so local variables should be prefe= rred > over repeated macro usage within a function. > > (iv) In generic functions, only after all usages of env have been elimi= nated > can the argument be changed from CPUArchState to CPUState. > > (v) Opaque xxxCPU* values are assigned directly to xxxCPU*, to save QOM= casts; > to CPUState* via CPU() cast, in case the casting mechanism ever gets ch= anged. > > Historically, this series has been cherry-picked from a larger CPUState > refactoring (guess why) and reordered to group subsystems and to enforc= e > get, pass, use order. > I had checked v1 to compile on ... > * openSUSE 12.1 x86_64 w/KVM, > * openSUSE Factory ppc w/KVM (with the AREG0 #error suppressed), > * mingw32/64 cross-builds, > * OpenBSD 5.1 amd64. > Thus I'm confident that I got order, return types and local variables r= ight; > changes to opaque values however (keyword "pass") should be reviewed ca= refully. > v2 fixes the changed cpu_init macros to return NULL if CPU init failed. > > Again, target maintainers are requested to start queuing their patches = on their > -next branches, where available, to avoid collisions. > I've been careful to verbosely document which change is for what; the t= argets > are not interdependent except for the final patch, neither is linux-use= r. > PReP patches depend on target-ppc, so should go through the ppc tree pl= ease. > Only target-mips actually depends on a 1.1 patch (the comment drop). > > Some logical next steps that were not strictly necessary for cpu_reset(= ) have > been deferred to part 4, including s390x and some more pxa2xx refactori= ngs. > > Available for testing and cherry-picking (not pulling!) from: > git://github.com/afaerber/qemu-cpu.git qom-cpu-reset.v2 > https://github.com/afaerber/qemu-cpu/commits/qom-cpu-reset.v2 > > Regards, > Andreas > > Cc: Anthony Liguori > Cc: Paolo Bonzini > Cc: Igor Mammedov > > Cc: Peter Maydell > Cc: Alexander Graf > Cc: qemu-ppc > Cc: Blue Swirl > Cc: Edgar E. Iglesias > Cc: Max Filippov > Cc: Michael Walle > Cc: Aurelien Jarno > Cc: Richard Henderson > Cc: Riku Voipio Very simple, nice and clean ;) PowerPC parts are: Acked-by: Alexander Graf Alex