From patchwork Fri Jul 7 13:38:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9830311 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 8ADF960352 for ; Fri, 7 Jul 2017 13:41:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80F9C2868F for ; Fri, 7 Jul 2017 13:41:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7544B286A1; Fri, 7 Jul 2017 13:41:16 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 75FFA2868F for ; Fri, 7 Jul 2017 13:41:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTTTD-0002L1-1Z; Fri, 07 Jul 2017 13:38:55 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTTTB-0002KS-Gw for xen-devel@lists.xen.org; Fri, 07 Jul 2017 13:38:53 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id E2/AA-02177-CEE8F595; Fri, 07 Jul 2017 13:38:52 +0000 X-Brightmail-Tracker: H4s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omas.Lendacky@amd.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1499434729!104272420!1 X-Originating-IP: [104.47.36.81] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 41281 invoked from network); 7 Jul 2017 13:38:51 -0000 Received: from mail-sn1nam02on0081.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) (104.47.36.81) by server-14.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 7 Jul 2017 13:38:51 -0000 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=kW58b1k0vgDShJVNTnmQlcg5I6tprVnwCHn0JvojMz8=; b=vmgFfPZk6Rg0Q6uS8nmG8kjXJ3cRJMAkyr0kaHyNrZOrOSiO5Xjg0lOKl2DiA5S3ThDSG/43ECrxF9N/p7xMyYGfxPv+1WNhNnXZTwrckLP9RLPMXBJiGnDlaotNO5C9hkNnxL2w90og3cQExsKeIiMFCX14tY8UOf2zoN13Tlc= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by BN6PR12MB1138.namprd12.prod.outlook.com (10.168.226.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Fri, 7 Jul 2017 13:38:40 +0000 From: Tom Lendacky To: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, xen-devel@lists.xen.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org Date: Fri, 07 Jul 2017 08:38:35 -0500 Message-ID: <20170707133835.29711.66730.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170707133804.29711.1616.stgit@tlendack-t1.amdoffice.net> References: <20170707133804.29711.1616.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR13CA0017.namprd13.prod.outlook.com (10.169.208.27) To BN6PR12MB1138.namprd12.prod.outlook.com (10.168.226.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5823bd37-b2f6-4071-abd4-08d4c53d7d44 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:BN6PR12MB1138; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1138; 3:ki0z8l3nBgClWMwupaq8Jm4mlvDWS1tNfw8tEVFR5UnLnZrTC0J5RHJQkjBZqwAwSjSMFS1d3tU8Lnq2ScdZsXNiv+ko3IeWXdoGJuIamp3rj6MwRBtWCAfukFXhzuXCq697nXubokYkkRFukOmabMwrd5DVX04NnyR8ykO42Ia/3lNpENA0ps3xuDDNVHQBStVwSI4xGSaXfmPHtkf4QlqBgNRKWoiK12GkYaUVFCZcaGtbw8R3VVtAmGecS/liCAjhqha39jTw4aSpbz+/7JlsX82W7XGpUsfdrnRLyXHSVyLCwCLbgehmUwqEa3B/1RNfd0MJgJAkgmEhDulGfwCgBygzSCb9dAsRdSvwCw5MTigWHCKAfZcJ3nQbenkSikXxK49V4Rv74h7fyNph4DVN08gl2w5Dyz1kCb9BN9sJfBqASJMP/a46OvCDO7be2a0TtyslVIvyYRkVoqNxT8sTwpc1TVN8S0PhYXiN2MKB3M75CCPmTtjIkh1w0anwO/v+fyfhOyihNZJZ8uo3SehHvU3YXovE52b8KhxkQ6O05rfu2tIrXbeFVgPoFVuaIDOk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U1VELyGQgcMyOWSYwVSZjUxz9lPHVP3VmeSh2GBwe3vToyf0acpznRnlxvyyctdP0DzW1HEHs8yzRuGdoHVYVBX9sX8JKIuBuuL061LxqOWKnLlzy78XeHZlfDNFyV93+d8CCdS85O3I= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1138; 31:CvJ5g7OZ3Wkz9d6SVli86oY4WyW9IGeONwBd4QF9klkXzAlVWPTVs83292Z/oJaf9ljgmhlF7NEpvR8EtGZyfv7x1/8URqHWn8c3K5ocR62HHvQBf77r3hkMV35G9/8FCpq5zzKRuN/8oSSV2R37mbVqNYNU9La/Bvxvv5qIUXPsOur5GLuhRGJapw+Ve06DR4TcAbYLnaJnAja5vq47V00uZ23iPhS8jv7ceWZVWZE35TYF6Bn/GnjCL/R8uhNkmWg8uMI9G88VRxZAH5T4XSQZXqYCBYaThL0L9JAheT36Qww0VFxExrFaKrU9mxTLQ87cWCCO266ObIC3qjbs6w8LIVjQ7CfIpln6DpcRvTsZ11plWkpCPyQSRfaCaHycMHv9qSEyH97hELfz3ItbbgawELLZI0UI450EL8XPYXwjl8t+lQzdHBv0PCBLIEqA5eJALZeDEIgWfBxtQhws12h2tlzd9lkwwfApzk46lQsjlZ3L9GWr8S4MxCHEt9fGswt6hvuk9SVw0kWUryhOf0XwTljJUWapfx8ugv0UPBSGbktw+jT98TD2Psk1YzXguSaJFHn1hX0p94QMPhahZnTlj+UgS2mjAjcObbbBbfUyWW4bEbLsCHcH6WKN0EQddmA/CDBYFR0dQq5/3pJN72meoShGogdTLWn4zq0x7IQ= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1138; 20:67QUXUzWkjhrPZ10DuQE08NCNWoIpU1R9Z1HTVdieRjCWTtbdyC0btGbtHlZA++Z7IKtEOH9j9wpGpyI89TMl/JwHCv/6VyIhFKRvpeyFvip+Y3lHVJeGDSiN3+h5GwLiusPrmyzAP7hAK8942vl/QpSuspvoUMomA3dKHW0Z9R/a61dXHXRv+mTJ9su/muNLTcgiJrd+DTIHY6VvUcJdIbvqrZrw98TCBRWMXMCk2Z9/sFuR21ziQf2sL9WXGiks1LrgJq7UK1W6f5nJIgUkybcAdPkAN1wXaYFlj7Fi68k0YoqSjZGhLxIlQATARbiGMWMGzTyFOxtuiSLMfxtqmNg36FXo5kCT5FfrACAqV9qwQ65QmVRy38TaH1kelKMWZt0y9P99FAg0tdqFncZqnY5eRiaK2YxD4PpJWSDA3NNPB1al35XsqTZaStKyeN7IN0cMVgHEH96jIVYjz85jwokRaSKNJ7rlwpwLJAidQhGIudxi6pjt/PONFxPDhH1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110)(48057245064654); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(2017060910064)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR12MB1138; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR12MB1138; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTM4OzQ6TFdMYlZhVXlSK1A1WnFnT0Nwbk5BemFyejNn?= =?utf-8?B?NFRlU1k0SFhuWE1nNE11UHZrc3RwbEhVa3BKL1JqNVp0WGVhOWFLV2hwUmVr?= =?utf-8?B?MlZjRllwcmtOeVp1TCsycnk0RFBDeU4zZ0lpRzNISm8ydTN1OTJHTDhxekZy?= =?utf-8?B?YnBsVmliaFA4dGdPWFRyWE5GNVk5em8wTjlWSXlkQlRvY1Y5eGlFaXI4eGty?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U3pCYmlmVkd0?= =?utf-8?B?dGNVVXBjSDE5eDRkM05LQzRNUmFEUHFVV2ZsL1psOTVUdXFER2hzcHh4QmhZ?= =?utf-8?B?UHhjZEJOTG9FbjdFcUk0WGRsOG9VNUg2QkVmd240NnZaRzJJM2Zib2o3bkZI?= =?utf-8?B?SnI3WlZFQWFUVlVoZkNST25iRXVkN2hNQVZiOG1ram1xREpOTkJXbmVTVVor?= =?utf-8?B?eTRsbHo3QStzWlpjYlQ5aEUrbXBYTElGTlZRSVBRT1VFVWdDcnJpcEFySjZ5?= =?utf-8?B?L0JNT0pWY2NFcXlTWDBrbWpxTXJIT2gzWDJJelJQbWFSclI1TjVhZ1Voak1p?= =?utf-8?B?RmRQWUV1Wm9FS3JyWHJFQnBHUTRrWnl4WDc4TFlnM0wwWmlaS256TW1lQTc3?= =?utf-8?B?MW5KbDVkZFBUbVZEWUUySThIVXl4bWEyeVlvYU9vdVdHRDNjVFlHZWFuK3FU?= =?utf-8?B?QmE0OEFUeUplZHdzTEozaWNDTnhDOHVVdlhlcEZnNXdGY1lVUFhuVUtVL3E4?= =?utf-8?B?dUtSY1dkaFNza3h5NFZwNzRZamJuVUU4T1hDa0Q3OGo5NlpWMnlWdG0zYXVx?= =?utf-8?B?ek9mRlhqYVNIZnA5ZWp2MkZHOXJJR1NjWGVHRmFsbnl5NGNxaHBSbHRnOFdu?= =?utf-8?Q?MyvkVyE9s3l13VUKGO5bQmcsqCjbfVSxhEyk=3D?= X-Forefront-PRVS: 0361212EA8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39840400002)(39850400002)(39400400002)(39410400002)(39450400003)(305945005)(53416004)(2906002)(54356999)(42186005)(50986999)(76176999)(478600001)(47776003)(4326008)(81166006)(103116003)(66066001)(8676002)(86362001)(72206003)(7406005)(55016002)(25786009)(7416002)(23676002)(54906002)(5660300001)(189998001)(2950100002)(7736002)(33646002)(50466002)(83506001)(6666003)(97746001)(230700001)(6506006)(9686003)(53936002)(1076002)(110136004)(38730400002)(6116002)(3846002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1138; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTM4OzIzOlhlMGtkZTdXQUFUZTRuZHRya2ZPbnJ1VGZV?= =?utf-8?B?ZDJ1TkxjbUFpUk1wR2YxTmVtTU9USlVkd3dkRDREWHgzaG9Fb0l2cmZkMTZj?= =?utf-8?B?aDZzZWlWSkN2Wm5wZFN6NWJiQVZCMllxOUtyMmNOVng2NmxZb1dCaVc1V1d1?= =?utf-8?B?Y204blc2NjNVTWJiTDZNNjVsWGgvRUFXWmp0L2NQdldSdlhJYnFzcjJ3Rzc2?= =?utf-8?B?ZDRYZXBncmNKY1J2T0EvRFhVY1E3UndySGFERFhLanlqSjFiNUhTbTZkMnFm?= =?utf-8?B?WDNpOGRPV0Q4UURIc08yRzUyUlRKWGl1aE9qbitIWkFsNEJXRllzL201a0lp?= =?utf-8?B?NkZnTFdONWcyVGVaZ2JMY2drajk4dWdRSm12RHdxcnYvYmUvOUw3ZmhxVCsy?= =?utf-8?B?V3dOVEEzMm5Qem9kT0hmM0J6T3liSXhYN1hVTVk0ajQ0dll4V1NhOWdONWY3?= =?utf-8?B?WEVsSkxWNWVEb0VxOGRDWWR4NmFld254Vm1MOGt0czhNVmpMNWdxRjEwbnJV?= =?utf-8?B?aVlxR0VkNndwOUozR2lmM2s4UUlyMjVYV05CZTNLNWMyMlFFRm1ES2tUUlQy?= =?utf-8?B?aFlLL1JPbnZUcWhNOURHM3ZqWVRyakI5NHoxclZ5MjFDdUg0QkY5YVdLR25K?= =?utf-8?B?YlV4N2JnZitNeDVRNWQ1cDY4SE1kbXdKNHFWWTAydDlieG5kMUFJdHk4clRN?= =?utf-8?B?M0RGNzlwamdEaXliUEZBUjFENDh3WXlGRkFQRHJPdzY4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1ucnapHpYIpLiEI0L35dTip6vdQl5883znn+qsxDl/rM3guZHttLKtoAZ3fdLfdmv/bJchZilO1rVXHI3SsRlvkMc/gM= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1138; 20:8j/Q30s7aDIMZXMviSdv4JXyk6bjyIJRObIyva1+A5MO32tfkMti7LHVsexiI1KjSChwGT7dBasg0o5HbODKQOPz8mSAMjrcRodGbJnxehyx9f66loQkgnBdgsbpBG46Fo7VbdsRVWax4YmNc207e3wW+dNglfUIArY2K0dOyYuR0WH9pa8YMroWeDZ9ldcLv7x0h9YZdW7LewpbL6Cn5vTIqtDmi4vHbcqacDIIa2GFzIhHLZhdn4LZAo+yreGe X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 13:38:40.3599 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1138 Cc: Brijesh Singh , Toshimitsu Kani , "Michael S. Tsirkin" , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Boris Ostrovsky , Jonathan Corbet , Joerg Roedel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Larry Woodman , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Dmitry Vyukov , Juergen Gross , Paolo Bonzini Subject: [Xen-devel] [PATCH v9 03/38] x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap for RAM mappings 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" 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 cfd1a89..f20ff96 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -691,7 +691,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; @@ -710,7 +710,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();