From patchwork Wed Mar 21 04:47:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 132175 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1696437ljb; Tue, 20 Mar 2018 21:50:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELsLP2saknfnL23RuHWHryUNb8syMuQwl3VyNiPsP9picXziaukuHslEVra6CicL4eVErt6T X-Received: by 10.107.173.102 with SMTP id w99mr19405032ioe.13.1521607809465; Tue, 20 Mar 2018 21:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521607809; cv=none; d=google.com; s=arc-20160816; b=rU2Ih26aHohfSsWccFpL4yvGMwTwekNpjRXc+DHf/4BIZ83zWMGPcH6q/GHV2t1hkD QOyomOIKdfl3K20vfrIQK2yaMchcC7z7HbgXd4mOVM1vOQ00qCOlOn/DkB2LOni6lK0e 2GFRn71lajrgjHT6v5sJaSpx7gMBL5xo22qSlgPMWXEZmp0SgekIFQVTPa+XqRHBSZqR xMVeFLxm4JT9XRV/vYPuDqdRMM/+lhwXZN+JMe0e+NibqXN5F5ScnkDwy70rtxRA4Lv6 PlVojKjhkHYwSFQ7aK/Pyp1K+ws+Cjkw3FMCGmRT4wKjnTpGBJyR9yv+BYbAbRmgJYCw aOXQ== 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:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=yq+DrWK6Lxs00uoEkLnWHpdes0utB0FgX0YPdS1u5Qk=; b=LJO6QGrK4QX9h6P8sV3hrySpWrm1yGNUdm5l9QWuHxcWcCrvaOeBaSVAAQTXw+FstP UW5BK2lpnIN18s/BSGUO2m2G515h77KTdUjDIuT670u9buUPeksG1uSP1SAGYYxFUx2O oCnig94XYEbeu3+GZA0yD/UhQkQF28k3JyIOKGSCX1u0t9cc+MD60hYA2R0Rmvw5WMDT skcyA6w0z4AUZ/SRruWh68MR+W2xOmdCdeEKnLmQCMhpwA/M8XTbVXAzNt0Xlw67Y5g2 RoROxgVQA3BffbAb2tm7TITPYwb5UnX75pvzyTXgrdv24DoSS1gLJUti97iJ9Vk8yvJW d+5A== 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 o141-v6si2498558itb.114.2018.03.20.21.50.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Mar 2018 21:50:09 -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.89) (envelope-from ) id 1eyVfM-0006nn-TY; Wed, 21 Mar 2018 04:48:00 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eyVfL-0006nL-15 for xen-devel@lists.xen.org; Wed, 21 Mar 2018 04:47:59 +0000 X-Inumbo-ID: fd2a265e-2cc2-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id fd2a265e-2cc2-11e8-9728-bc764e045a96; Wed, 21 Mar 2018 05:47:42 +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 84E3015B2; Tue, 20 Mar 2018 21:47:55 -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 BE3273F487; Tue, 20 Mar 2018 21:47:54 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 21 Mar 2018 04:47:24 +0000 Message-Id: <20180321044737.20794-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180321044737.20794-1-julien.grall@arm.com> References: <20180321044737.20794-1-julien.grall@arm.com> Subject: [Xen-devel] [for-4.11][PATCH v6 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.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Julien Grall Reviewed-by: George Dunlap --- Cc: Stefano Stabellini Changes in v6: - Remove the justification from the commit message - Add George's reviewed-by 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 baa3b0de1d..1126e246c0 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1431,7 +1431,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 ) @@ -1443,7 +1443,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;