From patchwork Wed Feb 21 14:02:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129077 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp666698ljc; Wed, 21 Feb 2018 06:09:27 -0800 (PST) X-Google-Smtp-Source: AH8x226ULecyY5M7BG+CivAqgXor2SIU6LEu5EGfI6BBcq7A84beC/iF33ZJylhAxqYRmX0aDEeq X-Received: by 10.159.43.143 with SMTP id y15mr2493807uai.96.1519222166944; Wed, 21 Feb 2018 06:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519222166; cv=none; d=google.com; s=arc-20160816; b=rC/TC1deicydkuuJ1RU5XQfX3Vml/JnZugkLLpKT2QX7avrZzsVZKZLAi/vV4vO+R/ y5v693AShym2+wiZHS3D+zh0C0YO2wF5sF1u6u31amkRBIgTA88Y8gpwDi/A0/k4i10y XmhFHnFPHyfvzY+nCjktc/G3Crg080n76m2p8MIFJf55ph3rkpxW6k53BnbPg2OlXt9+ IS6e+GrPtj0EtI+0RjQ8El7xKTHSJ0pdVQJvCzOxSvzN6/kQt/ztM/9RLZM67kxiCUPJ uuWm9U2Mezr7TVNgMT1yFLNoqxRLIll5tsPW/HsEIm3V5IrFy3viyAQ+mSu4dypIDLbO 9Gsw== 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=stRXZXZwGTLbhEaCGggKxxSS0DrrzBsXbkPPIX4x9uw=; b=UaySF4O1h8Obp+DIOQsJGFibGbzl83UqXcaJxCeDnNw4obZmfM1o5g6pZqc1ZbIu4v PB+U5Jw0nd/u6kpmlw5ywsJlN7iZz4Tdbe+Ak4uvoCmZb5cfv/TEXnJ/v1YNqgxeXFzT R0A3++aOoqqDjjOjjhFbsmcw2g6GNAtl1Q79+1OXQ/IZSqnegE862HfqUjJ0Q4kP/iTb hgfWRWVeavBPXkFxnBKopvfeeL7gN3Bzu6QD3uXlqD9TIg+fbjUdn0P+u1tXUOwgzVgU rvdO0begxN8GFzyGvv1lUaKRUXej+XqwQzXAnMO5QmkGwFBRIucvNBvcaHvieFKMYjui ZsQg== 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 m28si1813633uai.332.2018.02.21.06.09.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 06:09:26 -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 1eoV3R-0006IG-VJ; Wed, 21 Feb 2018 14:07: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 1eoV3R-0006HB-KB for xen-devel@lists.xen.org; Wed, 21 Feb 2018 14:07:29 +0000 X-Inumbo-ID: 3070fd52-1710-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 3070fd52-1710-11e8-b9b1-635ca7ef6cff; Wed, 21 Feb 2018 14:04:53 +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 ECB3C15AB; Wed, 21 Feb 2018 06:03:16 -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 30ADF3F318; Wed, 21 Feb 2018 06:03:16 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 21 Feb 2018 14:02:47 +0000 Message-Id: <20180221140259.29360-5-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: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v4 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" 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 --- 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)