From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIljH-0001VX-JH for qemu-devel@nongnu.org; Tue, 25 Oct 2011 14:28:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIljG-0000Kc-A0 for qemu-devel@nongnu.org; Tue, 25 Oct 2011 14:28:03 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:45196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIljG-0000Jg-5f for qemu-devel@nongnu.org; Tue, 25 Oct 2011 14:28:02 -0400 From: Paul Brook Date: Tue, 25 Oct 2011 19:27:52 +0100 References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Message-Id: <201110251927.53924.paul@codesourcery.com> Subject: Re: [Qemu-devel] [PATCH 24/25] vmstate: port arm cpu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: Peter Maydell , aliguori@us.ibm.com, qemu-devel@nongnu.org > - /* 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.