From patchwork Tue Apr 3 15:32:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 132757 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3954103ljb; Tue, 3 Apr 2018 08:35:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49+OrkA5Kt2ImnlkIMEeUmwixumJgo+9LEAfHlQikXctHNLWwSIEdCalrofl/5UxwWHUWhT X-Received: by 2002:a24:715:: with SMTP id f21-v6mr5834443itf.150.1522769715979; Tue, 03 Apr 2018 08:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522769715; cv=none; d=google.com; s=arc-20160816; b=Rnp8CsI2572ILdV2VjX71Yx9fXYLrRY8seEaJAI6Kmlryy6lrw3Dpol5UMV+aj6iX/ OU9PCgZsgdzdX6Y2YJVFRe1Kzd51gIOireMPIVWKNsJB0sA5AV0hqgiZwrbgVYKkaa6a cX2CLrdqPJNk1Zk6X645m70xjj2cWkNAjwpRS2DOxpBGYZyuJ1UsRP7iEXi2axFCcfz2 FH3yf4cefVUWPVgmDw0JjRxy4YMGTSFHxYaQHTJryDW0cZAV31IDoRNabbyPmXmvCpd5 AB8zep32yiD5Mpi02jkmSmR2UBvwAuNTwimqn3+mFDe6x4t3puiGTjIrgPlrh4grAeMB Fm8g== 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=5cbx9EKu/5m0eEenW+spiq8+/ywoINdSwpFSHVeCZpo=; b=XTI4IwQin29o3yfTmO0FI6XSta9v2pSc1FEcxblgdLOasT6nGD8yqQPTApVYBfe8Ka WYzBkiJIMSqAa4xgMtl+mKMTVD1GVdr+zo18kWhaTptLaxwBH3+mzuzx3ncRPIdXmve2 FrR8DDPyNUSqsmsXYM6sxH49OoI8uicV3+i0m8z2WA1/PfMiVdt5NYOEqg+RviIMJaCE V/m6A/br6AMavpzYp1yEXm7SDxD5FBBCTgCvG2oC6/Kd2Cbkl6+c9UmSbcJrdQ9ew5ix PZ/sicbO7YMAGkm+Vj1nCz57u8xzR+czKb76KIYAa39cmifv5e2p/k6ibK8iXBro09OD GNcA== 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 r64si2056561ioe.22.2018.04.03.08.35.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 08:35:15 -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-0007o6-PM; Tue, 03 Apr 2018 15:33:08 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1f3Nvo-0007mz-6l for xen-devel@lists.xen.org; Tue, 03 Apr 2018 15:33:08 +0000 X-Inumbo-ID: 78a31b80-3754-11e8-8249-2fda3a446a53 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 78a31b80-3754-11e8-8249-2fda3a446a53; Tue, 03 Apr 2018 15:34:17 +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 B731415AB; Tue, 3 Apr 2018 08:33:06 -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 CD4A23F24A; Tue, 3 Apr 2018 08:33:05 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 3 Apr 2018 16:32:39 +0100 Message-Id: <20180403153251.19595-5-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 04/16] xen/arm: mm: Remove unused M2P code 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" Arm does not have an M2P and very unlikely to get one in the future, therefore don't keep defines that are not necessary in the common code. At the same time move the remaining M2P define just above set_gpfn_from_mfn to keep all the dummy helpers for M2P together. Signed-off-by: Julien Grall Reviewed-by: George Dunlap Acked-by: Stefano Stabellini --- Cc: Stefano Stabellini Changes in v6: - Add a comment to explain why we implement dummy version of M2P for Arm. - Add George's reviewed-by - Fix typo in the commit message Changes in v4: - Patch added. --- xen/include/asm-arm/mm.h | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index a0e922f360..cabb1daf30 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -313,33 +313,20 @@ static inline void *page_to_virt(const struct page_info *pg) struct page_info *get_page_from_gva(struct vcpu *v, vaddr_t va, unsigned long flags); -/* - * The MPT (machine->physical mapping table) is an array of word-sized - * values, indexed on machine frame number. It is expected that guest OSes - * will use it to store a "physical" frame number to give the appearance of - * contiguous (or near contiguous) physical memory. - */ -#undef machine_to_phys_mapping -#define machine_to_phys_mapping ((unsigned long *)RDWR_MPT_VIRT_START) -#define INVALID_M2P_ENTRY (~0UL) -#define VALID_M2P(_e) (!((_e) & (1UL<<(BITS_PER_LONG-1)))) -#define SHARED_M2P_ENTRY (~0UL - 1UL) -#define SHARED_M2P(_e) ((_e) == SHARED_M2P_ENTRY) - -#define _set_gpfn_from_mfn(mfn, pfn) ({ \ - struct domain *d = page_get_owner(__mfn_to_page(mfn)); \ - if(d && (d == dom_cow)) \ - machine_to_phys_mapping[(mfn)] = SHARED_M2P_ENTRY; \ - else \ - machine_to_phys_mapping[(mfn)] = (pfn); \ - }) - static inline void put_gfn(struct domain *d, unsigned long gfn) {} static inline int relinquish_shared_pages(struct domain *d) { return 0; } +/* + * Arm does not have an M2P, but common code expects a handful of + * M2P-related defines and functions. Provide dummy versions of these. + */ +#define INVALID_M2P_ENTRY (~0UL) +#define SHARED_M2P_ENTRY (~0UL - 1UL) +#define SHARED_M2P(_e) ((_e) == SHARED_M2P_ENTRY) + /* Xen always owns P2M on ARM */ #define set_gpfn_from_mfn(mfn, pfn) do { (void) (mfn), (void)(pfn); } while (0) #define mfn_to_gmfn(_d, mfn) (mfn)