From nobody Tue Feb 10 06:57:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508633618376469.76820803449687; Sat, 21 Oct 2017 17:53:38 -0700 (PDT) Received: from localhost ([::1]:59648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e64WH-0007E3-Gi for importer@patchew.org; Sat, 21 Oct 2017 20:53:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e64Pa-0002Iq-MS for qemu-devel@nongnu.org; Sat, 21 Oct 2017 20:46:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e64PZ-0008Pe-GJ for qemu-devel@nongnu.org; Sat, 21 Oct 2017 20:46:42 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:51804) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e64PZ-0008Or-8u for qemu-devel@nongnu.org; Sat, 21 Oct 2017 20:46:41 -0400 Received: by mail-pg0-x241.google.com with SMTP id p9so9199815pgc.8 for ; Sat, 21 Oct 2017 17:46:41 -0700 (PDT) Received: from cloudburst.twiddle.net (174-21-9-158.tukw.qwest.net. [174.21.9.158]) by smtp.gmail.com with ESMTPSA id j12sm5766728pgs.35.2017.10.21.17.46.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Oct 2017 17:46:38 -0700 (PDT) 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=ZPp5mFCuMXXtXXcl4cuF8jT0S6sf5Zb1W02xzDFlJ/4=; b=aSopRGqlWmzYhYjmLIshLCd6nkYpig5/K/tyuI0rKKda3JcC3ShBSl8C3ezGaAZgSL iDcwEhxzxh+uiFznOGA060M1VskBcu3xMbtRXwTO5V65al81Wdt+fR3OfBqoVMgOcN3L NHQTuioNXZB6sXMNSE2oS2egNLE0lFlfC6aRw= 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=ZPp5mFCuMXXtXXcl4cuF8jT0S6sf5Zb1W02xzDFlJ/4=; b=DOrBdzRd1+cVswlMQfkQp7HvCZRW8AZaR8qsQl0Ym/UMinw4xOe8Oudq041gTI8Nm3 CvHf9au0T6J/UBqFgCST3N51TRNfEglqEOoMLatMtcLRJACDSq4Lk8jMSOS/gH481ATj IZZJVomTeq8v8xWzpUSn0la/SBKq89gKzXVzVVjsCfkAd86oCaukmx5w1odvh6lPmlsh LgMJCCDXKrbEu8MaI5N+m7VtidEjBGtMUug0oAt9WxjgFtqvMaVUzb8hQhEZyutcghMB pBxIg6NUxi9p4TLIN+b4hLl1q/7YVCXjYH2s/C8iKnBD9YKFygssV3mQFztiVaL/w6IO ktKQ== X-Gm-Message-State: AMCzsaU1O997GPpbFIrX6zjxkSF7Jl47LD61oE2uVQRpRE2ciTFHw2/8 6lI0ZG8Q2K2fKQ2oP2UGmMvSp3h1cXs= X-Google-Smtp-Source: ABhQp+Tt5LqSIJtYNGCoahau6SwblHDEvkmBcFlLWvUlSl2tbZ/8FyGt1lAAruLBjn/96FS56uVftw== X-Received: by 10.99.172.83 with SMTP id z19mr8276201pgn.46.1508633200087; Sat, 21 Oct 2017 17:46:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 21 Oct 2017 17:46:20 -0700 Message-Id: <20171022004621.28372-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171022004621.28372-1-richard.henderson@linaro.org> References: <20171022004621.28372-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PATCH v7 10/11] disas: Remove monitor_disas_is_physical 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Even though there is only one monitor, and thus no race on this global data object, there is also no point in having it. We can just as well record the decision in the read_memory_function that we select. Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- disas.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/disas.c b/disas.c index e52e776a60..92b389d25f 100644 --- a/disas.c +++ b/disas.c @@ -512,19 +512,11 @@ const char *lookup_symbol(target_ulong orig_addr) =20 #include "monitor/monitor.h" =20 -static int monitor_disas_is_physical; - static int -monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length, +physical_read_memory(bfd_vma memaddr, bfd_byte *myaddr, int length, struct disassemble_info *info) { - CPUDebug *s =3D container_of(info, CPUDebug, info); - - if (monitor_disas_is_physical) { - cpu_physical_memory_read(memaddr, myaddr, length); - } else { - cpu_memory_rw_debug(s->cpu, memaddr, myaddr, length, 0); - } + cpu_physical_memory_read(memaddr, myaddr, length); return 0; } =20 @@ -539,8 +531,8 @@ void monitor_disas(Monitor *mon, CPUState *cpu, INIT_DISASSEMBLE_INFO(s.info, (FILE *)mon, monitor_fprintf); =20 s.cpu =3D cpu; - monitor_disas_is_physical =3D is_physical; - s.info.read_memory_func =3D monitor_read_memory; + s.info.read_memory_func + =3D (is_physical ? physical_read_memory : target_read_memory); s.info.print_address_func =3D generic_print_address; s.info.buffer_vma =3D pc; s.info.cap_arch =3D -1; --=20 2.13.6