From patchwork Tue Apr 3 15:32:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 132759 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3954123ljb; Tue, 3 Apr 2018 08:35:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+vOXwumX1ciQE6l4NrLZFpUuv3P8y1J1qmoH/iDRqXNU+iAqxvT5pIzmm5604Hs5sOh3me X-Received: by 2002:a24:e445:: with SMTP id o66-v6mr6136294ith.117.1522769716902; Tue, 03 Apr 2018 08:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522769716; cv=none; d=google.com; s=arc-20160816; b=ogj1J/uV/X+Tcd1Y/LsT/6d51S3FiVbWtZQxO3wk5XAymgDfLNnij+RhJkp7Cngtd3 sDVVG0Pexz9fwf6RJeJziWlUiErPeniKkqQO1+zO4y7xvkWrMrabykiKg/ONRdTAW8ED rzaNTvQ+cK0AV+P0DK2zaflcnqVs6lPsKzBtG6COAT5wjUmEhOJ80ejXSyNwdqQbnIjc kOFDy6LU4NgLhABMrjrVd5EYOVrQ9Oq7UbdE9b0HdVhXjkU3yBj2Zcdqxi6VvTvrHvwK d8fQ/FhFmkhtNvp3aCqN8ZamkyZiQ9UZWM3p2dnXcTnxHOh+3QuulaZay/bGs74uOuU+ NvYA== 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=SXcqkEdONmH84x1aHlSf7IYLFNhiAJmtBzsanE8hvr0=; b=N5J49aQjUcYCUIkUAr1UbPXzunLxu5uZzeX6u0S9HH1JxscEadYHKrfx7yH4fcVnnN Ht8wsvEK3gd8j+kXA4jeDr//MisBAQby2z4/NJ+zDVU7YZPh+96qG/f80eVF0K2AcSL7 F5ICkSBbegH4ffnZpsPZxju5v730oYD5E54AyrWbNLe0BeaLFQ1pqi2DyyCt+jFyVe7I e1Kq/4EqG+ON1K6u0vvep2pikabp6aIN/8FxVqbhE6IglRnTeq9/vAgmgrGkitjz3geS Rr6RY376RnuYkHOrVT54VPtWtHlYAmAT4CoTZvK8zemLabIpZ/kPtCcMVeCf5Rm0jR9z bAhg== 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 m141-v6si574023itm.0.2018.04.03.08.35.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 08:35:16 -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 1f3Nvo-0007n6-65; Tue, 03 Apr 2018 15:33:08 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1f3Nvm-0007me-SF for xen-devel@lists.xen.org; Tue, 03 Apr 2018 15:33:06 +0000 X-Inumbo-ID: 38c31036-3754-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 38c31036-3754-11e8-9728-bc764e045a96; Tue, 03 Apr 2018 17:32:30 +0200 (CEST) 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 8F85F1596; Tue, 3 Apr 2018 08:33:05 -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 A56EA3F24A; Tue, 3 Apr 2018 08:33:04 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 3 Apr 2018 16:32:38 +0100 Message-Id: <20180403153251.19595-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180403153251.19595-1-julien.grall@arm.com> References: <20180403153251.19595-1-julien.grall@arm.com> Subject: [Xen-devel] [for-4.11][PATCH v7 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 , George Dunlap MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Julien Grall Reviewed-by: George Dunlap Acked-by: Stefano Stabellini --- Cc: Stefano Stabellini Changes in v7: - Add George's reviewed-by 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;