From patchwork Mon Jul 17 21:10:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9846281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E334560392 for ; Mon, 17 Jul 2017 21:26:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 248B626E4A for ; Mon, 17 Jul 2017 21:26:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 188AB274D0; Mon, 17 Jul 2017 21:26:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28E3E26E4A for ; Mon, 17 Jul 2017 21:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751639AbdGQVLP (ORCPT ); Mon, 17 Jul 2017 17:11:15 -0400 Received: from mail-bn3nam01on0071.outbound.protection.outlook.com ([104.47.33.71]:3344 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751595AbdGQVLC (ORCPT ); Mon, 17 Jul 2017 17:11:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0M2F19QvTWPdgwlDc4b8L4hHYKaXdclN51wM4D+56ec=; b=0tEZae4GAdxi22995DiR/yOxie/SZIVYovELyFXEIf9V8cRDiuQtd+4yp4qCXXmURYR9enIPpvsHoOmIqu5J24qlKJ+ddVMVWc1WQ0gGneQgfY/O6AfHSny17hxhXnGOqb6hk5Yhm4cNgyIgUoXrZ9evjna+DPWrBHr3mSvc5bQ= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by MWHPR12MB1151.namprd12.prod.outlook.com (10.169.204.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Mon, 17 Jul 2017 21:10:55 +0000 From: Tom Lendacky To: x86@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kasan-dev@googlegroups.com Cc: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Konrad Rzeszutek Wilk , Andrey Ryabinin , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , Paolo Bonzini , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov , Rik van Riel , Larry Woodman , Dave Young , Toshimitsu Kani , "Michael S. Tsirkin" , Brijesh Singh Subject: [PATCH v10 03/38] x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap for RAM mappings Date: Mon, 17 Jul 2017 16:10:00 -0500 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR03CA0008.namprd03.prod.outlook.com (10.168.230.146) To MWHPR12MB1151.namprd12.prod.outlook.com (10.169.204.15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5dc35f35-d895-4d0a-1ded-08d4cd585236 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR12MB1151; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 3:OEXKOSn6q422Xhf7Yg5gcceaFpA/XmF32J8wcRuJQxs6ceJNaOnngLj9c5IYfA1McuDI+EQZjcSbq4pCqZGthWulZEA1kU9Q24VG8/DQkY1Q+R/kzRz+un9O7nPxNm+I2pIuNohfVXhpEsPEfcgupkDKX7/YSMZRDfxPDfVhO+EjHo8UWkpS/COCw2DRq8cJivVfuFWxfi6Exopfi57R869rm1vbwfjos40RvPkffrLDWoee9ISBfQyIph7+xce0iFy7/47PTAHIiOad0ZLa5m/yER6NDLngZLRk3mZKghSbeUufruSOhoOIeSGkn4n8v2dAHM7oT+b/kurvUKLypvNChQtlAp+pvfGKISYIJL0qu+wm1mPdaTLZpnht8t/4gGlrisvu8UDdWuC++MexMxTzyrYK40+eQ0J8oUaSiUeegu1vah9TV5U5lD5ILCtMNp3mr7Do0MzxCTAuDMd5H1JgPWwCMy7Xf1mr+7sHR1uis7jdr+1UFQGYWJnbuG/LmS0ITt7wM18VNDCKRS+NBX1Q/yDOvEygDcp4Abggrwnxg510mIxi4W8QlD/IP5zg1wv/orqB/65yr+ChaYxXLSZZd7ZRYuy5FUTGt9KhBuIksUdxiZ4tHxMOuAkMyGYtOhrwoAcXoBr1FZDqNldqYG2X5uWsRv8MxWmLfCU7E1G8KhXw8UA7sUH7z9RhURmC2cXH1+U3peZTOE3j1npnHAiUw67XM9LMp9phUfnVSWUi/ilrBMokUyqX+hZ2berMt0GGQlhgUgzDls0TgHW+zA== X-MS-TrafficTypeDiagnostic: MWHPR12MB1151: X-Microsoft-Exchange-Diagnostics: 1; MWH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lk6+RG+P/ZLsMguOB6G+b5r+qXPvrZaIi4My0jamvXJ+ X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110)(48057245064654); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1151; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1151; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 4:/MPTQPlJNq7hA/6ZxQ1y174ZfK5U2NHLlRNvp0LEZg?= =?us-ascii?Q?pAbbkeH8at4UahguX8JvG4G0TiuT3CPOTrMuPBJlf6iEQbdZHfoZ4FDLMjal?= =?us-ascii?Q?Op1HICU8GfVh6Pp/PksuO2TmFrL7Ir2/7DJvVNUWmnujW0bTJEEwXBGepeuS?= =?us-ascii?Q?LYgsH5KskMHimk7Pc4jWxhrID1MQOK6eim67YITr2QdmhPyoHzH17oDWvFc4?= =?us-ascii?Q?xGkdgXaEfflVrHf9Rygmy5eoICHtliBgZAvCxWh9mz6KA9c9tvC92Pq8o0hs?= =?us-ascii?Q?WEi9nXZTNYmXKQIpsmkE5eX7wbc+v9k7Amol7GM20od9qO4RwMjVqtT8G8KV?= =?us-ascii?Q?I5wmxM9gmYGRiVmZxuRVK7amzfJv7rf1c0rEwx2KjFFmzzpB+SYTFn1Mtxsc?= =?us-ascii?Q?d5AcrRtmQNYksPun6i5oeqdYpO791jj1BRTZ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?Q?13UxV8biXQdXJLXONkmzw=3D?= X-Forefront-PRVS: 0371762FE7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39410400002)(39850400002)(39840400002)(39860400002)(39400400002)(39450400003)(25786009)(6506006)(33646002)(54906002)(7416002)(76176999)(478600001)(8676002)(50986999)(6486002)(47776003)(5660300001)(189998001)(42186005)(38730400002)(305945005)(72206003)(53416004)(66066001)(50466002)(48376002)(110136004)(118296001)(2950100002)(81166006)(5003940100001)(3846002)(6666003)(36756003)(53936002)(7350300001)(6512007)(2906002)(7736002)(6116002)(86362001)(4326008)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1151; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 23:HaOJ5ha4fwhA/gny7DrBlPeIaqUmiQ0PZ4o0/4wq1?= =?us-ascii?Q?pM28JM5jZZxdTQg+nL15hJiXmju8sKaKV4E6WDhMBBPYwSnlNkraHCu4wMuy?= =?us-ascii?Q?EPRVgbtbEVKDECGMkIHWX2xssv98WRjCcpqcqXmGoNyqwCIAvq984wPDgzT0?= =?us-ascii?Q?qYHUC9+wyTwv/XSNUzXoJkbkFl+7acCLIugN3Yczcx2akG6TDHLZRuzQJaKF?= =?us-ascii?Q?SDW4vwsbWr4QGDi1gRgu+ynkWMrfgnc01ZQu01FCK5KpjX8rZK5rAwD+Dmsd?= =?us-ascii?Q?ZrH4wYcJwshnzsVujyIe6HkNOooQQgivEc+cygd+xA3/ak7l7SgQnISf/Wk0?= =?us-ascii?Q?i+98mKO2w7BNy2ngeZT8+3NBKpbNO1ye/ZaxW7WzQ8yJW1nT9JFdtfy0kTk0?= =?us-ascii?Q?3ZEzrSqgAXSJDrzFh9WAMcmDkVGqRmJC0IVBN45aS1gjnuNNcOiPBAu+JJ0Q?= =?us-ascii?Q?rppGD4Y3Eq7mJADGIqlmLeJ6EEMC1oRIAKu6omNiSwMCzkNtEM4LLxh/yy3E?= =?us-ascii?Q?wcGcxKGTGBIrOxix0ieSK4dwvcUr4XuHLJfDv6U2cTv5T3W8hDciAPvHJWr0?= =?us-ascii?Q?OJLiyU77Dzyt/eilYRNytILrMksq8sf7Iipy0INVoAXv4cOrZNYGzZq+uE+r?= =?us-ascii?Q?zmNbNc9KnnizENlopGi5QCaE43gJOrGarlteZPERbero0oDwhXtEZeQNUod8?= =?us-ascii?Q?RYTTEVUDMi+bv+kCuUIw9hYj7lcFPyAlDFf7UdFoPZ6JWaTB4lxVwyjXccNx?= =?us-ascii?Q?aVfeG+7bgysXeWBi5B66G0mcAbK0Kyj11aDZlzqtublHiZ72BpM5yphOc8NB?= =?us-ascii?Q?YKjJEBXmHmkdaPobRrjBik0kK4EdfF/2Gu8ClzOr/fvg5O18eoprbDonR20f?= =?us-ascii?Q?sfHD4T0/PZ2Tbb4C4+NmWM4o1OxMLwJojIaH4ikNN0nnwznfOuqdKbIXvKjX?= =?us-ascii?Q?VwZHulVSYjaz2qei9accvm+YA7q2c5bh404kBZcBvS/FRUx+WEH5OMfIV7sr?= =?us-ascii?Q?FYW1OdDzvMf7qPd/5Tkv2RCustNOfUefXqEuk24uyb9Tvcq+Dz5o2W5gKtTG?= =?us-ascii?Q?4wCbqXTT0KrOEhdypOZ9M0DqvOa4lSQA8j/7kJZxEk+ih2xmk05oIVXGAQAI?= =?us-ascii?Q?29CDydglD422Kyed7Pj/VGRgGS9TOgWCaGsy/1dVQTPIQGMnPVbSxs34u9JO?= =?us-ascii?Q?UPz48TfH7PCVPM=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 6:tlhWmHY1veggt+URQxYhBWCxbpLe+0OPR8oCvbfXVZ?= =?us-ascii?Q?ho4W4NliE1hw072orQ5UrmgnbMTv0SLcsLUkUzf7mFftxBQzThOKY6e86BLz?= =?us-ascii?Q?Qgitg/NIr1vINg66S0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ascii?Q?RqhqILMSvG01HLkF6ZyBKl?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 5:0i5ob2eLgZLMv2P8LJauwET0Rf48O1gbRs7GVnH3147FHARnY2+lLiOn3dL2+pOGYFaBDSBJNOPQp3DeBFaaU0lKNO2908FuimfH7zjbNjCM8zWH5p1LKyY1FhmozbA4pwSvh7yQHu57iiaCc2AZtnhuMQYl/W8gxap+wfMxW+xltEJ+Mf2RJ0mtCQA61ZXo/vvvRKpkNry2Qd4+QygXSCM/YapiZYGUxl+QxpS3ZLbjTuFBZn7frYIJ2ww/vDmQFFKtk+O5wZX/piV+XsonJukW4DuRpKbVpUyEAnJH7vpT9Q1NZKBWNOPvwsA4IO8Z6NiQx9YoX+60Keq05qvbfURW0S5SVRO1RYoWrIWLdrKPlIjQZSe4M0GZcuvP4zH+Ra9htMzUQypyV+a7bHtUslFov8E+Srka2GsZU03dKgIIaD0wzE6jMWdU1p8qdyVSShdXwFZ9/Dh+bUz50grWcIsAVPBoaEGyqILW/fen4OdKZJswjyTLz5u7fM79qOip; 24:RnbTBrTj3a+NKAdGAtWcr1ePlV29N7hrkIJ5qtMYsgObOqQfpsOP8wH1max9Uph9MP56tk2K/YUX5aIeL6FJ616F8BYzZB11l6bNSPCSVmM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 7:qsk9bYc9+SpeD6Ke3wariaYwgkrshPIe8oSwfPMvEWgHATjhE38GqWIhMK52ZRP/lIu7RiCEqWfmgjJKe44zH8hORUmLDMohyOgw8XrpAkub5CHsy77vHkk4nrLNTS5U7Rx+a59ui+UfkqCEoS8EEBxAJIdKNIfiW5nyebGGP+UAopfovUYj1xvz7kGXOs+HjpzTJCOT51ISqHCdo0mBBQonIpl5xk8rCQCTsJSM+DIxdJnI/N/QvLKxUJAPNoyEJClAg/8C9jD2rEeZb1lFShEKlTNDCz3WJ4BfAkxtLn+AE0fF7jnM375UXbw0Wozk2eAsm1QY886OwLvs3JFUC3bbhrLjO9zOAA4/r8NGZefLEIxfjaN/BOfy7+B0ndMc8mukz3F3Yu54gqR6drkQtSwdka6V4Ae5huKYZdeublSe9Edws7aNNPyvALSvarqBhP/m510mZBONjmB8IS4dwTAtmv32CQrUKsNiSzjUZXFC3jYLXJPaCtHzjD1Lt3MKCn0YwlkCyGRQqsVq++U6vMiGWaktTpVbhyX3klm9c/yWdPeq2tcrwVk32pBIiS6538Dlrt9UZqaN/jzaZwKEIBOxYnu7T+MlrGabsRrbpCpMTP7WOd96XeMNW5mSdI/2/osBe4lPGwxcuVxG3EMYffrJwvkfhS/xagyvkwU8m4VprZYnyWjjlCfvIXTGnJqre4QbQ1frwXzfSbtskiflnY6sITNsTP4NczeBg5DMCJ6pa286YvJlm2qP5YOKdsyj9KZG387V/IXC+lhXX+a5VXAX4k1Qrj98KuIQ/Dx7/Yc= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 20:bY81VWQ+7ZEdn2xaX0O6fLqGXdwiSqg9IhLFDmq3sq770cydyv1f+Cc+6Y+qdjD2Kl/xXtyFSl6Arh+5epXrT1ae8YGlqaV+AKYNabSmZQP0eP8YlAgK+hVLFS7Trsy60JgJunvUJC2VuaoiHF3Mj03MC7LBpj2itEPngYFrKvbXmrYD899XPmACZDeCRAcmA39yTDyDze6edMu5dDBmkPYCc5VncHanbA67osg471Ns70WPbUNOE/so+R5Opi2i X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2017 21:10:55.1548 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1151 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ioremap() function is intended for mapping MMIO. For RAM, the memremap() function should be used. Convert calls from ioremap() to memremap() when re-mapping RAM. This will be used later by SME to control how the encryption mask is applied to memory mappings, with certain memory locations being mapped decrypted vs encrypted. Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/include/asm/dmi.h | 8 ++++---- arch/x86/kernel/acpi/boot.c | 6 +++--- arch/x86/kernel/kdebugfs.c | 34 +++++++++++----------------------- arch/x86/kernel/ksysfs.c | 28 ++++++++++++++-------------- arch/x86/kernel/mpparse.c | 10 +++++----- arch/x86/pci/common.c | 4 ++-- drivers/firmware/dmi-sysfs.c | 5 +++-- drivers/firmware/pcdp.c | 4 ++-- drivers/sfi/sfi_core.c | 22 +++++++++++----------- 9 files changed, 55 insertions(+), 66 deletions(-) diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h index 3c69fed..a8e15b0 100644 --- a/arch/x86/include/asm/dmi.h +++ b/arch/x86/include/asm/dmi.h @@ -13,9 +13,9 @@ static __always_inline __init void *dmi_alloc(unsigned len) } /* Use early IO mappings for DMI because it's initialized early */ -#define dmi_early_remap early_ioremap -#define dmi_early_unmap early_iounmap -#define dmi_remap ioremap_cache -#define dmi_unmap iounmap +#define dmi_early_remap early_memremap +#define dmi_early_unmap early_memunmap +#define dmi_remap(_x, _l) memremap(_x, _l, MEMREMAP_WB) +#define dmi_unmap(_x) memunmap(_x) #endif /* _ASM_X86_DMI_H */ diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 6bb6806..850160a 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -115,7 +115,7 @@ #define ACPI_INVALID_GSI INT_MIN /* - * This is just a simple wrapper around early_ioremap(), + * This is just a simple wrapper around early_memremap(), * with sanity checks for phys == 0 and size == 0. */ char *__init __acpi_map_table(unsigned long phys, unsigned long size) @@ -124,7 +124,7 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) if (!phys || !size) return NULL; - return early_ioremap(phys, size); + return early_memremap(phys, size); } void __init __acpi_unmap_table(char *map, unsigned long size) @@ -132,7 +132,7 @@ void __init __acpi_unmap_table(char *map, unsigned long size) if (!map || !size) return; - early_iounmap(map, size); + early_memunmap(map, size); } #ifdef CONFIG_X86_LOCAL_APIC diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index 38b6458..fd6f8fb 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c @@ -33,7 +33,6 @@ static ssize_t setup_data_read(struct file *file, char __user *user_buf, struct setup_data_node *node = file->private_data; unsigned long remain; loff_t pos = *ppos; - struct page *pg; void *p; u64 pa; @@ -47,18 +46,13 @@ static ssize_t setup_data_read(struct file *file, char __user *user_buf, count = node->len - pos; pa = node->paddr + sizeof(struct setup_data) + pos; - pg = pfn_to_page((pa + count - 1) >> PAGE_SHIFT); - if (PageHighMem(pg)) { - p = ioremap_cache(pa, count); - if (!p) - return -ENXIO; - } else - p = __va(pa); + p = memremap(pa, count, MEMREMAP_WB); + if (!p) + return -ENOMEM; remain = copy_to_user(user_buf, p, count); - if (PageHighMem(pg)) - iounmap(p); + memunmap(p); if (remain) return -EFAULT; @@ -109,7 +103,6 @@ static int __init create_setup_data_nodes(struct dentry *parent) struct setup_data *data; int error; struct dentry *d; - struct page *pg; u64 pa_data; int no = 0; @@ -126,16 +119,12 @@ static int __init create_setup_data_nodes(struct dentry *parent) goto err_dir; } - pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT); - if (PageHighMem(pg)) { - data = ioremap_cache(pa_data, sizeof(*data)); - if (!data) { - kfree(node); - error = -ENXIO; - goto err_dir; - } - } else - data = __va(pa_data); + data = memremap(pa_data, sizeof(*data), MEMREMAP_WB); + if (!data) { + kfree(node); + error = -ENOMEM; + goto err_dir; + } node->paddr = pa_data; node->type = data->type; @@ -143,8 +132,7 @@ static int __init create_setup_data_nodes(struct dentry *parent) error = create_setup_data_node(d, no, node); pa_data = data->next; - if (PageHighMem(pg)) - iounmap(data); + memunmap(data); if (error) goto err_dir; no++; diff --git a/arch/x86/kernel/ksysfs.c b/arch/x86/kernel/ksysfs.c index 4afc67f..ee51db9 100644 --- a/arch/x86/kernel/ksysfs.c +++ b/arch/x86/kernel/ksysfs.c @@ -16,8 +16,8 @@ #include #include #include +#include -#include #include static ssize_t version_show(struct kobject *kobj, @@ -79,12 +79,12 @@ static int get_setup_data_paddr(int nr, u64 *paddr) *paddr = pa_data; return 0; } - data = ioremap_cache(pa_data, sizeof(*data)); + data = memremap(pa_data, sizeof(*data), MEMREMAP_WB); if (!data) return -ENOMEM; pa_data = data->next; - iounmap(data); + memunmap(data); i++; } return -EINVAL; @@ -97,17 +97,17 @@ static int __init get_setup_data_size(int nr, size_t *size) u64 pa_data = boot_params.hdr.setup_data; while (pa_data) { - data = ioremap_cache(pa_data, sizeof(*data)); + data = memremap(pa_data, sizeof(*data), MEMREMAP_WB); if (!data) return -ENOMEM; if (nr == i) { *size = data->len; - iounmap(data); + memunmap(data); return 0; } pa_data = data->next; - iounmap(data); + memunmap(data); i++; } return -EINVAL; @@ -127,12 +127,12 @@ static ssize_t type_show(struct kobject *kobj, ret = get_setup_data_paddr(nr, &paddr); if (ret) return ret; - data = ioremap_cache(paddr, sizeof(*data)); + data = memremap(paddr, sizeof(*data), MEMREMAP_WB); if (!data) return -ENOMEM; ret = sprintf(buf, "0x%x\n", data->type); - iounmap(data); + memunmap(data); return ret; } @@ -154,7 +154,7 @@ static ssize_t setup_data_data_read(struct file *fp, ret = get_setup_data_paddr(nr, &paddr); if (ret) return ret; - data = ioremap_cache(paddr, sizeof(*data)); + data = memremap(paddr, sizeof(*data), MEMREMAP_WB); if (!data) return -ENOMEM; @@ -170,15 +170,15 @@ static ssize_t setup_data_data_read(struct file *fp, goto out; ret = count; - p = ioremap_cache(paddr + sizeof(*data), data->len); + p = memremap(paddr + sizeof(*data), data->len, MEMREMAP_WB); if (!p) { ret = -ENOMEM; goto out; } memcpy(buf, p + off, count); - iounmap(p); + memunmap(p); out: - iounmap(data); + memunmap(data); return ret; } @@ -250,13 +250,13 @@ static int __init get_setup_data_total_num(u64 pa_data, int *nr) *nr = 0; while (pa_data) { *nr += 1; - data = ioremap_cache(pa_data, sizeof(*data)); + data = memremap(pa_data, sizeof(*data), MEMREMAP_WB); if (!data) { ret = -ENOMEM; goto out; } pa_data = data->next; - iounmap(data); + memunmap(data); } out: diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 0d904d7..fd37f39 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -436,9 +436,9 @@ static unsigned long __init get_mpc_size(unsigned long physptr) struct mpc_table *mpc; unsigned long size; - mpc = early_ioremap(physptr, PAGE_SIZE); + mpc = early_memremap(physptr, PAGE_SIZE); size = mpc->length; - early_iounmap(mpc, PAGE_SIZE); + early_memunmap(mpc, PAGE_SIZE); apic_printk(APIC_VERBOSE, " mpc: %lx-%lx\n", physptr, physptr + size); return size; @@ -450,7 +450,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) unsigned long size; size = get_mpc_size(mpf->physptr); - mpc = early_ioremap(mpf->physptr, size); + mpc = early_memremap(mpf->physptr, size); /* * Read the physical hardware table. Anything here will * override the defaults. @@ -461,10 +461,10 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) #endif pr_err("BIOS bug, MP table errors detected!...\n"); pr_cont("... disabling SMP support. (tell your hw vendor)\n"); - early_iounmap(mpc, size); + early_memunmap(mpc, size); return -1; } - early_iounmap(mpc, size); + early_memunmap(mpc, size); if (early) return -1; diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index dbe2132..7a5350d 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -674,7 +674,7 @@ int pcibios_add_device(struct pci_dev *dev) pa_data = boot_params.hdr.setup_data; while (pa_data) { - data = ioremap(pa_data, sizeof(*rom)); + data = memremap(pa_data, sizeof(*rom), MEMREMAP_WB); if (!data) return -ENOMEM; @@ -693,7 +693,7 @@ int pcibios_add_device(struct pci_dev *dev) } } pa_data = data->next; - iounmap(data); + memunmap(data); } set_dma_domain_ops(dev); set_dev_domain_options(dev); diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c index ef76e5e..d5de6ee 100644 --- a/drivers/firmware/dmi-sysfs.c +++ b/drivers/firmware/dmi-sysfs.c @@ -25,6 +25,7 @@ #include #include #include +#include #define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider the top entry type is only 8 bits */ @@ -380,7 +381,7 @@ static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry, u8 __iomem *mapped; ssize_t wrote = 0; - mapped = ioremap(sel->access_method_address, sel->area_length); + mapped = dmi_remap(sel->access_method_address, sel->area_length); if (!mapped) return -EIO; @@ -390,7 +391,7 @@ static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry, wrote++; } - iounmap(mapped); + dmi_unmap(mapped); return wrote; } diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c index 75273a25..e83d6ae 100644 --- a/drivers/firmware/pcdp.c +++ b/drivers/firmware/pcdp.c @@ -95,7 +95,7 @@ if (efi.hcdp == EFI_INVALID_TABLE_ADDR) return -ENODEV; - pcdp = early_ioremap(efi.hcdp, 4096); + pcdp = early_memremap(efi.hcdp, 4096); printk(KERN_INFO "PCDP: v%d at 0x%lx\n", pcdp->rev, efi.hcdp); if (strstr(cmdline, "console=hcdp")) { @@ -131,6 +131,6 @@ } out: - early_iounmap(pcdp, 4096); + early_memunmap(pcdp, 4096); return rc; } diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c index 296db7a..d5ce534 100644 --- a/drivers/sfi/sfi_core.c +++ b/drivers/sfi/sfi_core.c @@ -86,13 +86,13 @@ /* * FW creates and saves the SFI tables in memory. When these tables get * used, they may need to be mapped to virtual address space, and the mapping - * can happen before or after the ioremap() is ready, so a flag is needed + * can happen before or after the memremap() is ready, so a flag is needed * to indicating this */ -static u32 sfi_use_ioremap __read_mostly; +static u32 sfi_use_memremap __read_mostly; /* - * sfi_un/map_memory calls early_ioremap/iounmap which is a __init function + * sfi_un/map_memory calls early_memremap/memunmap which is a __init function * and introduces section mismatch. So use __ref to make it calm. */ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) @@ -100,10 +100,10 @@ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) if (!phys || !size) return NULL; - if (sfi_use_ioremap) - return ioremap_cache(phys, size); + if (sfi_use_memremap) + return memremap(phys, size, MEMREMAP_WB); else - return early_ioremap(phys, size); + return early_memremap(phys, size); } static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) @@ -111,10 +111,10 @@ static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) if (!virt || !size) return; - if (sfi_use_ioremap) - iounmap(virt); + if (sfi_use_memremap) + memunmap(virt); else - early_iounmap(virt, size); + early_memunmap(virt, size); } static void sfi_print_table_header(unsigned long long pa, @@ -507,8 +507,8 @@ void __init sfi_init_late(void) length = syst_va->header.len; sfi_unmap_memory(syst_va, sizeof(struct sfi_table_simple)); - /* Use ioremap now after it is ready */ - sfi_use_ioremap = 1; + /* Use memremap now after it is ready */ + sfi_use_memremap = 1; syst_va = sfi_map_memory(syst_pa, length); sfi_acpi_init();