From patchwork Wed Feb 21 14:02:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129076 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp666403ljc; Wed, 21 Feb 2018 06:09:13 -0800 (PST) X-Google-Smtp-Source: AH8x225gUXTPBr20SfVvqdDacubi02kSy9xQLz5b4ysDAqNH4CqzkpXythWBwB0pMj6lHOJ5896M X-Received: by 10.129.82.73 with SMTP id g70mr2247676ywb.100.1519222153264; Wed, 21 Feb 2018 06:09:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519222153; cv=none; d=google.com; s=arc-20160816; b=mGNmb2LQHru07bwJyagAzaniDfnAzWod+JQOpshzoPi5e4S9CRwdXVODCWx5ZSuioI tUmARbCTlBFgCNBQS2tm2gBKebNJEJAfy79wIn+EFe9cN/qqXrKxYqEWvx69x+kRnrcd xCv6jge+P5NnboIl+FBwXgAxXX65CKtx6md/cI4ahJWisDPNj82vVEUvPhZHR+1ucTM4 Uk8mbfU09fnhkn3F+HFSO5RYVS1k1CbyYNw55KFNj8Y+OWS9+OjuYwwipF1JtwSD56dN KslizzNGJVxJ70LmVZrewVvx3tk2SCTqgI7HI9g4WDKIiAEGSLqSzO4Lhof5jGerY8Bd jTsg== 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=gTq7qhwj3d5/HbU7dqtkqZas9zz3JkSL0obyTpNZi5k=; b=XA9+Bd9FZrwcOCsLWKNHusTamFrDwn1jMerW6YBqXZ8chNBkb1SP9qV62LKsztfRZc IRBeCGgpZ36XuWyYZ0eQ4LYdCyLojy9/U5BrNWRlNBfPMjE4B7NuZVucv2H8zGyrtiPS lUKloQG3q4wvzcoIXLsp2o8DoI6Iah5N9poSkR/vFJ6zqfqQg4CTgBo/b4bHtGkzap4V gylL1U9uMGpaxP3RiJailXh8picZUXmff9PM9xttNpwCq97W1RpQ0ZD7qM/HQr7pCll1 9sKtAqNB384T2DTnJZ0qo28WzfewN8RTaLHviU+unwwcQRT7rzdVGhIZU/9xgRMhhtCt pYWA== 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 m14si1960045qti.11.2018.02.21.06.09.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 06:09:13 -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 1eoV39-0006Ee-No; Wed, 21 Feb 2018 14:07:11 +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 1eoV38-0006Do-Fo for xen-devel@lists.xen.org; Wed, 21 Feb 2018 14:07:10 +0000 X-Inumbo-ID: 34fe3fa8-1710-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 34fe3fa8-1710-11e8-b9b1-635ca7ef6cff; Wed, 21 Feb 2018 14:05:01 +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 92E461435; Wed, 21 Feb 2018 06:03:24 -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 C61EF3F318; Wed, 21 Feb 2018 06:03:22 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 21 Feb 2018 14:02:52 +0000 Message-Id: <20180221140259.29360-10-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: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich Subject: [Xen-devel] [PATCH v4 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" This will avoid use of pfn_to_pdx(mfn_x(mfn)) over the code base. Signed-off-by: Julien Grall Reviewed-by: Wei Liu --- 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 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 */