From patchwork Tue May 7 15:14:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 163536 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp3883097oca; Tue, 7 May 2019 08:16:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdjNyWIJCIIcVbdkDc7nGvotQmPNiXN/fe6m+7Fvqo3SF516xin3uX0hmIaF8I/jAEPHCw X-Received: by 2002:a24:8602:: with SMTP id u2mr26523199itd.101.1557242206967; Tue, 07 May 2019 08:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557242206; cv=none; d=google.com; s=arc-20160816; b=DMsunPnzcgbQbCZ2htLaNAc7UaGqZZu8OWuhL/qB+DN7bOLgR0xwk+mduhOLPNom4/ 1wBrXDZSrGEmcT/N45UgYIDXV7enLTYfnzrYXeHBFuBddWwQ+d9Ujk/mApVzjdaa6d5T REsu7iLkYbdd106c+Y41h2wlVkickuWsb7nILpn7/OeWx2vxReJIswXLGvkK3BsIyf9/ P1zpoa0wprKA90sVmqwlA7/mh2VDHK629kaWBj/zY4ts/AHCOQGi7zEoW0u5QwtOxIhP wvRhTV9RXgxVY3wA3t+of+EINgaBD05tDPhzG277byM4zzpUsOrNeyC6SrXw5Lbfdf+/ Ib6Q== 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:message-id:date:to:from; bh=9Tt+w7P5vQTxSkpVvyJgOjHxakXpYljV62952+Mz8lc=; b=xBAGTqtSvhegL5rAzhU1BxzTsoe+31Cek3xA0ehOQqvhHZvax5Kx/wYOHyBKYAojVC 8bLxNBsCI3p4qIXGbAZiYKs1LpNH2w3BagJqY+m+XbuRTNHMJMrVfi+estkK+t7l2UKw sMIyMNr8dEwT2abNUUuh4sVqKEf/T2AkzbiycmVTsFhlI+tED0ryhYRGRWHn/8DTVFC6 TB7OHt3NIjqKMvSDO0DkFTcQItNADXuO6jgneMobU33FKhKyGGx13O8mTOHXDnSgTs9Y WoX3nl3Q+GToQ6zUUSXL2QBbE9lVLVfG8f7aMD4QyCBffs0Lz0kgB+3nFI7eqKkXbvpv idfA== 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 u17si10476990itj.47.2019.05.07.08.16.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 May 2019 08:16:46 -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 1hO1oH-0007J6-La; Tue, 07 May 2019 15:15:13 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hO1oG-0007Iw-E6 for xen-devel@lists.xenproject.org; Tue, 07 May 2019 15:15:12 +0000 X-Inumbo-ID: e805881c-70da-11e9-9441-83a19205013c Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id e805881c-70da-11e9-9441-83a19205013c; Tue, 07 May 2019 15:15:11 +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 A3949374; Tue, 7 May 2019 08:15:10 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 00DE63F5AF; Tue, 7 May 2019 08:15:07 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 7 May 2019 16:14:44 +0100 Message-Id: <20190507151458.29350-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH 00/14] xen/arm: Properly disable M2P on Arm. 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 , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Tim Deegan , Gang Wei , oleksandr_tyshchenko@epam.com, Julien Grall , Tamas K Lengyel , Jan Beulich , Shane Wang , andrii_anisov@epam.com, Ian Jackson , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?b?w6k=?= MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi all, Arm never supported a M2P yet there are some helpers implemented to deal with the common code. However, the implementation of mfn_to_gmfn is completely bogus. This series aims to properly disable the M2P on Arm. See patch #8 for the rationale regarding the lack of M2P on Arm. While looking at the code, I also continued to convert some code to use typesafe MFN/GFN. Cheers, Julien Grall (14): xen/arm: Use mfn_to_pdx instead of pfn_to_pdx when possible xen/x86: Constify the parameter "d" in mfn_to_gfn xen/x86: Make mfn_to_gfn typesafe xen/x86: Use mfn_to_gfn rather than mfn_to_gmfn xen/grant-table: Make arch specific macros typesafe xen: Convert hotplug page function to use typesafe MFN xen: Convert is_xen_fixed_mfn to use typesafe MFN xen: Convert is_xen_heap_mfn to use typesafe MFN xen: Introduce HAS_M2P config and use to protect mfn_to_gmfn call xen: Remove mfn_to_gmfn macro xen/x86: mm: Re-implement set_gpfn_from_mfn() as a static inline function xen/x86: pv: Convert update_intpte() to use typesafe MFN xen/mm: Convert {s, g}et_gpfn_from_mfn() to use typesafe MFN xen/mm: Provide dummy M2P-related helpers when !CONFIG_HAVE_M2P xen/arch/arm/mm.c | 2 +- xen/arch/x86/Kconfig | 1 + xen/arch/x86/cpu/mcheck/mcaction.c | 20 ++++--- xen/arch/x86/domain.c | 34 ++++++----- xen/arch/x86/mm.c | 115 ++++++++++++++++++------------------ xen/arch/x86/mm/mem_sharing.c | 19 +++--- xen/arch/x86/mm/p2m-pod.c | 4 +- xen/arch/x86/mm/p2m-pt.c | 37 ++++++------ xen/arch/x86/mm/p2m.c | 70 +++++++++++----------- xen/arch/x86/mm/paging.c | 4 +- xen/arch/x86/mm/shadow/common.c | 31 ++++++---- xen/arch/x86/mm/shadow/multi.c | 6 +- xen/arch/x86/pv/dom0_build.c | 6 +- xen/arch/x86/pv/emul-priv-op.c | 4 +- xen/arch/x86/pv/grant_table.c | 6 +- xen/arch/x86/pv/mm.h | 6 +- xen/arch/x86/pv/ro-page-fault.c | 2 +- xen/arch/x86/tboot.c | 2 +- xen/arch/x86/x86_64/traps.c | 41 ++++++------- xen/common/Kconfig | 3 + xen/common/domctl.c | 2 +- xen/common/grant_table.c | 4 +- xen/common/memory.c | 6 +- xen/common/page_alloc.c | 28 ++++----- xen/common/sysctl.c | 14 ++--- xen/drivers/passthrough/iommu.c | 13 ++-- xen/drivers/passthrough/x86/iommu.c | 16 ++--- xen/include/asm-arm/domain.h | 5 ++ xen/include/asm-arm/grant_table.h | 12 ++-- xen/include/asm-arm/mm.h | 31 +++------- xen/include/asm-x86/grant_table.h | 19 +++--- xen/include/asm-x86/mm.h | 46 +++++++-------- xen/include/asm-x86/p2m.h | 6 +- xen/include/public/domctl.h | 4 ++ xen/include/xen/domain.h | 8 +++ xen/include/xen/mm.h | 20 ++++++- 36 files changed, 344 insertions(+), 303 deletions(-)