From patchwork Wed Mar 21 04:47:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 132182 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1696551ljb; Tue, 20 Mar 2018 21:50:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELutBuYaKHLr4258TQHJx0Sh3WgXa5ujoQY9mruQ34piv2uDw+Snfkqc1cpAQ1a2yJHVF6tM X-Received: by 2002:a24:c281:: with SMTP id i123-v6mr518075itg.146.1521607818290; Tue, 20 Mar 2018 21:50:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521607818; cv=none; d=google.com; s=arc-20160816; b=ylSHI+5xttVRZsa0jP9EzKqSMN4l5pWqads9SjAYK7FZA9yNNaaDrnfiubDX6EpUUi ZdiPiUlSzEQQFZ9QZoysgebrfs/av4o1dpZ1D5drO3LtVAtKywRectQOukOl2IP6n2DS tK3h2lZVP26hi1XV03prNW3pquV3oXyYjDXzzwG1Fl+g3SLJGF+FEjk5BY0TuBhIQBEn upcVbDuvGUpUnXZOi7YshHeVYmpAbXHly44Qx1bzzB10KWnZZwbw0TDjMtp/na5KVRy7 SRm9OvTuxCUxzvqoL6bJhoCtSllP51++EGNfRvmn4137TIKMIXM+VeI6S4zdlzY2Bw/I fwdw== 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=nalveKMfiH7iP1YVjinO/IKKrnftCMrk6XNJfLPXD1s=; b=wUMIho7uF3uKE2mjMNVM4TqSnRQzlfbkVKlzd1yhe7+oUg1Z3uEYDQOOOiUBSNF5zM ZVBermaw9NYbg46/HBzhBiLrVYYs1N8COTbkGc4ZhZ4uzOCvVhIi0PerOf1GghbFTtH5 dknY5yhh7N+/HAJfif2fBvjq5E9IU8cHdAr8DakOoJHHa3Unx+YypyX/MTyXkqcad826 LwkKaNsZKp2n3AO08Uyl9fy4CSNpWIF+/r5Nw+0j7u2Qhb2Qkt/2i0FrzBHcw7Z2pKo4 4yjMZ05TYGCfNPmqoNioIYKnkB3+voo5DB4rbqy4Vr4eefpxOPo8LbSKSG2YqijRjmZm qCcA== 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 i197-v6si2447962ite.127.2018.03.20.21.50.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Mar 2018 21:50:18 -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 1eyVfS-0006q8-4l; Wed, 21 Mar 2018 04:48:06 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eyVfR-0006pQ-8C for xen-devel@lists.xen.org; Wed, 21 Mar 2018 04:48:05 +0000 X-Inumbo-ID: 1b56cc51-2cc3-11e8-8248-2fda3a446a53 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 1b56cc51-2cc3-11e8-8248-2fda3a446a53; Wed, 21 Mar 2018 04:48:32 +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 6DA9C15B2; Tue, 20 Mar 2018 21:48:04 -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 A31F33F487; Tue, 20 Mar 2018 21:48:02 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 21 Mar 2018 04:47:30 +0000 Message-Id: <20180321044737.20794-10-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 09/16] xen/pdx: Introduce helper to convert MFN <-> PDX 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: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich 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 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 v6: - Add Andrew's acked-by 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 */