From patchwork Wed Feb 21 14:02:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129061 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp662330ljc; Wed, 21 Feb 2018 06:05:49 -0800 (PST) X-Google-Smtp-Source: AH8x2269bdFI3yBuvM1cDD8rUhc85GDmGlmRK34GtIgEVmLF7w4yJ1siUQox9/iO4lSQL/TE+off X-Received: by 10.31.79.70 with SMTP id d67mr2444645vkb.9.1519221948857; Wed, 21 Feb 2018 06:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519221948; cv=none; d=google.com; s=arc-20160816; b=zRPNLznKaShpXPfRHpwWn5omkBRdg8nJb9a5MuvBLZELCwWHqI/8QRsZwiKZ4A5Y5K KDizb7sGLBFy+WNsZINSoGRlgA89Dte+GBV0HjFwh0XxejoOXyOS8wz27ZE7DNM2M7Yz kRFhiL65GrovakxiaesLfmuEjAKxGSVzFMFVp/N4L59rv0XcuvSWDqnex2KM9CiwE3GB insrfe26OE7HvM0jMskhHcdBYVo5yNvn3YkjmLnM2HYOdWX4w4TW0Enn8CJolEg0XKPO jRavughfWYEzchhWW1ZMCm7y6DamvLfshUnKQMg6Oj7etsc2L6m1rhwN7rrxz0WDLDCl VEAg== 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=3gngkEgguMLAh4b8Qwf0WmOFzAItGVBHkiMqw1oKtD0=; b=x4fxksg1lJQ6Dj+6I+5Wqhi9FUlSxI6fisVaUiP4o6qjN64oPO9IKwFiJq6Y5hgiA/ DB4pmQ8E3V+fVea/u+PSBvldtd78tItIYJWKmne4VUYneJ3+U0v2UOXTme6mzdPSInkR U4XvLaiDcTSSjL3VfLqpSNY3QLKOzhfRISLPX5zyjPBLj3aF3OhfGJ0gbVMKk/sruyI8 Z4eNqywu1wUQWDn7EA3HVWnunb63GyzTqVk05CznoCyTaw3yspUplfvLZQBe4MycMPcs Yk07kOzD7B3zxB2zAAbxFxaNslXPRKu0OvEBs+2GXo1fohEXsQ2azlBfluUA0QMPB+Kw EppQ== 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 l63si3996485ual.8.2018.02.21.06.05.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 06:05:48 -0800 (PST) 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 1eoUzQ-0004OB-H5; Wed, 21 Feb 2018 14:03:20 +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 1eoUzP-0004Nv-4r for xen-devel@lists.xen.org; Wed, 21 Feb 2018 14:03:19 +0000 X-Inumbo-ID: da702399-170f-11e8-ba59-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id da702399-170f-11e8-ba59-bc764e045a96; Wed, 21 Feb 2018 15:02:29 +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 E63DE1435; Wed, 21 Feb 2018 06:03:15 -0800 (PST) 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 2A21A3F318; Wed, 21 Feb 2018 06:03:15 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 21 Feb 2018 14:02:46 +0000 Message-Id: <20180221140259.29360-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180221140259.29360-1-julien.grall@arm.com> References: <20180221140259.29360-1-julien.grall@arm.com> Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v4 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" The construction _gfn(paddr_to_pfn(...)) can be simplified by using gaddr_to_gfn. Signed-off-by: Julien Grall --- 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;