From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RImMw-0003wt-VY for qemu-devel@nongnu.org; Tue, 25 Oct 2011 15:09:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RImMw-0008Qq-2N for qemu-devel@nongnu.org; Tue, 25 Oct 2011 15:09:03 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:57388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RImMv-0008Qe-TU for qemu-devel@nongnu.org; Tue, 25 Oct 2011 15:09:02 -0400 Received: by wwi36 with SMTP id 36so1213391wwi.10 for ; Tue, 25 Oct 2011 12:09:00 -0700 (PDT) Sender: Richard Henderson Message-ID: <4EA70947.9050904@twiddle.net> Date: Tue, 25 Oct 2011 12:08:55 -0700 From: Richard Henderson MIME-Version: 1.0 References: <201110251927.53924.paul@codesourcery.com> In-Reply-To: <201110251927.53924.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-6 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 24/25] vmstate: port arm cpu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Peter Maydell , aliguori@us.ibm.com, qemu-devel@nongnu.org, Juan Quintela On 10/25/2011 11:27 AM, Paul Brook wrote: >> - /* Avoid mode switch when restoring CPSR. */ >> - env->uncached_cpsr = val & CPSR_M; >> - cpsr_write(env, val, 0xffffffff); >> + >> + env->uncached_cpsr = env->cpsr_vmstate & CPSR_M; >> + cpsr_write(env, env->cpsr_vmstate, 0xffffffff); > > You've removed the helpful comment explaining why this wierdness exists. > Please put it back. > > A comment in cpu.h explaining what cpsr_vmstate is for would also be nice. > Specifically it's a hack[1] to transfer data between the pre_save/post_load > hooks and the vmstate machinery. IMO "vmstate" is a sufficiently generic term > that it could be confused with some actual cpu register, especially once we > get round to implementing the hypervisor extensions. > > Paul > > [1] Maybe a necessary hack, but still a wart from requiring static table > driven vmstate descriptions. I wonder if we shouldn't make it easier to do what I do for Alpha with the rather different hack for the fpcr. That might avoid some of the other pre/post_load hooks, and the extra data fields that requires in the cpu structure. r~