From patchwork Wed Mar 14 18:19:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 131709 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp156986ljb; Wed, 14 Mar 2018 11:22:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELsol6NYjtvgb76Zbca3XxApzRmUff6bh0cH1IJcucgE0Htmrt7Zqq3a3LK+SR+B+rt19hUn X-Received: by 2002:a24:11d2:: with SMTP id 201-v6mr3029552itf.73.1521051754065; Wed, 14 Mar 2018 11:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521051754; cv=none; d=google.com; s=arc-20160816; b=g6Kw6tt4sM13l3DdxgJ1GQIewotZV/W0m1v9EN3/ebu5JzaMJ6qrgOdrAwvGmD1qzw AkDDspGgCnU+n+OsluW6GIuT0DgWcKHyfVxctzRzcjL9L+5WY9rjXY87OwLmZhHxK+F7 t4wC2fiNC0Ob4hxIylOwcv3a2/ey83HqddWgBposYeyjGGEkL66/IS5HZ1ef+G7RZ2j+ tVA4S0VpW4hUir8+Ob68URjFXrWMo0sgXQijuL26+CL5K2B5rK4RnO31nU5CAu54QQnH CN/ucz4If6lhLcglkhdentJ6TOnMP4uEmQISXytEtWqGBEfigaZ64pfpAtnj2xlp6aJx /X8w== 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=ADjlmQVBJSL05RsI3zhRVthRv2ZN6nr65kOpyWN9vz0=; b=Os0jY93bxxpyCl01Fdw0rji3EQfEhpOkGN3j/iFgpx5hacNhch409pINrmxb7GJJoV ApO9UHNCbHnztPCX2flcU1wkEsrfypWEEiWI5gXaW6qAqyAgWJKIMaby2/ll0QXwiiTZ DB/jktP2dH0QlowZFikRm1iX0TiBazlgbaC98aPbIEw41l/9U0ks8qkKeUrLQhIoZqys /iUvmGOIhTxhSHNY4MW0ho1xg3+J+vJVGDaCUvbzYt/WNooZnzRtmIEFRfVVFv3sb183 2tEzBu8vCdj/Z/2iwViYm+JXYws9WZcZHa1jDQsr6RfDqA5omE4hdXCXotmnMnEBpVLb rHxg== 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 v98si2017874ioi.104.2018.03.14.11.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 11:22:34 -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 1ewB0n-0006py-7C; Wed, 14 Mar 2018 18:20:29 +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 1ewB0l-0006lA-Kl for xen-devel@lists.xen.org; Wed, 14 Mar 2018 18:20:27 +0000 X-Inumbo-ID: 5fcd4d2e-27b4-11e8-8248-2fda3a446a53 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 5fcd4d2e-27b4-11e8-8248-2fda3a446a53; Wed, 14 Mar 2018 18:20:29 +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 B405615AB; Wed, 14 Mar 2018 11:20:21 -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 EC8B03F53D; Wed, 14 Mar 2018 11:20:20 -0700 (PDT) From: julien.grall@arm.com To: xen-devel@lists.xen.org Date: Wed, 14 Mar 2018 18:19:57 +0000 Message-Id: <20180314182009.14274-5-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: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v5 04/16] xen/arm: mm: Remove unused M2P code 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 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 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 v4: - Patch added. --- xen/include/asm-arm/mm.h | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index 4d5563b0ce..c03f4ad674 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -320,33 +320,16 @@ 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; } +#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)