Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933722AbdGKPpJ (ORCPT ); Tue, 11 Jul 2017 11:45:09 -0400 Received: from mail-by2nam01on0058.outbound.protection.outlook.com ([104.47.34.58]:62816 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933691AbdGKPou (ORCPT ); Tue, 11 Jul 2017 11:44:50 -0400 Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=amd.com; Subject: Re: [PATCH v9 07/38] x86/mm: Remove phys_to_virt() usage in ioremap() To: Brian Gerst Cc: linux-arch , linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, the arch/x86 maintainers , kexec@lists.infradead.org, Linux Kernel Mailing List , kasan-dev , xen-devel@lists.xen.org, Linux-MM , "open list:IOMMU DRIVERS" , Brijesh Singh , Toshimitsu Kani , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , Jonathan Corbet , Joerg Roedel , "Michael S. Tsirkin" , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Borislav Petkov , Andy Lutomirski , Boris Ostrovsky , Dmitry Vyukov , Juergen Gross , Thomas Gleixner , Paolo Bonzini References: <20170707133804.29711.1616.stgit@tlendack-t1.amdoffice.net> <20170707133925.29711.39301.stgit@tlendack-t1.amdoffice.net> <81fbf5db-c42f-cfe6-5d31-d60adbd18f26@amd.com> From: Tom Lendacky Message-ID: <4404cf23-3b9c-e712-f883-fa6dc4318214@amd.com> Date: Tue, 11 Jul 2017 10:44:34 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR1001CA0001.namprd10.prod.outlook.com (10.174.84.14) To DM5PR12MB1148.namprd12.prod.outlook.com (10.168.236.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 878e6dfc-0d95-456d-a8be-08d4c873bf0e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR12MB1148; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1148;3:bUISc/qMP3ERWoJW3P8eHYrSeCTvHI2/pYE68yE/QajNkR9loSgU4OzkrwWNCTEYALtErrbrrusIFxAMEXv5PmbdXhtzP3C4bRSxpv38HztfQrtZej99PdMlbbSN87XOSjg6cjKfL9MnHE4M8WEZLZsXlmMs3BViD6SmphmPhZVEvgz6O4gSmh+cBdbHnPD9bAZHa9hwQ0ScCNToXHq3eksCsmDXg1LoR1y43kqfZoJRiXTz6ZYF4OlVDkwlG5QlnVEaSmDtQBhCJCZU4rJPGXenMvEjRIBrBW8uN4iz6VuHKznLzgPiyalDBk0+8dvUOcr1xxYdl0WjZAXK5+z9milR4RcML+3aFes4AHGqGFv4a6pLmLkHOoElsOBMAc3lflpLkx/ZZamDIHs/WaR7LNRyEcY80+D8Mk6bo/9Y06NMKEKtQGm990hPLw+Q48XLoCtdmE/K2r03Z3ITD3PbWvpPZDHrXdNOVxSw4NwqlWyeD3DLkq0gt+32rweTRHQUs/oGkWtcZkDputdEO2PrOjuT0H79f5msp6m1xi0Eo+7cR0fY1bIkRfaE1UruhALHlSjPnmiYx6pYc+FRUK1PTtetBBo+BI1YiMJO159eMzD9t9vXu2JK80TsSh9vHm+6UP42jF1R9uBZ/SQV+tnTPEw6l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j/3Lsihr93gS6VOWStsp9jyd7Rp2m6FgjbDKKF3NsAp0aZ6X8Vhq5wkFFRlHHC3rLwHQpL6DCYUf6eQfgjdXzfHeGiiOU7Nb61zY9kDOOWaJlDHSvCxoem7GLHDy4H31MD9mY3hEaToGcbbxa5fuo5zN02BJ9BYPP/XkZvODHKjrz5U61Q86dmrVbLk3upGS+I5YEckxDhuhWfM5lR4kSSqXs9Ufyg9sNqprAV3qFZ5G48VU93JwBkh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110)(167848164394848); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1148;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1148; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ4OzQ6L0tuTE9rMVluZ2lrYzNEV2dnbW1INlEzV29Y?= =?utf-8?B?a0hTanBTRnFTN0NMaVNvTzJYd3BVV2dETXZISm5haDFwWENxcTZkQTNRbUk3?= =?utf-8?B?N0FxajNwNEdmTCsrSmU2SG4xRllCVmQ5blc1NnlPem1mN3U5RFZKZHhCWGd4?= =?utf-8?B?UTZkaFptTlhYZndHTUVQaElTcWE0UmhEVWdESnNacjltQjQvekNwUkhTRnhR?= =?utf-8?B?Z2YwWWZsRlVxWmhudWZaQncxUWhPdFVBNGlodmtvZlhpMktnODlnd1pVdElS?= =?utf-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oVmZ2em5KaXdyRERqMmxyYnFadGV2?= =?utf-8?B?QzVTVG9RNFU4VmdBbEZLeTNBM0tFcmJSZHNCbHJ1TGEzZGJ3TlkyUzR5c2FD?= =?utf-8?B?VndKam1xNHNKVnZFYnV6NzlLYTc2UWhpclYrUE5Gclk2SmoxQWpzNDNUcm5S?= =?utf-8?B?dEJqUW1mUFJPTUtzT3lmRkRLcG5BOUR3bC9yUnBIaGN1YkQ1aFZYYkFqUUQ0?= =?utf-8?B?bENsV0YxNjZhbkJPNjYvOUw3SlNJL2M2VWNOZWduR3k3WnZibzFSSUhNakhG?= =?utf-8?B?ckY2MEx3d0IxalBuN05UWEpFVHNQVTBXOEpKZStPcDRjeEJIOVhnWVFPRXlw?= =?utf-8?B?WldVRFpkdDFIUTFsUktveW9BQkN1OEY0bTZBSjRHem1UZkp1Zjh4WDdDRWhS?= =?utf-8?B?bzA3MVU0WFkrcTF3WEhFKzlqY1AxbkxFaVJzNkw2RnIvRlZxWnpVOVE5bU5T?= =?utf-8?B?Sml0c05zejhoWjhvbms0eVMzb290NStqTzFpZG5MZ3p5Rmp6RkxhTVloZU5D?= =?utf-8?B?clJrTWxFLzRoSndyWVdZUEx1Zmg5WmFsQkRzbzIxVnlUL01aa1MxeGZQOGd0?= =?utf-8?Q?cx7db0CG+6WkZgMt5pqXR9XndpX7YxVwI4gA=3D?= X-Forefront-PRVS: 0365C0E14B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(6049001)(39450400003)(39860400002)(39410400002)(39840400002)(39850400002)(39400400002)(209900001)(377454003)(24454002)(5660300001)(305945005)(1411001)(47776003)(229853002)(72206003)(23676002)(2906002)(110136004)(7416002)(50986999)(6666003)(478600001)(6246003)(76176999)(4001350100001)(65826007)(81166006)(7736002)(4326008)(38730400002)(53376002)(7406005)(8676002)(6916009)(83506001)(2950100002)(7350300001)(54356999)(3260700006)(25786009)(36756003)(50466002)(53936002)(33646002)(64126003)(3846002)(66066001)(53546010)(230700001)(65956001)(77096006)(189998001)(65806001)(42186005)(6116002)(31686004)(6486002)(86362001)(966005)(54906002)(31696002)(6306002)(93886004)(6606295002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1148;H:[10.236.64.250];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ4OzIzOmZUT1ZtUUZtdm9hdFhEMXRDVDcyZWJqVlcz?= =?utf-8?B?N0liS3MvQUFrcFNGSWt6RUIzTmh2VU94M3dxN1hJWGQ3Vjc5Y3NzUC93VnlE?= =?utf-8?B?WUlINXREa0pYZ3M5T1pQYlROYXBocnRObUZkZ1VrZVRuN0VvS1I0Sk1NMmhU?= =?utf-8?B?TktPSEdYWTdPdXdTMzl4bWMyRE1iNGFzM2FjbllGa0ZsMWpYNy9lR1pvcENm?= =?utf-8?B?cUU4UDJXSy9Pd2g2NzJYSFUzazVMQlVXdzQxSnMwUGh2Vms0cEowek9GQzdL?= =?utf-8?B?WUtCYXB2SDVZL2ZFTVFhdWdvZ0xJZVpZVzJrUENyVmNMODJNUTZlUzdGTTJO?= =?utf-8?B?TnJqbEREUS85WXhJckZlMjlDcnNtTGZQa0QyUEJad1AzWkJvMGRTZW85QTRp?= =?utf-8?B?WUwvOHcyUlYxUzZ3a2tGY0kvMWRFR1R6VVJpMmlqT0xQdEVoWnI3S3lOajdC?= =?utf-8?B?ajJPb2dvU1BhcGZkUmhrTURlKzRVNmNQa2ZHcjdyRnRhckdZMTFyM0NxTWN4?= =?utf-8?B?Z2drVlRPSDVnMldqZWV6VkxFT3I3VVArS0RlWTVHTHRwYUNzQUhWMDdVcHkr?= =?utf-8?B?TDZhbVYzRWdTSWViNkVqVk9aaEh4b2ZwV3RqRkNaMHF2Y3JSZDNJNS9BKzVQ?= =?utf-8?B?eHpnYUdsbW5yY3N0SktFeVFHNWVvVjRvWG1ONTEyWWpTa0w2KzRJUWpRTXg2?= =?utf-8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EdnelNKcEFQRWtHdnpkNE1HbGhXZDF6UGx0dTlTYVZH?= =?utf-8?B?a3dGbnZNSVFTdUQrNnBzZ0IrWEZVZFBuYnNpaTNNbk43bVdxRnpnYXVaUGVZ?= =?utf-8?B?ZU80S2k1VU93anFBOXRWSDU0REliL2NjanpxR2E5T25hdEp4L1o5UnF2bkp1?= =?utf-8?B?U2tuY2lZdG9sZ2lWUUs1UFplNzVzZDAzZEdycEQ4cEJaRWVLUHlhMDFwVXRP?= =?utf-8?Q?c3lNyro?= X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1148;5:y8uiixDp6fxtEnzF9OZB3RQIAIrabPwWhRQTzQVm1KDnVblUK6dV0K5swnB9XROsZw3LQAAZ44rmIqQJnbmO8A+AQgYAsMvZ+WNIOTU1RH5/04VuVdrnludS7qs6Zq5M83hErMwYvw94n+sEGcCTSWJ+NLilsmUAqncqLv95SfqcVTcVK4JAHiWN8IbdkdQIfll+Zi+VgKP2tHKJXmNU83G+96O0+GP9imdnOHhEERXQVl42gk8uUl4nlwwuHMZmpj4g61bMH/xM9NCAkut5ruG78yOYN11DvNDQp6IqTfYeTa54jYlP2/DZgympABch6pOttULDPP1oX43a3K9QW64GVDtJHD66nMQsBrty8MIgGiuzXnVcww9u40klui3JSfTWkveHFBDJtXBHltdEkROsqdoqoKSjdI8NrazbCvA5XfT5gx21BOSUljUc0UR1eZ7v5LVFgEkQHryrw58aB94YTXtjaT6px2p1Nm8gmTX6qrK7Ak56RS8vSvsYjp9/;24:xUQL7OZFujWng77NE/c9ZB1nqpVqZ9hLHx7pi1AbfQTw433lcPdrfVFpSwoZFT5bI9jG1m//32BiwzHSJBMmoRiBa7GhukGWb609pUiqq20= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1148;7:pMihOgVlQKL0HqNAwjGqGFcPK1eeAAflzNp14r2/Ueg8Lu2Qont+n6mLI/VpXpq7+hSp6+fg0mUTY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ime: 11 Jul 2017 15:44:37.7681 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1148 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3811 Lines: 106 On 7/11/2017 10:38 AM, Brian Gerst wrote: > On Tue, Jul 11, 2017 at 11:02 AM, Tom Lendacky wrote: >> On 7/10/2017 11:58 PM, Brian Gerst wrote: >>> >>> On Mon, Jul 10, 2017 at 3:50 PM, Tom Lendacky >>> wrote: >>>> >>>> On 7/8/2017 7:57 AM, Brian Gerst wrote: >>>>> >>>>> >>>>> On Fri, Jul 7, 2017 at 9:39 AM, Tom Lendacky >>>>> wrote: >>>>>> >>>>>> >>>>>> Currently there is a check if the address being mapped is in the ISA >>>>>> range (is_ISA_range()), and if it is, then phys_to_virt() is used to >>>>>> perform the mapping. When SME is active, the default is to add >>>>>> pagetable >>>>>> mappings with the encryption bit set unless specifically overridden. >>>>>> The >>>>>> resulting pagetable mapping from phys_to_virt() will result in a >>>>>> mapping >>>>>> that has the encryption bit set. With SME, the use of ioremap() is >>>>>> intended to generate pagetable mappings that do not have the encryption >>>>>> bit set through the use of the PAGE_KERNEL_IO protection value. >>>>>> >>>>>> Rather than special case the SME scenario, remove the ISA range check >>>>>> and >>>>>> usage of phys_to_virt() and have ISA range mappings continue through >>>>>> the >>>>>> remaining ioremap() path. >>>>>> >>>>>> Signed-off-by: Tom Lendacky >>>>>> --- >>>>>> arch/x86/mm/ioremap.c | 7 +------ >>>>>> 1 file changed, 1 insertion(+), 6 deletions(-) >>>>>> >>>>>> diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c >>>>>> index 4c1b5fd..bfc3e2d 100644 >>>>>> --- a/arch/x86/mm/ioremap.c >>>>>> +++ b/arch/x86/mm/ioremap.c >>>>>> @@ -13,6 +13,7 @@ >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> +#include >>>>>> >>>>>> #include >>>>>> #include >>>>>> @@ -106,12 +107,6 @@ static void __iomem >>>>>> *__ioremap_caller(resource_size_t phys_addr, >>>>>> } >>>>>> >>>>>> /* >>>>>> - * Don't remap the low PCI/ISA area, it's always mapped.. >>>>>> - */ >>>>>> - if (is_ISA_range(phys_addr, last_addr)) >>>>>> - return (__force void __iomem *)phys_to_virt(phys_addr); >>>>>> - >>>>>> - /* >>>>>> * Don't allow anybody to remap normal RAM that we're using.. >>>>>> */ >>>>>> pfn = phys_addr >> PAGE_SHIFT; >>>>>> >>>>> >>>>> Removing this also affects 32-bit, which is more likely to access >>>>> legacy devices in this range. Put in a check for SME instead >>>> >>>> >>>> >>>> I originally had a check for SME here in a previous version of the >>>> patch. Thomas Gleixner recommended removing the check so that the code >>>> path was always exercised regardless of the state of SME in order to >>>> better detect issues: >>>> >>>> http://marc.info/?l=linux-kernel&m=149803067811436&w=2 >>>> >>>> Thanks, >>>> Tom >>> >>> >>> Looking a bit closer, this shortcut doesn't set the caching >>> attributes. So it's probably best to get rid of it anyways. Also >>> note, there is a corresponding check in iounmap(). >> >> >> Good catch. I'll update the patch to include the removal of the ISA >> checks in the iounmap() path as well. > > I now think it should be kept but also emit a warning, at least for > the short term. There is bad code out there (vga16fb for example) > that calls iounmap() blindly without calling ioremap() first. We > don't want to actually follow through with the unmap on the linear > mapping. Yup, was just about to reply to the other email on this. That makes sense, keep the check but add a warning to it so that it will catch any misuses of iounmap() and those can then be addressed. Thanks, Tom > > -- > Brian Gerst >