Message ID | 20180314182009.14274-1-julien.grall@arm.com |
---|---|
Headers | show
Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp157356ljb; Wed, 14 Mar 2018 11:22:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELtm86oyUgAsNqHZrGSzGa4+Mqc4vP0PkOkLgkCeqQ6Xm8GidxYc9Gmb/fKaGH1v8eFB0uDJ X-Received: by 10.107.80.5 with SMTP id e5mr5566041iob.136.1521051767338; Wed, 14 Mar 2018 11:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521051766; cv=none; d=google.com; s=arc-20160816; b=U+DoxIU5HIYTsyA0qsODrgPT2IG4hNyTOLpAx593RGn15o6wLQJ5pHKdMD1pIwNyXJ cEWpbY5PGwS13/Dz5xVsjqcS1B1imIcZE5MEFIBizxS8QK075O6BwOtDHHV4Exz4sRd5 0SQKFa6hwxKFZXbmOpz5xOA7RAx4dOBhE3kgHpTiHzicjsSvBXvq8coWMXt71Z6PeTVC KmGrieAUDBOJcRPwj0bSH2BWB77WnSqBayp7VLXiBb+K5j6mLIyVrkmt5pwY4gTnm1FK uRgXG3kFny3JKCo1/D5pSD7XZD0B+GHgnc1wm06kQpioPso14FvWDg0tk3bosdcEsnh/ rovA== 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:message-id:date:to:from :arc-authentication-results; bh=dijQW3r0dfSiGClOxvisNALhO3mI1/YASzK6sd3FW1E=; b=bLyZp6zmm7DN80JI3//1zkCq8lLroNoejL4m4mFEfgxDGVFq8CHsa7Bz8+1mOAWiA+ B0jhrYSlGlG5hUuPQfbbKZdCc8fYsWroySpY7Jp3PHhpCIpDaCSjCQjQFBqJVSPJYKIR db+6jOG1GzyQGLBg7IG5QwKiWritYulijTW5aRUw1hBFMGYjTOpEf8KM7qmEU/UjgaoC rqZ5mQN6UAHsP+XvbiFTLDSBQ4Y/CDC0jaXpuSgbx1gRNfhTKSjVO7SqR8BKPbGImUio MMuLiDshYALX4JGtZ4uRhQzhOOG/DcLhDZtUllexcOKl9HTUTFJHNcxvAAvmYI1JCS50 ZokA== 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: <xen-devel-bounces@lists.xenproject.org> Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f71-v6si1192157ita.168.2018.03.14.11.22.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 11:22: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.84_2) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1ewB0f-0006kl-Qm; Wed, 14 Mar 2018 18:20:21 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from <srs0=ty01=ge=arm.com=julien.grall@srs-us1.protection.inumbo.net>) id 1ewB0e-0006kQ-DD for xen-devel@lists.xen.org; Wed, 14 Mar 2018 18:20:20 +0000 X-Inumbo-ID: 57166a58-27b4-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 57166a58-27b4-11e8-9728-bc764e045a96; Wed, 14 Mar 2018 19:20:14 +0100 (CET) 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 C12CD80D; Wed, 14 Mar 2018 11:20:17 -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 86B133F53D; Wed, 14 Mar 2018 11:20:14 -0700 (PDT) From: julien.grall@arm.com To: xen-devel@lists.xen.org Date: Wed, 14 Mar 2018 18:19:53 +0000 Message-Id: <20180314182009.14274-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Cc: Kevin Tian <kevin.tian@intel.com>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wei.liu2@citrix.com>, Jun Nakajima <jun.nakajima@intel.com>, Razvan Cojocaru <rcojocaru@bitdefender.com>, George Dunlap <George.Dunlap@eu.citrix.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>, Julien Grall <julien.grall@arm.com>, Paul Durrant <paul.durrant@citrix.com>, Tamas K Lengyel <tamas@tklengyel.com>, Jan Beulich <jbeulich@suse.com>, Shane Wang <shane.wang@intel.com>, Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Gang Wei <gang.wei@intel.com> Subject: [Xen-devel] [PATCH v5 00/16] xen: Convert page_to_mfn and mfn_to_page to use typesafe MFN X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xenproject.org> List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xenproject.org> List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help> List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org> |
Series |
xen: Convert page_to_mfn and mfn_to_page to use typesafe MFN
|
expand
|
From: Julien Grall <julien.grall@arm.com> Hi all, This is v5 of the series for all the changes see in each patch. To avoid the last patch (#16) to be a huge patch some files are converted to use typesafe upfront. I have tried my best to push _mfn/mfn_x as down as possible in the callers. Some of them was not feasible without major rework, so I left them aside for now. Contribution to switch Xen code base to MFN typesafe are more than welcomed. Note that changes have only been build test it on x86 so far. Cheers, Cc: Andrew Cooper <andrew.cooper3@citrix.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Gang Wei <gang.wei@intel.com> Cc: George Dunlap <george.dunlap@eu.citrix.com> Cc: George Dunlap <George.Dunlap@eu.citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Jan Beulich <jbeulich@suse.com> Cc: Julien Grall <julien.grall@arm.com> Cc: Jun Nakajima <jun.nakajima@intel.com> Cc: Kevin Tian <kevin.tian@intel.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Paul Durrant <paul.durrant@citrix.com> Cc: Razvan Cojocaru <rcojocaru@bitdefender.com> Cc: Shane Wang <shane.wang@intel.com> Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Cc: Tamas K Lengyel <tamas@tklengyel.com> Cc: Tim Deegan <tim@xen.org> Cc: Wei Liu <wei.liu2@citrix.com> Julien Grall (15): xen/arm: setup: use maddr_to_mfn rather than _mfn(paddr_to_pfn(...)) xen/arm: mm: Use gaddr_to_gfn rather than _gfn(paddr_to_pfn(...)) xen/arm: mm: Remove unused M2P code xen/arm: mm: Remove unused relinquish_shared_pages xen/x86: Remove unused override of page_to_mfn/mfn_to_page xen/x86: mm: Switch x86/mm.c to use typesafe for virt_to_mfn xen/mm: Drop the parameter mfn from populate_pt_range xen/pdx: Introduce helper to convert MFN <-> PDX xen/mm: Switch map_pages_to_xen to use MFN typesafe xen/mm: Switch some of page_alloc.c to typesafe MFN xen/mm: Switch common/memory.c to use typesafe MFN xen/grant: Switch {create, replace}_grant_p2m_mapping to typesafe MFN xen/grant: Switch common/grant_table.c to use typesafe MFN xen/x86: Switch mfn_to_page in x86_64/mm.c to use typesafe MFN xen: Convert page_to_mfn and mfn_to_page to use typesafe MFN Wei Liu (1): x86/mm: skip incrementing mfn if it is not a valid mfn xen/arch/arm/domain_build.c | 2 - xen/arch/arm/kernel.c | 2 +- xen/arch/arm/mem_access.c | 2 +- xen/arch/arm/mm.c | 33 ++++---- xen/arch/arm/p2m.c | 10 +-- xen/arch/arm/setup.c | 4 +- xen/arch/x86/cpu/vpmu.c | 4 +- xen/arch/x86/domain.c | 21 ++--- xen/arch/x86/domain_page.c | 6 +- xen/arch/x86/hvm/dm.c | 2 +- xen/arch/x86/hvm/dom0_build.c | 6 +- xen/arch/x86/hvm/emulate.c | 6 +- xen/arch/x86/hvm/grant_table.c | 14 ++-- xen/arch/x86/hvm/hvm.c | 12 +-- xen/arch/x86/hvm/ioreq.c | 4 +- xen/arch/x86/hvm/stdvga.c | 2 +- xen/arch/x86/hvm/svm/svm.c | 4 +- xen/arch/x86/hvm/viridian.c | 6 +- xen/arch/x86/hvm/vmx/vmcs.c | 2 +- xen/arch/x86/hvm/vmx/vmx.c | 10 +-- xen/arch/x86/hvm/vmx/vvmx.c | 6 +- xen/arch/x86/mm.c | 75 +++++++++--------- xen/arch/x86/mm/guest_walk.c | 6 +- xen/arch/x86/mm/hap/guest_walk.c | 2 +- xen/arch/x86/mm/hap/hap.c | 6 -- xen/arch/x86/mm/hap/nested_ept.c | 2 +- xen/arch/x86/mm/hap/nested_hap.c | 3 - xen/arch/x86/mm/mem_sharing.c | 5 -- xen/arch/x86/mm/p2m-ept.c | 8 +- xen/arch/x86/mm/p2m-pod.c | 6 -- xen/arch/x86/mm/p2m-pt.c | 6 -- xen/arch/x86/mm/p2m.c | 6 -- xen/arch/x86/mm/paging.c | 6 -- xen/arch/x86/mm/shadow/private.h | 16 +--- xen/arch/x86/numa.c | 2 +- xen/arch/x86/physdev.c | 2 +- xen/arch/x86/pv/callback.c | 6 -- xen/arch/x86/pv/descriptor-tables.c | 6 -- xen/arch/x86/pv/dom0_build.c | 14 ++-- xen/arch/x86/pv/domain.c | 6 -- xen/arch/x86/pv/emul-gate-op.c | 6 -- xen/arch/x86/pv/emul-priv-op.c | 10 --- xen/arch/x86/pv/grant_table.c | 16 ++-- xen/arch/x86/pv/iret.c | 6 -- xen/arch/x86/pv/mm.c | 6 -- xen/arch/x86/pv/ro-page-fault.c | 6 -- xen/arch/x86/pv/shim.c | 4 +- xen/arch/x86/pv/traps.c | 6 -- xen/arch/x86/setup.c | 20 ++--- xen/arch/x86/smpboot.c | 8 +- xen/arch/x86/tboot.c | 15 ++-- xen/arch/x86/traps.c | 4 +- xen/arch/x86/x86_64/mm.c | 67 ++++++++-------- xen/arch/x86/x86_64/mmconfig_64.c | 6 +- xen/common/domain.c | 4 +- xen/common/efi/boot.c | 2 +- xen/common/grant_table.c | 133 +++++++++++++++++--------------- xen/common/kimage.c | 6 -- xen/common/memory.c | 69 ++++++++++------- xen/common/page_alloc.c | 58 +++++++------- xen/common/tmem.c | 2 +- xen/common/tmem_xen.c | 4 - xen/common/trace.c | 4 +- xen/common/vmap.c | 10 +-- xen/common/xenoprof.c | 2 - xen/drivers/acpi/apei/erst.c | 2 +- xen/drivers/acpi/apei/hest.c | 2 +- xen/drivers/passthrough/amd/iommu_map.c | 12 +-- xen/drivers/passthrough/iommu.c | 2 +- xen/drivers/passthrough/vtd/dmar.c | 2 +- xen/drivers/passthrough/x86/iommu.c | 2 +- xen/include/asm-arm/grant_table.h | 11 ++- xen/include/asm-arm/mm.h | 45 +++-------- xen/include/asm-arm/numa.h | 8 +- xen/include/asm-arm/p2m.h | 4 +- xen/include/asm-x86/grant_table.h | 6 +- xen/include/asm-x86/hvm/grant_table.h | 8 +- xen/include/asm-x86/mm.h | 6 +- xen/include/asm-x86/p2m.h | 2 +- xen/include/asm-x86/page.h | 32 ++++---- xen/include/asm-x86/pv/grant_table.h | 8 +- xen/include/xen/domain_page.h | 8 +- xen/include/xen/mm.h | 10 +-- xen/include/xen/pdx.h | 3 + xen/include/xen/tmem_xen.h | 2 +- 85 files changed, 424 insertions(+), 566 deletions(-)