From patchwork Wed Mar 14 18:20:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 131715 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp157174ljb; Wed, 14 Mar 2018 11:22:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELtHyOv4L1QcvQORbBdjizMBuVOfN9X9xoDbcJLB2ITqq8PIQf4IyFMyIlz/9DyfI7ls3CN1 X-Received: by 10.36.81.196 with SMTP id s187mr3120544ita.139.1521051763642; Wed, 14 Mar 2018 11:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521051763; cv=none; d=google.com; s=arc-20160816; b=BNKC3WDgP65trfr/CHzBwuuwatEh8WOf/zJq8dV5EA7SEr3jlxCv7VUdAig1nkEMSB elq4OdAnauOr3t/JCl3Jq98K5Pew3UJKzVtpfsBbO4qGIMrcuqw8HVRDqGdVKGLmL3Vu ryUG6+mZs5VckiwvJKXqkd/d8Y2aMF7CTOXKHEGOIPuAgkZEU6MXDxfskfxIvxIbRepC ynuuiOdvAO/zVgEudMPTim6jx07PGwLmO/b1vg6yN1fqfVxW0dWeIKtbCkwi/8IZsTLP S2HBO02JRLGrRgZvWm9cnBjf9NCZ8NMuSpizZjzdRk7fNJe+Gg33c8Zwzlly3XYTp43x VuiQ== 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=oX9dmPT26eTXgizD5nEX8K3TKei5C2pnsJ8RqlSQhZE=; b=MNaO30MjDMpXdWjdjt6XiSuwxFac0wvBmD99i2G/XlGyY3c/i7xlImN8v971+So2X2 bTVDKji9dMAnlgp6uvfW8/Oc/l1y0mBKorWVsS72iMbzDANpEvjL3gPTH9PSXag5+IBT bFA5dvuJfgRodBDs8ChG1a2VAZAFW4GM7rtrBMIMqapS2LD1EbH9f11dZCd8zThgFEfZ Rm8VfOsfeQLMvmbNfpUeVSfnBiKUJK/M7dv6IGW0nq5mO20vinzfhYuz8rC9ZZUEh45f zHuZ7biJJHp0vrGB3l1/n7Ko4tjq4FPgndijF+Kq52pSQDyzZdNaQThAR7DST8DTN1qy vUGg== 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 67si2074444iog.204.2018.03.14.11.22.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 11:22:43 -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 1ewB0v-0006zM-8B; Wed, 14 Mar 2018 18:20:37 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewB0t-0006rr-VG for xen-devel@lists.xen.org; Wed, 14 Mar 2018 18:20:35 +0000 X-Inumbo-ID: 646b62a8-27b4-11e8-8248-2fda3a446a53 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 646b62a8-27b4-11e8-8248-2fda3a446a53; Wed, 14 Mar 2018 18:20:36 +0000 (UTC) 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 7639015AB; Wed, 14 Mar 2018 11:20:29 -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 AADB23F53D; Wed, 14 Mar 2018 11:20:27 -0700 (PDT) From: julien.grall@arm.com To: xen-devel@lists.xen.org Date: Wed, 14 Mar 2018 18:20:02 +0000 Message-Id: <20180314182009.14274-10-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: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich Subject: [Xen-devel] [PATCH v5 09/16] xen/pdx: Introduce helper to convert MFN <-> PDX 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 This will avoid use of pfn_to_pdx(mfn_x(mfn)) over the code base. Signed-off-by: Julien Grall Reviewed-by: Wei Liu Acked-by: Andrew Cooper --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu Changes in v5: - Add Wei's reviewed-by Changes in v4: - Patch added --- xen/include/xen/pdx.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h index 4c56645c4c..a151aac1a2 100644 --- a/xen/include/xen/pdx.h +++ b/xen/include/xen/pdx.h @@ -35,6 +35,9 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx) ((pdx << pfn_pdx_hole_shift) & pfn_top_mask); } +#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn)) +#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx)) + extern void pfn_pdx_hole_setup(unsigned long); #endif /* HAS_PDX */