From patchwork Wed Mar 21 04:47:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 132176 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1696464ljb; Tue, 20 Mar 2018 21:50:10 -0700 (PDT) X-Google-Smtp-Source: AG47ELuKsc+OLAK/lUJfsvrenQEm8ilLICyv0ay8/GsVG51uyVgEyXOcXAeBXWkCPJZbk0/K2afF X-Received: by 10.107.155.148 with SMTP id d142mr18034156ioe.163.1521607810863; Tue, 20 Mar 2018 21:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521607810; cv=none; d=google.com; s=arc-20160816; b=zZ4yxQ7kHP6k5/uW+Dq9Rk9i55ZMmvPi8ld+VC8BsG9VwsJr6xyW1oCSPucD1ksgz4 sBaKUolez2sacZze4ffYSD/wcW6pHoc+OsjUYTjfs1kK4X+Ad9M+tNbl/uIJ5KnOmn72 Hlkd65oBq2qry+ULnAQiRGaV/kjY3hPTDB2l0VOdzpnSCL1KpXACo+EDdEEAtpqxYg9O h6WQnN9xMss/mmj7mCX575XraFcTP0cCPjPqiuP/urb0kPgIi5KjLD7ds4Hfct+orqzS 9jTxmNk7gsUXaZHtxX470t67KZTBBj7/NQbFLbRkmhDUeYb0uL2bIq6dgcTChqAuAIl1 DJbQ== 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=e09kvNul3S6Nmgad7x226ITw9Ftdk7awof5YG8/hoKY=; b=XMa4B18II6YjFsFTWS/IhcPipbYLF+KXA0BH+Z9gJtjdy5xvQurFvt6ceuZeS7/PDM E1E7z/appGvYn62Q0EiRuVRnSoXL7Px8Oug6q4+M3p9NymeZ0hrRZIM1fl9yyCqzSf+v Sx4Lo6CCZ3ef0FT3JEB3eQHKI+3fsRYePqIOE/Id9MHaBEZJPVBVGBVO4zPZJD32GzRW Njc190pBHkoxewjwgRp6cc1qiHtvzPQlHlKdw3CkxpoU9MQvCV/j34gAzW/07XTEORlO sT67j2mEdq/6Jyh3WaRJlOgERSTPOIabercwEuHTRq50RczpeqdLVIahjfUxjt1aLo3L pEUw== 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 72si2454425iou.267.2018.03.20.21.50.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Mar 2018 21:50:10 -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 1eyVfK-0006nB-AT; Wed, 21 Mar 2018 04:47:58 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eyVfJ-0006n4-IM for xen-devel@lists.xen.org; Wed, 21 Mar 2018 04:47:57 +0000 X-Inumbo-ID: 16a35548-2cc3-11e8-8248-2fda3a446a53 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 16a35548-2cc3-11e8-8248-2fda3a446a53; Wed, 21 Mar 2018 04:48:24 +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 89833164F; Tue, 20 Mar 2018 21:47:56 -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 C2E753F487; Tue, 20 Mar 2018 21:47:55 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 21 Mar 2018 04:47:25 +0000 Message-Id: <20180321044737.20794-5-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 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 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 --- 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)