From patchwork Thu Oct 5 17:42:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 114961 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp848406qgn; Thu, 5 Oct 2017 10:44:50 -0700 (PDT) X-Received: by 10.36.211.201 with SMTP id n192mr25464554itg.65.1507225490270; Thu, 05 Oct 2017 10:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507225490; cv=none; d=google.com; s=arc-20160816; b=RufaIQZFcilCfcmvxF1qNwNXmH3Egm8lTqELBM6lutEfo0WCikBWZc/fJYpO0U7Z0F cYj2e4oNGudlJb1JqtPjW5+rDViAqK6FsPcpAnqn+izNjLyqPCgS27SCutfLLvFtWh1N rhbP61P+lLQyfNq7v9cfUGwN6eactrnRUf4Ixim/nyI/3CE22IDLcPeHU/XQg1q4vrLE TZad8G5DaL+Nl9r8RoGB6aHrOowq2PvTFbR+DAxVHeaUG0qW2aBzlB23RhJ3E8QjXxzP qBNWr3l2ieqezds/1t1+m/zBXGwjNcX7spf82v1h5Sf/LDFHlKjB3h9+TV8hsiJQOrLu 6Yyw== 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:dkim-signature :arc-authentication-results; bh=BPwWYVBP4q8cod/jVPlEJbSDGyFr2IsSvj112GUFOKI=; b=HxDWm83r5sVr7yvCCXYqiKL48NoVjP9UCIddqTyEet2YWzIpbNmsIrPa7iUKQffPWG /9/T7LyDoZqVU+Ks3T/fA3Ej96ZLuk9dcla8+n5TeDkDD63GwOR18WvSnSLBp1SlcTLA +1KMnA0/BHy+DxfJRG5ODfycUUXzE4kCVPsjR75k0ALt/dHOPTWd1woaqo+JR9ISAqHs jhv/xo/yriiN4CXKibRrFE5Ob8bofgj7VBeEXUcMhCgh6d6tfg2sJn5cYuKTeOK3z0+u P8hWM3I7Gm6Za8aPhkYE2cMvHqJN/tSlrxIb5BEHnw36Ex9FDRhWAUInq0nnTltul5pO aDeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=igex10VY; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i189si4419089ioe.401.2017.10.05.10.44.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 10:44:50 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=igex10VY; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.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 1e0AAM-0000xf-4g; Thu, 05 Oct 2017 17:42:34 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0AAK-0000xJ-Tn for xen-devel@lists.xen.org; Thu, 05 Oct 2017 17:42:33 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id 60/2F-02038-80F66D95; Thu, 05 Oct 2017 17:42:32 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRWlGSWpSXmKPExsVyMfTOel22/Gu RBs0/xS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1ozJB1oZC7p0K2Y9cWpg/CbfxcjJISQwiVHi 8X7RLkYuDhaBdmaJcw8uMYM4EgLvWCQOvutnAamSECiSaNj7hxnCTpO4/nwnO4RdIdH3/QVrF yMH0CQ1iTVvokB6hQT6mCT+fv3NCBJnE9CRWDejFqRcREBa4trny4wgNcwCj9kkpv1eygiSEB aIkPj8qZ0VxGYRUJVYuW0iWC+vgI3EvSvaEKvkJXa1XWSdwMi/gJFhFaN6cWpRWWqRrpleUlF mekZJbmJmjq6hgbFebmpxcWJ6ak5iUrFecn7uJkZg6NQzMDDuYLzS5nyIUZKDSUmU1yvrWqQQ X1J+SmVGYnFGfFFpTmrxIUYZDg4lCV7+PKCcYFFqempFWmYOMIhh0hIcPEoivPIgad7igsTc4 sx0iNQpRnuOC3cu/WHiOLbpMpA8sOcWkOy4efcPkxBLXn5eqpQ4rzFImwBIW0ZpHtxQWNRdYp SVEuZlZGBgEOIpSC3KzSxBlX/FKM7BqCTMezAXaApPZl4J3O5XQGcxAZ01p+kKyFkliQgpqQb G2tXN2or7tB71KGv+mxTrffAXd7jfwvuXVLhbuz1FZ/QUFHw/sNTnZF6Px8QVrhfLRGcUhFc1 30noy1FdUmJ2uumW1CmLD6/vyYZvnnTcsKYg1UEmNUq6zvm+352u4OmMQlyu/w0nNASayTjJX 2dZ+WFLjkKhHePRTxara2J4rl1klGjm2KrEUpyRaKjFXFScCAD4PBpDtQIAAA== X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-7.tower-31.messagelabs.com!1507225349!110564661!1 X-Originating-IP: [209.85.220.175] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57533 invoked from network); 5 Oct 2017 17:42:30 -0000 Received: from mail-qk0-f175.google.com (HELO mail-qk0-f175.google.com) (209.85.220.175) by server-7.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 5 Oct 2017 17:42:30 -0000 Received: by mail-qk0-f175.google.com with SMTP id f199so2335158qke.2 for ; Thu, 05 Oct 2017 10:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=5gMELUFUpjUU72yhLIGdHqpqSKaL4c+P+E80Iu9fqYA=; b=igex10VYWeRKyheXESid2nI8IjNWdWfxLAdTa4HaUCsMGR/yW6piFQroCknJRT23yd 56FgBMF7fF9X3mlwBIhi6pD1/Iwv13roLlKIxR3+zdS+C+14ZbKMDRgEhuua6Pov3hnG IJ/V2XM+f7zx81GYe7LzxSXlTr9nQpc5D0ixk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5gMELUFUpjUU72yhLIGdHqpqSKaL4c+P+E80Iu9fqYA=; b=IMoOA9dFgtJA+jhFwMA0IqjUnMKifDX3vl4aAHtsnAYd1MFMwA2dyc2ip54xfWACMK +Vx5EEfQ0RJQNk3ehfyd5l5Pf7ue02zVhJmuJs1VL5q1r/3kppsCIbsXoQ+1eaCy842z iZOzk9PfamjJeJJCT/vi7KhPzmOmuf9kqII1Na+pB+OwUjRJrDQIIQQCkXPaygKu0xO3 1ritg/OJz36PGqRvTNJKvc58gGbV21ts5dENDS6Ukeduyf8ZRjHAeA/OAR7I/tTsLa3q qlfnz8wT6MMmv95OmKv8qJJqvD17YD+1rwNBN7Tgu814cBq4CFruHwsBlgTS0WHlnoZ7 Q4Wg== X-Gm-Message-State: AMCzsaUom8l9F3TGEq0awcspMWEKx456qj4hM385ZiMieTwF3YUr55Hm m+MtB3g4xwbT7GazWBmI/gAdl7PH0oRPKg== X-Google-Smtp-Source: AOwi7QCO8HyLjf1qfRtYANUA+oEfF9YREpBj3sUK5EOpZw60f3hmHRXNi66Ews7R85j/HcN8rMziQw== X-Received: by 10.55.141.1 with SMTP id p1mr25274627qkd.358.1507225349008; Thu, 05 Oct 2017 10:42:29 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id y63sm11815084qky.75.2017.10.05.10.42.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 10:42:28 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 5 Oct 2017 18:42:13 +0100 Message-Id: <20171005174222.29161-1-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 Cc: Elena Ufimtseva , Kevin Tian , Stefano Stabellini , Wei Liu , Jun Nakajima , Razvan Cojocaru , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Julien Grall , Ian Jackson , Tim Deegan , Julien Grall , Paul Durrant , Tamas K Lengyel , Jan Beulich , Shane Wang , Suravee Suthikulpanit , Boris Ostrovsky , Gang Wei Subject: [Xen-devel] [PATCH v2 0/9] xen: Convert __page_to_mfn and __mfn_to_page to use typesafe MFN X-BeenThere: xen-devel@lists.xen.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.xen.org Sender: "Xen-devel" Hi all, Most of the users of page_to_mfn and mfn_to_page are either overriding the macros to make them work with mfn_t or use mfn_x/_mfn becaue the rest of the function use mfn_t. So I think it is time to make __page_to_mfn and __mfn_to_page using typesafe MFN. The first 8 patches will convert of the code to use typesafe MFN, easing the tree-wide conversion in patch 8. Note that this was only build tested it on x86. Cheers, Cc: Andrew Cooper Cc: Boris Ostrovsky Cc: Elena Ufimtseva Cc: Gang Wei Cc: George Dunlap Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Jun Nakajima Cc: Kevin Tian Cc: Konrad Rzeszutek Wilk Cc: Paul Durrant Cc: Razvan Cojocaru Cc: Shane Wang Cc: Stefano Stabellini Cc: Suravee Suthikulpanit Cc: Tamas K Lengyel Cc: Tim Deegan Cc: Wei Liu Julien Grall (9): xen/arm: domain_build: Clean-up insert_11_bank xen/arm32: mm: Rework is_xen_heap_page to avoid nameclash xen/x86: mem_sharing: Use copy_domain_page in __mem_sharing_unshare_page xen/x86: Use maddr_to_page and maddr_to_mfn to avoid open-coded >> PAGE_SHIFT xen/kimage: Remove defined but unused variables xen/kexec,kimage: Convert kexec and kimage to use typesafe mfn_t xen/xenoprof: Convert the file to use typesafe MFN xen/tmem: Convert the file common/tmem_xen.c to use typesafe MFN xen: Convert __page_to_mfn and __mfn_to_page to use typesafe MFN xen/arch/arm/domain_build.c | 15 ++++++++------- xen/arch/arm/kernel.c | 2 +- xen/arch/arm/mem_access.c | 2 +- xen/arch/arm/mm.c | 8 ++++---- xen/arch/arm/p2m.c | 8 +------- xen/arch/x86/cpu/vpmu.c | 4 ++-- xen/arch/x86/debug.c | 2 +- xen/arch/x86/domain.c | 21 +++++++++++---------- xen/arch/x86/domain_page.c | 6 +++--- xen/arch/x86/domctl.c | 2 +- xen/arch/x86/hvm/dm.c | 2 +- xen/arch/x86/hvm/dom0_build.c | 6 +++--- xen/arch/x86/hvm/hvm.c | 14 +++++++------- xen/arch/x86/hvm/ioreq.c | 6 +++--- 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 | 6 ------ 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/mem_sharing.c | 12 +----------- xen/arch/x86/mm/p2m-ept.c | 4 ++++ xen/arch/x86/mm/p2m-pod.c | 6 ------ xen/arch/x86/mm/p2m.c | 6 ------ xen/arch/x86/mm/paging.c | 6 ------ xen/arch/x86/mm/shadow/common.c | 2 +- xen/arch/x86/mm/shadow/multi.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 | 10 ---------- xen/arch/x86/pv/dom0_build.c | 6 ++++++ 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 | 6 ------ xen/arch/x86/pv/mm.c | 2 +- xen/arch/x86/pv/ro-page-fault.c | 6 ------ xen/arch/x86/smpboot.c | 6 ------ xen/arch/x86/tboot.c | 4 ++-- xen/arch/x86/traps.c | 2 +- xen/arch/x86/x86_64/mm.c | 6 ++++++ xen/common/domain.c | 4 ++-- xen/common/grant_table.c | 6 ++++++ xen/common/kexec.c | 16 ++++++++-------- xen/common/kimage.c | 33 +++++++++++++++------------------ xen/common/memory.c | 6 ++++++ xen/common/page_alloc.c | 6 ++++++ xen/common/tmem.c | 2 +- xen/common/tmem_xen.c | 26 ++++++++++++++------------ xen/common/trace.c | 6 ++++++ xen/common/vmap.c | 9 +++++---- xen/common/xenoprof.c | 19 +++++++++++++------ xen/drivers/passthrough/amd/iommu_map.c | 6 ++++++ xen/drivers/passthrough/iommu.c | 2 +- xen/drivers/passthrough/x86/iommu.c | 2 +- xen/include/asm-arm/mm.h | 22 ++++++++++++---------- xen/include/asm-arm/p2m.h | 4 ++-- xen/include/asm-x86/mm.h | 12 ++++++------ xen/include/asm-x86/p2m.h | 2 +- xen/include/asm-x86/page.h | 32 ++++++++++++++++---------------- xen/include/xen/domain_page.h | 8 ++++---- xen/include/xen/kimage.h | 4 ++-- xen/include/xen/tmem_xen.h | 2 +- 70 files changed, 230 insertions(+), 287 deletions(-)