From patchwork Thu Jan 15 15:01:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 43196 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 33A4E240BA for ; Thu, 15 Jan 2015 15:15:07 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf8272514lab.3 for ; Thu, 15 Jan 2015 07:15:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=c0MBXMGyKYTHBdZAkqHo86KLxvG9Oa2GnSdDARBjLCE=; b=KMKUGELbBoXE2BL7i/vvoMJ8qLlxWuBcSSxPDAxfjWIRFSPPdViGB9+OGm+4rD0fuW M9aGilcZ7bJWY7alpfzmCdaWegWFIN526SLTL1YY3etOtmmt0fn2s+QQaUkV/qmZJ8tq 6riz4Ys+n+iDA5WWiEMwp31oc3dF2+xXlc1Q89ICqvle2CUivF6WgEP8Zl0cBrf5RDOz V3gVBYafVoUqCtd5pFnOVgODWPNLORz0SUmcVPr/+X2yR5cwo1R5Z6WWTvi2QDphrxFI OcOJeIKFiciC8Luj4V5CgjFgp3TfmB3npvUt2bmRF0ITwD2krTz4vWs/XR3Vo8KdXAUe SpBw== X-Gm-Message-State: ALoCoQm7d79aAF4C6cbjZpckeXNIpppxEhNZ1+Gfof57VOKQPjWDmDd+E97fDhuTsN4w7K4S97Sh X-Received: by 10.112.181.198 with SMTP id dy6mr30080lbc.22.1421334906169; Thu, 15 Jan 2015 07:15:06 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.5 with SMTP id m5ls255750laj.71.gmail; Thu, 15 Jan 2015 07:15:06 -0800 (PST) X-Received: by 10.152.5.198 with SMTP id u6mr10602322lau.42.1421334906031; Thu, 15 Jan 2015 07:15:06 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id la9si1708727lab.65.2015.01.15.07.15.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:15:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id b6so13712870lbj.8 for ; Thu, 15 Jan 2015 07:15:05 -0800 (PST) X-Received: by 10.152.5.226 with SMTP id v2mr10465520lav.34.1421334905905; Thu, 15 Jan 2015 07:15:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.9.200 with SMTP id c8csp14191lbb; Thu, 15 Jan 2015 07:15:04 -0800 (PST) X-Received: by 10.194.189.138 with SMTP id gi10mr19863050wjc.86.1421334904219; Thu, 15 Jan 2015 07:15:04 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id gg3si32741727wib.6.2015.01.15.07.15.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:15:04 -0800 (PST) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YBlvq-0000rd-U0; Thu, 15 Jan 2015 15:01:58 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini , Richard Henderson , Riku Voipio Subject: [PATCH 02/15] monitor.c: Use ld*_p() instead of ld*_raw() Date: Thu, 15 Jan 2015 15:01:45 +0000 Message-Id: <1421334118-3287-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1421334118-3287-1-git-send-email-peter.maydell@linaro.org> References: <1421334118-3287-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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: Alex Bennée --- 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, " ");