From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lnch1-0004Hs-7N for qemu-devel@nongnu.org; Sat, 28 Mar 2009 13:51:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lnch0-0004HH-CB for qemu-devel@nongnu.org; Sat, 28 Mar 2009 13:51:38 -0400 Received: from [199.232.76.173] (port=39320 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lnch0-0004H5-61 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 13:51:38 -0400 Received: from savannah.gnu.org ([199.232.41.3]:34285 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lncgz-0001Ib-Sj for qemu-devel@nongnu.org; Sat, 28 Mar 2009 13:51:37 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Lncgz-0000cD-81 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 17:51:37 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1Lncgy-0000c8-Vn for qemu-devel@nongnu.org; Sat, 28 Mar 2009 17:51:37 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Sat, 28 Mar 2009 17:51:36 +0000 Subject: [Qemu-devel] [6905] ROM write access for debugging (Jan Kiszka) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6905 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6905 Author: aliguori Date: 2009-03-28 17:51:36 +0000 (Sat, 28 Mar 2009) Log Message: ----------- ROM write access for debugging (Jan Kiszka) Enhance cpu_memory_rw_debug so that it can write even to ROM regions. This allows to modify ROM via gdb (I see no point in denying this to the user), and it will enable us to drop kvm_patch_opcode_byte(). Credits go to Avi for suggesting this. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/exec.c Modified: trunk/exec.c =================================================================== --- trunk/exec.c 2009-03-28 17:46:18 UTC (rev 6904) +++ trunk/exec.c 2009-03-28 17:51:36 UTC (rev 6905) @@ -3448,7 +3448,7 @@ #endif -/* virtual memory access for debug */ +/* virtual memory access for debug (includes writing to ROM) */ int cpu_memory_rw_debug(CPUState *env, target_ulong addr, uint8_t *buf, int len, int is_write) { @@ -3465,8 +3465,13 @@ l = (page + TARGET_PAGE_SIZE) - addr; if (l > len) l = len; - cpu_physical_memory_rw(phys_addr + (addr & ~TARGET_PAGE_MASK), - buf, l, is_write); + phys_addr += (addr & ~TARGET_PAGE_MASK); +#if !defined(CONFIG_USER_ONLY) + if (is_write) + cpu_physical_memory_write_rom(phys_addr, buf, l); + else +#endif + cpu_physical_memory_rw(phys_addr, buf, l, is_write); len -= l; buf += l; addr += l;