From patchwork Wed Mar 21 20:46:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10300395 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 30AFA602B3 for ; Wed, 21 Mar 2018 20:58:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19F9429791 for ; Wed, 21 Mar 2018 20:58:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F0A7297B5; Wed, 21 Mar 2018 20:58:10 +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 B431129791 for ; Wed, 21 Mar 2018 20:58:09 +0000 (UTC) Received: from localhost ([::1]:57401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eykoC-0003O1-Ui for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Mar 2018 16:58:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eykeS-00024g-O4 for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:48:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eykeR-00028j-P6 for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:48:04 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:44141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eykeR-00028K-J2 for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:48:03 -0400 Received: by mail-pg0-x244.google.com with SMTP id l4so2399651pgp.11 for ; Wed, 21 Mar 2018 13:48:03 -0700 (PDT) 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=cebw67eAM1i+wzY5kkXQm2qFpl+JQdDvtJVG4UB9Wxc=; b=hHKpvui7SDOdB3tWzIqGMVLh9Nr7c0mmKZwu/3d1y85szxjPrwhX92UXqaCJA2rCmm 1zclhdvNaVGbq3jiEZt0mrBRoFhABXA0uqdLVfkCrdy27LvrS5de01uf7jQYaX4Qed16 xzN5Lydp5foZeFwR2SbpHUoZNR4DyEYYAcq0+KzQXsFJ7wQg5glzGsp7x0szDnwAxckO YSMW6ZDTELYw3tgB6S6PjgZi6tB2KttUgTC3/ovwT6CUC8GrkWHUKO4VCS4KNHALRKOH rK4TNes5KDRlNHs9PfO+hF8XVI6xG/ifafLYRPacKpdwmJWHUS05/vVgCWeHbCANxP0c gp9w== 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=cebw67eAM1i+wzY5kkXQm2qFpl+JQdDvtJVG4UB9Wxc=; b=bYGVnuDFLoSpNnnpkJYIN/MVF2RrGkiBthnIMI5cefA1PP3SHOU1DH+7aS8ULNwkSV qu60rmW5uRGVCf704ELySJdRKKkYqP4eLQEcvCP12kevujeHUytpVtkoldsTRqwRfA7O t2NgM0oJRy0y+08iJqhyL3eykSjRharI0aGnvjD3OjAD7ZHuojKVge2NSwt01+CBecvQ /T4jl44VBnfGuHGKGq3IllRIwiWp30Rt4P5jXeBEC+BqYOPPTx8vIHtKJC354OtWwkNV eFTb1bFNZSQuyDjyutaT20Vmpiv3OmonRT0BadnEhwGHpUiFJ4VJlip2DBuBCl6YCjw6 atcA== X-Gm-Message-State: AElRT7EE8Xh7hSsldu7w6k8E1YwcQTdVoreWv5X8a6oQVQzt/YHgbIcR CQV8nZIvC6EtRp3kru2slCbq1oT4MoA= X-Google-Smtp-Source: AG47ELvSfnNlTXMYgoTj/B1gZmSRe9UW8SoUJkur9JSYHj08UZuFtF+5KxVtcG6t5enZLjvG/XvXbg== X-Received: by 10.99.115.3 with SMTP id o3mr738823pgc.428.1521665282473; Wed, 21 Mar 2018 13:48:02 -0700 (PDT) Received: from monty.com ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id w10sm8244499pgr.57.2018.03.21.13.48.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Mar 2018 13:48:01 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Wed, 21 Mar 2018 13:46:50 -0700 Message-Id: <1521665220-3869-15-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1521665220-3869-1-git-send-email-mjc@sifive.com> References: <1521665220-3869-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:c05::244 Subject: [Qemu-devel] [PULL 14/24] 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: patches@groups.riscv.org, Michael Clark , Palmer Dabbelt , Sagar Karandikar , Bastian Koppelmann 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 --- 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 9010620..b2e3f45 100644 --- a/target/riscv/helper.c +++ b/target/riscv/helper.c @@ -234,7 +234,7 @@ restart: hwaddr l = sizeof(target_ulong), addr1; 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