From patchwork Wed Nov 1 14:03:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 117699 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp928129qgn; Wed, 1 Nov 2017 07:05:46 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SeQCIAxb/GfE1g5aOmd+Hu6IDT8eA/nlJaDMZokChgE7BydCfpPlGENKQLJZHecZA9BAX0 X-Received: by 10.36.0.77 with SMTP id 74mr593858ita.67.1509545146254; Wed, 01 Nov 2017 07:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509545146; cv=none; d=google.com; s=arc-20160816; b=jBnqGgXjSs/YtEpzLnUTPe2cM09Nctb/FyS76hmP+9bvhlcXs4EkCgNZE0QidnLvXq 0RS7JTKnZ+cMH2xuJu8FLW6YmlvzcXxvvCgZ1nn32nZMMWqdTeCJyo+doiIcecvfDhMU sMvdJxxnECL/2v9523gCeju52xzbUvtkfN0fj3rurHmvzWzVG9T3LQ6VCKGLAioC6RQy 0bjPoluKgvGD5pFVlzwDLxFlH8BX9vP5NsV0AF7NiUyz0n05euwQLJuw9/+VccRMfbf9 8oP2SUH7m/aWleT2hC74IWJSB09f5qol9N0RwjcAa1jTSjtNyS90o5e7CulSPCdaVMPT X59w== 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=KCC0zaO92Au7iOLjsYjulGMSmelyJApU76tlQcSgXjc=; b=bIotXl+vltUDLs5o/Te7nHB1WRu5El4DMATRQ63SxtbHWzQ0e27pmtH9YecHqgJAcJ 04HpxE4nFT667fYujltjv7QrIMQfTYdCpKxQq5QMoqe3lsFnkDm+FkvfCozeqMp5vRJs 7pxlZPuDMDuoFQr8lAPRSyjJYbx3BKJnAbWxQQf0jvUWbX8Jw09BCQyj50C3FqMz2Kj7 JPR9Fo6wBrysK0lHPoAgMW6TtJn14+nTKrEr85MMMSL4F+r4tYwUnZWghG+LEjOzuNg0 haQfC6Sxufr0q9DwEcQ03iqPmRtNIENj1CLORggcNZFSMRtlrNH33Hfx6CSETiE19xSr zp5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WKM9Idhk; 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 o9si694217iod.214.2017.11.01.07.05.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Nov 2017 07:05:46 -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=WKM9Idhk; 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 1e9tc4-0007sc-1J; Wed, 01 Nov 2017 14:03:24 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9tc2-0007sV-IV for xen-devel@lists.xen.org; Wed, 01 Nov 2017 14:03:22 +0000 Received: from [85.158.143.35] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-4.bemta-6.messagelabs.com id A8/E7-30895-924D9F95; Wed, 01 Nov 2017 14:03:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRWlGSWpSXmKPExsVyMbThkK7mlZ+ RBjP72S2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oznnbdYCm6pV5zs/sLSwPhGuouRi0NIYBKj xLSp7YwgDotAO7NE484lzCCOhMA7FoktN7pZuxg5gZw8iR9N/4BsDiA7TaK7LxvCrJTY/DMLx BQSUJNY8yYKYmY3k8T5Ga/BqtkEdCTWzagFGSIiIC1x7fNlsFXMAlvYJH59uMIIkhAWSJB4OO MB2CYWAVWJJWtWM4PYvAI2Ej+vLWOBuEBeYlfbRdYJjPwLGBlWMWoUpxaVpRbpGprrJRVlpme U5CZm5ugaGpjp5aYWFyemp+YkJhXrJefnbmIEhg8DEOxgvL0x4BCjJAeTkijvTsfvkUJ8Sfkp lRmJxRnxRaU5qcWHGGU4OJQkeBsu/4wUEixKTU+tSMvMAQYyTFqCg0dJhFcBJM1bXJCYW5yZD pE6xejKceHOpT9MHMc2XQaSB/bcApIdN+8CyWczXzcwC7Hk5eelSonzeoI0C4A0Z5TmwY2GRe ElRlkpYV5GoGOFeApSi3IzS1DlXzGKczAqCfNWgUzhycwrgbvgFdBxTEDHeUn8ADmuJBEhJdX AWL/99aOTM2aovI+OYp10p2Sq/D31nbvNTwldupYl2nv9bFpM6b/TjZlXtff85F3OpDXtdsj6 A8Z+u3ao/vMVmXz/uena/6JRi+WdF3bsmtocq9gqc1LVgnPr2uxcp//fGEV8p4nU7jilZK7S3 /Jz7eXrXlxGztN69vkq2hvNXmw/+0RznwP3fCWW4oxEQy3mouJEAOJsLaO9AgAA X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-9.tower-21.messagelabs.com!1509545000!79810208!1 X-Originating-IP: [209.85.128.194] 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 56951 invoked from network); 1 Nov 2017 14:03:21 -0000 Received: from mail-wr0-f194.google.com (HELO mail-wr0-f194.google.com) (209.85.128.194) by server-9.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 1 Nov 2017 14:03:21 -0000 Received: by mail-wr0-f194.google.com with SMTP id w105so2044073wrc.0 for ; Wed, 01 Nov 2017 07:03:21 -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=ZT44bSVYDlwuJa1Vn6Sg9NcCGYlQtBTg3x9qhE4cug0=; b=WKM9Idhk2VZzWszwcmewyWeAlu0vUKxSptFci+Pefu7blOkcXiGCvkSevUeVa8R03h /ePi6vcAMS5hCIoz4hCNP3Z0Rsg6qlW2nXNxqOBSZucmTycEy2482V92k6aLX+LeOh6y BAA1RTVS9ijVCcq92xcQmLo9Az9boPbeTvVIs= 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=ZT44bSVYDlwuJa1Vn6Sg9NcCGYlQtBTg3x9qhE4cug0=; b=pyToLzwyj5CLwgzyHwo9D3LFuhXbI+UVnQ+EF3LV0mwj4ZL8T8LB1jaAEbMzUgsJs8 Zo1A83ku3IKl8FhzP3AvtbRcv+y0aNXJgpF7pMsWe+8GE1Fqe+MJsEdL1m816q46146X bGBoV5zlP2SrbPLCVgrcyDvXOf/sejem3d1RsZjaPFHNaWOW4NJtrLyK1jPkDCz++zdj kmkX2+j48SN3B5S/Yu6eaFRsMuMpy3LoWCf/mByRiFKbHvjRduxdv3KofoF4L0xpw51x pYkJQY/kNYTConWMgBku0uNW7lCZ4gHkM4WcyDZkzuWd6ERwcFzX53n8Uk+RRClLCX1Q SknA== X-Gm-Message-State: AMCzsaXCxN2/7LhpNS/aDbhDLgu4stkyGTm+mlR71/cYWtjMyqpimJ2i 7DF8YhVD9vo6qE9gcYv0xpNQSjB6T5U= X-Received: by 10.223.198.130 with SMTP id j2mr5241496wrg.52.1509545000244; Wed, 01 Nov 2017 07:03:20 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id w4sm595582wrc.17.2017.11.01.07.03.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Nov 2017 07:03:19 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 1 Nov 2017 14:03:12 +0000 Message-Id: <20171101140316.31333-1-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 Cc: 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 v3 for-next 0/4] 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 3 patches will convert of the code to use typesafe MFN, easing the tree-wide conversion in patch 4. Note that this was only build tested it on x86. Cheers, Cc: Andrew Cooper Cc: Boris Ostrovsky 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 (4): xen/arm: domain_build: Clean-up insert_11_bank xen/arm32: mm: Rework is_xen_heap_page to avoid nameclash 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 | 10 ++-------- xen/arch/x86/cpu/vpmu.c | 4 ++-- 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/emulate.c | 6 +++--- xen/arch/x86/hvm/hvm.c | 16 ++++++++-------- 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 | 5 ----- 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/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/ro-page-fault.c | 6 ------ xen/arch/x86/smpboot.c | 6 ------ xen/arch/x86/tboot.c | 4 ++-- xen/arch/x86/traps.c | 4 ++-- xen/arch/x86/x86_64/mm.c | 6 ++++++ xen/common/domain.c | 4 ++-- xen/common/grant_table.c | 6 ++++++ xen/common/kimage.c | 6 ------ 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 | 2 -- 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/tmem_xen.h | 2 +- 65 files changed, 191 insertions(+), 255 deletions(-)