From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDb0C-0004kW-D6 for qemu-devel@nongnu.org; Tue, 20 Jan 2015 10:46:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDb0B-0007WB-B2 for qemu-devel@nongnu.org; Tue, 20 Jan 2015 10:46:00 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:54959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDb0B-0007MQ-54 for qemu-devel@nongnu.org; Tue, 20 Jan 2015 10:45:59 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YDazz-0004Uq-Hb for qemu-devel@nongnu.org; Tue, 20 Jan 2015 15:45:47 +0000 From: Peter Maydell Date: Tue, 20 Jan 2015 15:45:33 +0000 Message-Id: <1421768747-17240-5-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1421768747-17240-1-git-send-email-peter.maydell@linaro.org> References: <1421768747-17240-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL 04/18] monitor.c: Use ld*_p() instead of ld*_raw() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The monitor code for doing a memory_dump() was using ld*_raw() to do target-CPU accesses out of a local buf[] array. The correct functions for this purpose are ld*_p(), which take a host pointer, rather than ld*_raw(), which take an integer representing a guest address and are somewhat meaningless in softmmu configurations. Nobody noticed because for softmmu the _raw functions are the same as ldl_p but with some extra casts thrown in. Switch to using the correct functions instead. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Reviewed-by: Alex Bennée Message-id: 1421334118-3287-3-git-send-email-peter.maydell@linaro.org --- monitor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 1808e41..7e4f605 100644 --- a/monitor.c +++ b/monitor.c @@ -1292,16 +1292,16 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, switch(wsize) { default: case 1: - v = ldub_raw(buf + i); + v = ldub_p(buf + i); break; case 2: - v = lduw_raw(buf + i); + v = lduw_p(buf + i); break; case 4: - v = (uint32_t)ldl_raw(buf + i); + v = (uint32_t)ldl_p(buf + i); break; case 8: - v = ldq_raw(buf + i); + v = ldq_p(buf + i); break; } monitor_printf(mon, " "); -- 1.9.1