From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdPDa-0003bj-3L for qemu-devel@nongnu.org; Sun, 03 Jul 2011 12:08:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdPDY-0003Qf-LH for qemu-devel@nongnu.org; Sun, 03 Jul 2011 12:08:21 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:55279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdPDY-0003QZ-Ao for qemu-devel@nongnu.org; Sun, 03 Jul 2011 12:08:20 -0400 Received: by vws17 with SMTP id 17so3740413vws.4 for ; Sun, 03 Jul 2011 09:08:18 -0700 (PDT) Sender: Richard Henderson Message-ID: <4E1093ED.7030801@twiddle.net> Date: Sun, 03 Jul 2011 09:08:13 -0700 From: Richard Henderson MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix unassigned memory access handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: "Edgar E. Iglesias" , =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , qemu-devel , Aurelien Jarno On 07/03/2011 02:42 AM, Blue Swirl wrote: > } > > -void QEMU_NORETURN do_unassigned_access(target_phys_addr_t addr, int is_write, > - int is_exec, int unused, int size) > +void QEMU_NORETURN cpu_unassigned_access(CPUState *env1, > + target_phys_addr_t addr, int is_write, > + int is_exec, int unused, int size) > { > + CPUState *saved_env; > + > + saved_env = env; > + env = env1; > env->trap_arg0 = addr; > env->trap_arg1 = is_write; > dynamic_excp(EXCP_MCHK, 0); > + env = saved_env; > } For Alpha and MIPS, these functions always throw an exception exiting the cpu loop. There's no point in saving the old value of ENV. It's Sparc and Microblaze that only sometimes throw the exception. r~