From patchwork Wed Mar 14 18:19:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 131708 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp156967ljb; Wed, 14 Mar 2018 11:22:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELsTp6I3Ewz6YZqn+aHVuy+aM72dsE2IQWWWou4Md/Ei/yZHCfgyWEmieVGb2QKykfZi2sn/ X-Received: by 10.36.253.204 with SMTP id m195mr3263353ith.151.1521051752668; Wed, 14 Mar 2018 11:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521051752; cv=none; d=google.com; s=arc-20160816; b=QbQZHMWSFrA6TbnA7mFXpeNYSTVVedi8s3dtBEv704oT6UWXIrnO2qzMLygwCEC5Qv YNUpY8L41/lQtMZNS4e+zofJiBVBjHFb951Cma+3PkguQKvgWd29jdwgC5+xfy5ge4Md FBXFe1bpk8rN9k6XR5IN6BVG+llSvUu9Gl2yUNw1QlX2karvzxN1C+GwHO+TB8ENGDep 9NM60SFLl3o6zHO3FT5umutM661BwgX8+F045lzMhD0yepad71xMlzXZcFVsytvsB8iz ska4/z8nG+6yDdXP0E0KgA31KcRWv1s8EckbG7jGtZPmacJxie/h9zGrVS/7HuMER/5F lPhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=m559Ve80Wq9QdNCr91kmUvzF5ysqxDp+1sSOixYLrDs=; b=b3XF9R4jnoDaV/aIvZQQas7n9QAwQoMnUTmRcO35XkKUGR4gqSWEkyWkF97tlQZTsR VQgsMUdYF9lZjYQI0C+fUV20KwVAbMVdy49ApH2pV86SAt2Whx0Xls59pO1vDd6TY2R9 rNY0rCQzts9qNLpqyV8mRsAv/1vA6K8feZUY6issRcUiCF43+zrs19tGUAX1RKaKCizV VSjYSaJ7t7eTYhl9hsUYyhgDYw2yzkZmZid82Ao6CZmRFvqN65NNP150MjncPyx6W+WC X90vweIZ81AMIOl3Lj7aeap/gGP5Sr1vA1sx43dG99ma8A4exUWLXYMNDw4dau27Qy93 Rt3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id h184si2056739ioe.96.2018.03.14.11.22.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 11:22:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewB0h-0006lK-2F; Wed, 14 Mar 2018 18:20:23 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewB0f-0006kb-LD for xen-devel@lists.xen.org; Wed, 14 Mar 2018 18:20:21 +0000 X-Inumbo-ID: 58b30988-27b4-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 58b30988-27b4-11e8-9728-bc764e045a96; Wed, 14 Mar 2018 19:20:17 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AE4BF15BE; Wed, 14 Mar 2018 11:20:20 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E6C2B3F53D; Wed, 14 Mar 2018 11:20:19 -0700 (PDT) From: julien.grall@arm.com To: xen-devel@lists.xen.org Date: Wed, 14 Mar 2018 18:19:56 +0000 Message-Id: <20180314182009.14274-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180314182009.14274-1-julien.grall@arm.com> References: <20180314182009.14274-1-julien.grall@arm.com> Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v5 03/16] xen/arm: mm: Use gaddr_to_gfn rather than _gfn(paddr_to_pfn(...)) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Julien Grall The construction _gfn(paddr_to_pfn(...)) can be simplified by using gaddr_to_gfn. Signed-off-by: Julien Grall Reviewed-by: George Dunlap --- Cc: Stefano Stabellini Changes in v4: - Patch added --- xen/arch/arm/mm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 3c328e2df5..9b77ab5f33 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1436,7 +1436,7 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame, if ( flags & GNTMAP_readonly ) t = p2m_grant_map_ro; - rc = guest_physmap_add_entry(current->domain, _gfn(addr >> PAGE_SHIFT), + rc = guest_physmap_add_entry(current->domain, gaddr_to_gfn(addr), _mfn(frame), 0, t); if ( rc ) @@ -1448,7 +1448,7 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame, int replace_grant_host_mapping(unsigned long addr, unsigned long mfn, unsigned long new_addr, unsigned int flags) { - gfn_t gfn = _gfn(addr >> PAGE_SHIFT); + gfn_t gfn = gaddr_to_gfn(addr); struct domain *d = current->domain; int rc;