From patchwork Fri Dec 14 14:41:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 153863 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2157893ljp; Fri, 14 Dec 2018 06:48:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/W4KK9vKTSIjp0IUhZlkWqcwkz4TQFfB6jcfqnEkCYu7kkvF/aJWuwqYTZoCg1o0skZqal1 X-Received: by 2002:ac8:3181:: with SMTP id h1mr3192690qte.14.1544798889648; Fri, 14 Dec 2018 06:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544798889; cv=none; d=google.com; s=arc-20160816; b=e5NdZKBj6tS/wmZCegq6UEEiOMJXQp9Vvt+KNe/+Y+p994MAV56PTYzPggW9EWUWuf 1E8ogcI8bAFlFXJwD7f5KRiYLAvImsI6g4cqZd4PUeybhtRNkBNuSIGerrlA9tfDlMLd UvdqeUhwlGwiDzSJaf01t9i516LbQolPg/6UmA1KGHkKrDinuJWCT8nhe3ABgE34IxQt DbFRM4HiT+o1zexQPw7hrC8jQ6cFHWULISJQIz6ZtgAF4KcQ/D9SfGKc3YJre3k6U3/A wIPXbwwlGxF5uVHcipdVIsj6D2EDeW8YXwR4xaPqTiG6JWeGYuwViPOaovvqxsgvN527 t3zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=GzpwMa38pQNumScrhj2AwYOdGCjzti50x95h3MK8yCc=; b=Um1WOWlycwNA9099BWCrrqwFuPSd3mA8zBzz+eWsL1VtH7iRuCK65A+HI12gcHhO0r SSVnMEaTZNybJdWi5w+L0pwqBNjwMrKHJzdqu/ygiSqnCTybHkDD0bphcgySd1xODKiD ivuGSgodSDSLd/t3xcTF8viJb0eak/ksnXpIF8gT9aGg9Al3GMFR0mMS39chs1O6TsXu EM1ksn/kUedl0HvKWERnQh4z2hqXkcWKrDad5dRHsq995PcsnlalDF/CLkt3BPO1CSHW WfcrqCyP3odrKnCE6TIAvP4kbRTCam9hPbcbDtSrJeMuyltrVlu6brgkp+SpTNWYI52i X1Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BrSaZmwa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j49si3021340qta.341.2018.12.14.06.48.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 14 Dec 2018 06:48:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BrSaZmwa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXol7-0004Qx-3V for patch@linaro.org; Fri, 14 Dec 2018 09:48:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXofY-0008Mf-8V for qemu-devel@nongnu.org; Fri, 14 Dec 2018 09:42:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXofX-0004HD-Hw for qemu-devel@nongnu.org; Fri, 14 Dec 2018 09:42:24 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:52671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXofX-0004Gb-AM for qemu-devel@nongnu.org; Fri, 14 Dec 2018 09:42:23 -0500 Received: by mail-wm1-x329.google.com with SMTP id m1so5920123wml.2 for ; Fri, 14 Dec 2018 06:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=GzpwMa38pQNumScrhj2AwYOdGCjzti50x95h3MK8yCc=; b=BrSaZmwamcAy99X3UDRTQETuZQy9YlSeyCMmteKWAa9nmik/ALpA21rTOcuZaESgS5 eBEd0o7CbdzNvnM7KszZMWvI1h9ZMi7Esh/g1r7fdCUHjLDB/4GhCVD54kUVO8Few4Ve pb5Jnvf+rm3BOkBNssDh5ZI5nlw+vT2gaEWy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GzpwMa38pQNumScrhj2AwYOdGCjzti50x95h3MK8yCc=; b=jhNuFDfX8YnxZxSVoez0Tafn5AIE6pjEsJUFisCbD6t+KDX3uH/ccz1ZSU0GnavEym PFshdEUT7tZ7j0YHcau4GZ4N27Rv+GbEg9A9Rzm5ZNW9Ek4E2vPKAAgvVP2U2vfxoyue cIxfkr8vA2RdXupxQQIDmVxUh/DYZI9DQc6LQh5xeHcjHsEOEZrjlWZmf/ApT1oIhz3i HpJul5so/BKqTNicVqHfk4qfPGO880ig06hYgUNM45EAkY1fyWXtmO/Gywbf7cIzUWDl yoMjux4tvBxZpWSAbqJp1u17eYj5IjRMrXZ4kiPp3PPoTnTl0DKVHVmasc4wQGt/Zo2i +HMg== X-Gm-Message-State: AA+aEWbrqQWEXENIbyqqrY2UA9gvoWeAzApjIZ6OdYyzoWm5f5/r2ue3 7hQNa5qUcUX9alsP3KmD9Pke4K8MLMk= X-Received: by 2002:a1c:7619:: with SMTP id r25mr3760070wmc.7.1544798542085; Fri, 14 Dec 2018 06:42:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id m6sm3263204wrv.24.2018.12.14.06.42.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Dec 2018 06:42:21 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 14 Dec 2018 14:41:56 +0000 Message-Id: <20181214144214.1260-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181214144214.1260-1-peter.maydell@linaro.org> References: <20181214144214.1260-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 Subject: [Qemu-devel] [PULL 04/22] disas.c: Use address_space_read() to read memory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently disas.c reads physical memory using cpu_physical_memory_read(). This effectively hard-codes assuming that all CPUs have the same view of physical memory. Switch to address_space_read() instead, which lets us use the AddressSpace for the CPU we're disassembling for. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20181122172653.3413-2-peter.maydell@linaro.org --- disas.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.19.2 diff --git a/disas.c b/disas.c index 5325b7e6be6..f9c517b3588 100644 --- a/disas.c +++ b/disas.c @@ -588,7 +588,10 @@ static int physical_read_memory(bfd_vma memaddr, bfd_byte *myaddr, int length, struct disassemble_info *info) { - cpu_physical_memory_read(memaddr, myaddr, length); + CPUDebug *s = container_of(info, CPUDebug, info); + + address_space_read(s->cpu->as, memaddr, MEMTXATTRS_UNSPECIFIED, + myaddr, length); return 0; }