From patchwork Mon Jun 3 16:03:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 165661 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4660377ili; Mon, 3 Jun 2019 09:05:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFEIBR0CTvd4xcJd3M8drfcFAE6kvXaw3TN4q71bmvx+5MMoiOIGhvXI10+DQOWzaIKYoW X-Received: by 2002:a24:7fc7:: with SMTP id r190mr5200119itc.178.1559577926645; Mon, 03 Jun 2019 09:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577926; cv=none; d=google.com; s=arc-20160816; b=Z1T5XEinxbgE1AinUfcvTqQ+kT8TK0NPnfqCUbGdiPIOR5+jA/RsNVwyr02MO0vfQh 4y8he02cjDgFo1Oyop9bqn7j0/6+kV/HSNnf0Pz4QtkfMCyMdhiWjzr4t5G3l2wOKoAQ Co2Uk/l6aqIAACQZlF9f0SIPoRdfcanqndeEo1VQecR+hVGODemccHpf16ezkhe6ULeP j7FhfcorqCbOdgATlTrIvadpRiUG6Ti3YZvWebe+k5+gEP0t8YqMVWR5fTTyYo9/QvYv imkOzwMXPIxH2hLrrjZbGpWl0xTbrKNSqQBuKvLO1ecxsb2E5Zs8wj0TPlSS5kAEHLKx 8uBw== 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=hvddpkCKTY12ZDEKC5ITjeBCbawyX50iic/ZYmMismc=; b=J3RqgXqJN7Kcfa03BWXJGcgltw47nbmg9eUPcNRW3uLPj7n9bOGhkxW4SxCw9LbXO8 rh3jkgpERe8bXqRxbCBD8bd/At09TZKYEmccsCQF0Kl42zjzHpjgvX+8y/ZckZDQJ/c9 YmCdsBv7HcYVjKEOKUWqXQO9YiLTbmGCulvH1jKq7/sGVgSF5v6T5qh1GQHopBfvc/1q HNkxp+3Aaun8DYQZ683MD9rYqt8OBMuThcKNUnGpkYtd8UO3cIClKk1xRfqd8hrHBTs1 C7wg3BE35p9dFoZW7ATQ8wIC0Q/8nGSJN147xUHB7dByj0DWIo3UQ4pcF9WjobXRsL1X hTgg== 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 f12si9465244jaa.76.2019.06.03.09.05.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jun 2019 09:05:26 -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 1hXpRK-0001tC-A0; Mon, 03 Jun 2019 16:04:02 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hXpRJ-0001t6-58 for xen-devel@lists.xenproject.org; Mon, 03 Jun 2019 16:04:01 +0000 X-Inumbo-ID: 3252640b-8619-11e9-8980-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 3252640b-8619-11e9-8980-bc764e045a96; Mon, 03 Jun 2019 16:03:58 +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 A050180D; Mon, 3 Jun 2019 09:03:58 -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 F03C93F246; Mon, 3 Jun 2019 09:03:55 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 3 Jun 2019 17:03:36 +0100 Message-Id: <20190603160350.29806-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH v3 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 , andrii_anisov@epam.com, 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 , Ian Jackson , =?utf-8?q?Roger_Pau_Monn=C3=A9?= 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/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/x86: p2m: Remove duplicate error message in p2m_pt_audit_p2m() xen/x86: p2m: Rework printk format in audit_p2m() 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/x86/Kconfig | 1 + xen/arch/x86/cpu/mcheck/mcaction.c | 20 +++---- xen/arch/x86/domain.c | 34 ++++++------ xen/arch/x86/mm.c | 102 ++++++++++++++++++------------------ xen/arch/x86/mm/mem_sharing.c | 19 +++---- xen/arch/x86/mm/p2m-pod.c | 4 +- xen/arch/x86/mm/p2m-pt.c | 35 ++++++------- xen/arch/x86/mm/p2m.c | 71 +++++++++++++------------ 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 | 7 ++- 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 | 9 +++- xen/common/grant_table.c | 4 +- xen/common/memory.c | 4 ++ xen/common/page_alloc.c | 28 +++++----- xen/common/sysctl.c | 14 ++--- xen/drivers/passthrough/iommu.c | 15 ++++-- 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 | 25 +++------ 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 | 6 +++ xen/include/xen/domain.h | 12 +++++ xen/include/xen/mm.h | 20 +++++-- 35 files changed, 344 insertions(+), 295 deletions(-)