{"id":815625,"url":"http://patchwork.ozlabs.org/api/patches/815625/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170919150313.10833-9-richard.henderson@linaro.org/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170919150313.10833-9-richard.henderson@linaro.org>","list_archive_url":null,"date":"2017-09-19T15:03:13","name":"[v2,8/8] disas: Remove monitor_disas_is_physical","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"e60d77e853ebe47c6e63498b62f76ce7e74713dc","submitter":{"id":72104,"url":"http://patchwork.ozlabs.org/api/people/72104/?format=json","name":"Richard Henderson","email":"richard.henderson@linaro.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170919150313.10833-9-richard.henderson@linaro.org/mbox/","series":[{"id":3911,"url":"http://patchwork.ozlabs.org/api/series/3911/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=3911","date":"2017-09-19T15:03:05","name":"Support the Capstone disassembler","version":2,"mbox":"http://patchwork.ozlabs.org/series/3911/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/815625/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/815625/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"R5DyBz7J\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxRr12TYxz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 01:39:13 +1000 (AEST)","from localhost ([::1]:43620 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1duKcB-00065E-Be\n\tfor incoming@patchwork.ozlabs.org; Tue, 19 Sep 2017 11:39:11 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:49198)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1duK3j-00089i-BQ\n\tfor qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:41 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1duK3i-0003mq-AN\n\tfor qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:35 -0400","from mail-io0-x231.google.com ([2607:f8b0:4001:c06::231]:49512)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <richard.henderson@linaro.org>)\n\tid 1duK3i-0003mT-6V\n\tfor qemu-devel@nongnu.org; Tue, 19 Sep 2017 11:03:34 -0400","by mail-io0-x231.google.com with SMTP id 21so726216iof.6\n\tfor <qemu-devel@nongnu.org>; Tue, 19 Sep 2017 08:03:34 -0700 (PDT)","from bigtime.twiddle.net (162.189-204-159.bestel.com.mx.\n\t[189.204.159.162]) by smtp.gmail.com with ESMTPSA id\n\th63sm360621otb.59.2017.09.19.08.03.31 for <qemu-devel@nongnu.org>\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tTue, 19 Sep 2017 08:03:32 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:subject:date:message-id:in-reply-to:references;\n\tbh=3hkq2jrf4zLN0ohNd3zfc5ZyRYqIqhwKRQspcnViGNc=;\n\tb=R5DyBz7J6PEUyn6OYT4uVuSvCPISa8RkIGPoZYGIkmD8g0zymWqZIiXDdH2JXKDRL2\n\tfFQ94tDa8VKO7bwmO9ipoh4mimwaSUN4Zz/8GuDoZYWuydCL0l17xxhLfRBRWcn/Pq9J\n\t2KhYGAmcwtgAyFtPMTt/u+07qWiZ08paNg50s=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=3hkq2jrf4zLN0ohNd3zfc5ZyRYqIqhwKRQspcnViGNc=;\n\tb=gVk40/7AlB82UkY9J2ABKLW2/ZbN9+wmx6Q6WxZxrd8JcoNCvwnEH7TIwdC5lb79mE\n\t1+/ymveRoFwNw307MhdelLmnfYswc/J1NnMizJL5Ulm+0FA+IvBYRZdvm8to5k3j0K4K\n\tg5EfAFlSEEhDP6VmkebPXPhDlpLDE3gVPWXzqrZXr72LvKzkg9VC2USkPP1ExJCzTrrz\n\tV6VAUNKYz+Jf4K9BS0KWz+NQmmNItDzm+PNVjajLyBNRPaBvLrRMpC8ZSOW906OlHZOM\n\tMNXYZcBZhygBBVk/TXEOJK+ZhfupQX90cjyIo0xwtIWSTdqNpo3AMTAkXwZTYatJRnuV\n\t4pPA==","X-Gm-Message-State":"AHPjjUjX4SdqLjYg1f2qZiLsARhnW17f7NQLSf08nwu96JlNFG5Yqwsr\n\tUvyZhL3ugWAtsST7fuBoa1STkpVkzj0=","X-Google-Smtp-Source":"AOwi7QCMFvjmTBa/eqt1ZOOTupThjbksJa0WfdhL/jItr1QYHPEWYi/xe5DpxK3PTOuXkYYlJRMBvw==","X-Received":"by 10.202.4.6 with SMTP id 6mr1767974oie.240.1505833413126;\n\tTue, 19 Sep 2017 08:03:33 -0700 (PDT)","From":"Richard Henderson <richard.henderson@linaro.org>","To":"qemu-devel@nongnu.org","Date":"Tue, 19 Sep 2017 10:03:13 -0500","Message-Id":"<20170919150313.10833-9-richard.henderson@linaro.org>","X-Mailer":"git-send-email 2.13.5","In-Reply-To":"<20170919150313.10833-1-richard.henderson@linaro.org>","References":"<20170919150313.10833-1-richard.henderson@linaro.org>","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:4001:c06::231","Subject":"[Qemu-devel] [PATCH v2 8/8] disas: Remove monitor_disas_is_physical","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Even though there is only one monitor, and thus no race on this\nglobal data object, there is also no point in having it.  We can\njust as well record the decision in the read_memory_function that\nwe select.\n\nSigned-off-by: Richard Henderson <richard.henderson@linaro.org>\n---\n disas.c | 18 +++++-------------\n 1 file changed, 5 insertions(+), 13 deletions(-)","diff":"diff --git a/disas.c b/disas.c\nindex b4e4fc409e..c3606b3986 100644\n--- a/disas.c\n+++ b/disas.c\n@@ -513,19 +513,11 @@ const char *lookup_symbol(target_ulong orig_addr)\n \n #include \"monitor/monitor.h\"\n \n-static int monitor_disas_is_physical;\n-\n static int\n-monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length,\n-                     struct disassemble_info *info)\n+physical_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length,\n+                      struct disassemble_info *info)\n {\n-    CPUDebug *s = container_of(info, CPUDebug, info);\n-\n-    if (monitor_disas_is_physical) {\n-        cpu_physical_memory_read(memaddr, myaddr, length);\n-    } else {\n-        cpu_memory_rw_debug(s->cpu, memaddr, myaddr, length, 0);\n-    }\n+    cpu_physical_memory_read(memaddr, myaddr, length);\n     return 0;\n }\n \n@@ -540,8 +532,8 @@ void monitor_disas(Monitor *mon, CPUState *cpu,\n     INIT_DISASSEMBLE_INFO(s.info, (FILE *)mon, monitor_fprintf);\n \n     s.cpu = cpu;\n-    monitor_disas_is_physical = is_physical;\n-    s.info.read_memory_func = monitor_read_memory;\n+    s.info.read_memory_func\n+        = (is_physical ? physical_read_memory : target_read_memory);\n     s.info.print_address_func = generic_print_address;\n     s.info.buffer_vma = pc;\n     s.info.cap_arch = -1;\n","prefixes":["v2","8/8"]}