From patchwork Fri Mar 9 04:12:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10269667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D085602BD for ; Fri, 9 Mar 2018 04:30:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E4E829C99 for ; Fri, 9 Mar 2018 04:30:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 029DB29CB5; Fri, 9 Mar 2018 04:30:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C90129C99 for ; Fri, 9 Mar 2018 04:30:18 +0000 (UTC) Received: from localhost ([::1]:43182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu9fd-0000jD-P2 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 08 Mar 2018 23:30:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu9Qq-0004QO-17 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:15:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu9Ql-00074U-F2 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:15:00 -0500 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]:44593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu9Ql-00074C-8k for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:14:55 -0500 Received: by mail-pl0-x242.google.com with SMTP id 9-v6so4604762ple.11 for ; Thu, 08 Mar 2018 20:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eHR2h5f0Q0YrN/kZlLZAy2G3Z/Q1Fs0I02rf8Dyey58=; b=cl8b396o1FQk2ua5TyFa1HjPTXBFNa0b59Bwcgbn19mZE2942wH4UCk+XEPaUjmPhB oNlk9NHeGCo4au0nkft6ffu3mSWe1iKXl5/RCRBn9MlnkT82flsVPSBhFjkR7TwvZAoc JRluEaQNN3+MWB5h55NjEp1i4oWAf8GsV2cF6k8fiybPZM3mmphy4Hl0B01XxgPA+jci 0u4bf64wAICMXlqfccKNMp/XfRVQWEXqUP6Fo/QUQknZluNL/e2/GdqExxayzwId086y D3TDTcOLTl76vNtvOxCxX4HiYm7BNSbrgPbFRzjYbtfMh2keGgwHx8J7RQEuXwAT2dvu PKQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eHR2h5f0Q0YrN/kZlLZAy2G3Z/Q1Fs0I02rf8Dyey58=; b=f8xua6tYeO0mTql0QIJblgmC7uqIKH3BYwJ5+JWBabVzz71ILBxzsWlXq2xNahVR5i CNPA1KXWxjI33mhLDxBa0hUxS+ID2iGx8CvkunUlkVGW6+XDe3bJmFPhHELdQSbrty17 nAOicI0d1PgVxDP9XTmPw5cQOaoUZTchA2gRfTKiBb4Twp4JLqbzkaS0OMjMhZwPhwnR BAtgmjH5nNdyXocKoOiVjdsUbJ14hlmT1cUghiTCNLeoD1ZAgcyWpcniMHibQF6NsE3k Wg/ThD/GWYl7QZQTa+okGsSyMVUHhIrjK5Gj46+/LUpEdLywq+ZaCZzFmW2c1mjv5+D7 hfQA== X-Gm-Message-State: APf1xPA8DgtLwc+V0OkKNVox5NiW8J1pUKJ1msiKCYmtTljMQ/iEqSrl V/c+2/R1D7Pfvk98kiOXv5HaqXjbBjY= X-Google-Smtp-Source: AG47ELs7gCB3iQs5FKSF/Ig/ATjsOqQAMR88PvIBGuIhphAH+ZBC4a5w+odA+fsvlS6ZeCAh7l7U2w== X-Received: by 2002:a17:902:6b82:: with SMTP id p2-v6mr26323637plk.326.1520568894423; Thu, 08 Mar 2018 20:14:54 -0800 (PST) Received: from localhost.localdomain (125-237-39-90-fibre.bb.spark.co.nz. [125.237.39.90]) by smtp.gmail.com with ESMTPSA id h15sm334141pfi.56.2018.03.08.20.14.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Mar 2018 20:14:53 -0800 (PST) From: Michael Clark To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 17:12:37 +1300 Message-Id: <1520568765-58189-16-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1520568765-58189-1-git-send-email-mjc@sifive.com> References: <1520568765-58189-1-git-send-email-mjc@sifive.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::242 Subject: [Qemu-devel] [PATCH v2 15/23] RISC-V: Use memory_region_is_ram in pte update 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: , Cc: Bastian Koppelmann , Michael Clark , Palmer Dabbelt , Sagar Karandikar Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP After reading cpu_physical_memory_write and friends, it seems that memory_region_is_ram is a more appropriate interface, and matches the intent of the code that is calling it. Cc: Sagar Karandikar Cc: Bastian Koppelmann Signed-off-by: Michael Clark Signed-off-by: Palmer Dabbelt Reviewed-by: Philippe Mathieu-Daudé --- target/riscv/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/helper.c b/target/riscv/helper.c index 162d5ec..fc550d3 100644 --- a/target/riscv/helper.c +++ b/target/riscv/helper.c @@ -235,7 +235,7 @@ restart: rcu_read_lock(); mr = address_space_translate(cs->as, pte_addr, &addr1, &l, false); - if (memory_access_is_direct(mr, true)) { + if (memory_region_is_ram(mr)) { target_ulong *pte_pa = qemu_map_ram_ptr(mr->ram_block, addr1); #if TCG_OVERSIZED_GUEST