From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753981AbcEZNqV (ORCPT ); Thu, 26 May 2016 09:46:21 -0400 Received: from mail-bn1on0054.outbound.protection.outlook.com ([157.56.110.54]:32279 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753643AbcEZNqR (ORCPT ); Thu, 26 May 2016 09:46:17 -0400 Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=amd.com; Subject: Re: [RFC PATCH v1 10/18] x86/efi: Access EFI related tables in the clear To: Matt Fleming References: <20160426225553.13567.19459.stgit@tlendack-t1.amdoffice.net> <20160426225740.13567.85438.stgit@tlendack-t1.amdoffice.net> <20160510134358.GR2839@codeblueprint.co.uk> <20160510135758.GA16783@pd.tnic> <5734C97D.8060803@amd.com> <57446B27.20406@amd.com> <20160525193011.GC2984@codeblueprint.co.uk> CC: Borislav Petkov , Leif Lindholm , Mark Salter , Daniel Kiper , , , , , , , , , , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Ingo Molnar , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov , Ard Biesheuvel From: Tom Lendacky Message-ID: <5746FE16.9070408@amd.com> Date: Thu, 26 May 2016 08:45:58 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160525193011.GC2984@codeblueprint.co.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BY1PR15CA0009.namprd15.prod.outlook.com (10.162.17.147) To BY2PR1201MB1111.namprd12.prod.outlook.com (10.164.168.19) X-MS-Office365-Filtering-Correlation-Id: 2b325210-3392-4a3b-4c7b-08d3856c183a X-Microsoft-Exchange-Diagnostics: 1;BY2PR1201MB1111;2:WEcHmeN/RJWsC6Y9hh38VI3ULiIoBnQy3Y5cQ+419P2yj1Zm0Ufz7x7VtGq/QJ2giR4ZbIEVZSb3qBZbxd7i3horU0Je5Aj7EbiG4EHemTPirjCmKi65EtT/oQRqTQmV/BSQA8uMoz35ld0ZMysvGDFWakMa8bpZFtwqkCfqRuQGjNePcinFvKmbYocCXYBe;3:uL0TAiw+XNmh+jDgvrW0r05ycHExsnt0Dmy0WknUbVSWlFmCd0xRKPXCgeauC1AuKW7zHw43WIYLfgUd5Ij+mEMOYIZ/gl1SVFS73hEfI7GpS8tv56ErYa8UBUlmiLzH X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR1201MB1111; X-Microsoft-Exchange-Diagnostics: 1;BY2PR1201MB1111;25:HSracz192DaAmYECY9S0jHAIlxBVG7mIwq9UJfiwdKQAzsYhlJbHXx8cgZRsB8nABl1zSiazSYsOJqTw6f4B0vypu2FOuZI1oL0HXeireBEy6ohFGTffs6bWZvjz4RWrA9ay1BTrtcFpCODkwQIxl29MOdmHq0/oCHXpBtBi7nWxC5WOh1d6x9mT9NjORiklLUlSG12Lw9cmO5IO47/GWKcV7i1nWitNizPXQSI7VE7nfSJuOJqptKNw8au3Gq1aC3Q9GczeVzz9+0fQEHWoe/BXlogVsFkaXftey6mwvg87IW6/llX3b0xtEszjoHBdMD3eJSnGKYBubaMAVKK/voi07cgG8N1yAAPRuzyiX/5Q5n3chraWO5SBK+Xgk/arQpVn2fHuhsfcTMDA/6APx+oRUImOt38JMC3AyntWlTxe9tqvu5P7+tU87Srjg8X1b2WAPC743kidTfrnLfWC3uE0r++QepvzNU7y3hZo8Oj5wRXL2zo0oPFtV1CSv9n5uxDnVlpqZgaHb9OOknxJ/sRBxGROh2/+fSa8uCh+1LEiACboB7BKKOvsXCxEbcb2//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9YHc1knsNSs6zXSXn0QkMCECzr5qOvPwOMdUo1hqU//ssNFDtu8DIug== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:BY2PR1201MB1111;BCL:0;PCL:0;RULEID:;SRVR:BY2PR1201MB1111; X-Forefront-PRVS: 0954EE4910 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(377454003)(24454002)(42186005)(2950100001)(77096005)(33656002)(8676002)(81166006)(36756003)(23746002)(87266999)(54356999)(65816999)(92566002)(5004730100002)(110136002)(86362001)(230700001)(50466002)(189998001)(76176999)(50986999)(93886004)(5008740100001)(4001350100001)(47776003)(65806001)(66066001)(65956001)(4326007)(83506001)(3846002)(586003)(80316001)(6116002)(2906002)(64126003)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR1201MB1111;H:[10.236.18.82];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BY2PR1201MB1111;23:l09AwhgR2mY3yDsMjsl+UyWw7/7LwiPXw2r?= =?Windows-1252?Q?aVfTDuVa/qnXxfOnt3L90b8TojQomGEyppeNb4IUz4Kt9dXmz2COnoHJ?= =?Windows-1252?Q?wuEqaW7GoNbHZGg/QfmYGRqeIcuk4cpd/2fBUDnbGvA7BMZB3GJmqAmJ?= =?Windows-1252?Q?XPOhFugr+VBNtmHpBp/fT11MnkHaXxAlE7NQnpG+UwyftoVsSO4D4+Jn?= =?Windows-1252?Q?p+uZWQ8AUZ4gc5jLaEV3EQJzEpjgBU7cT9/frQe3caBafC2REDy/18kf?= =?Windows-1252?Q?a+7XCyjVQCtUAjWRNPM/GZBR2E6qvqJZjBO1XBL6p+6rEG/uYmVBsT1n?= =?Windows-1252?Q?bfTMWo+doV3zxD0iLzki1xLdNJRawDdP5Ofh9yfSYxtc30GK0dcTEnRW?= =?Windows-1252?Q?711W4NRD0J3BvjU5mMEeXAAN3VovIbXFfQxlUPWS6RArLIQS7ZOJqNpa?= =?Windows-1252?Q?lDMqw+uL+Ou8QyMb0S4bRQJl+Pjk4Uq++hxu8FBoJ1nUzJoBOtm0LPHV?= =?Windows-1252?Q?jl72Mlq9LiXhpidgRYHRTr9j0jkqwdsoFRZDIFQBtElU6YWtzZWHElrz?= =?Windows-1252?Q?cPlSUQJLRrFPiqNM5OeMOCPH5zraS82pvvMTy4YQp+mObZZtkz5rtlu4?= =?Windows-1252?Q?MjwMXsh9vivpJnYGDbW6DssaTY2NraMmlvomLRzVevFH82qe2AvYbv6p?= =?Windows-1252?Q?k2Nqcv3uLgFw55aXIX+ZFJdOg81Y34Vpcf+99xLfdnfRkX0Kx6u2N4VK?= =?Windows-1252?Q?zrzkjP0dguEi8fiMbjoPr+15OoP5pszMrd0DfTblucSRRsFKiaArDO34?= =?Windows-1252?Q?eePd50fRrYOvmkU/aXiAEibtOPcLMO//NEHq0zr0ceXl5zd6ts4QRHu4?= =?Windows-1252?Q?vxgqmp20wPLCiNNKHCqpEHYZFMHlOr4bOyK1oo385toEfggPxwD5ZcTC?= =?Windows-1252?Q?L7+aExGyA4PfY12rSMDQqjyssadpXv0RIU8fFC63lrVLebLjfdtkdTYb?= =?Windows-1252?Q?6JOZd8rD+RaLVqBaPAQL6nsV/1xR65owWZnMnaX2O004tDiHbqDYZ2D8?= =?Windows-1252?Q?sJQVesFWmBH60t8lgN0QLGf5vYQxBWhQh0YhpzeeS+39jfPXEcefDVLO?= =?Windows-1252?Q?zTzs2yXj91YSk6XaltCBZJFXNXyaoABNwF7jINKasMLry?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR1201MB1111;5:Kn5H1+Gub0zbE0kKqjymhmfQ+PwnNuvEFScZYDWnZW680YCNssqGB/PrZ6HFtt+ynBaI/Glb9Jw+k2KvcotR0pZDWzFZVvoNxnpLzVHt4fw+UAzd4UpH1src30N+rXdHXt/BlaSVooLV+OBzF36pYQ==;24:paM89xlaXSaYlnDxiCjTLTGsu6tNJVHZy9vK7qe+9UG2XMvXb/S1KkfJVBumgjxkDd+q0aqfjvXP56mQl93Mz5R7S46wDi+pWhI5+2vibxU=;7:MFLm09N6dBk+kjqamcHxQEh7ekQW1RQbIsngHudVAjeHXbhLsPe1y9WV/hLDtag8bPqlb6Ae9WmPYmO9AoD1N6u+d2Popn7Vjr5PWCUx+KSWFAJ/5KOIh7rkrlslsn0X9vOz30T28fLQdoIde9pQCYoRdUUIsE8c6HyWDzFN3OttSIwVzFdJHj0x2HVLyRni;20:MozpTBYqSkUrrJeeYZ0hDwe+kD0t3vQOoIPX2de2k76XfXSPJf+KSE80YM+gQqLheQ/m4UrcO5nMrya/AlvLpY660inH8Fwb0PMzzPO/+ZbPw2PPAED6dujg33GvErcoo7KWxf8BHS845Kfmz9STz3okNUNLUOPYIftvTgev08zD+AJNDbSLoGmv8z2oHGADc3b4btptKeXQF5HLHh2fHb1y3D2AG8/xSVBr17KiGsUI0glFxJpvoF/eun0UYcJm SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2016 13:46:08.3963 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR1201MB1111 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/25/2016 02:30 PM, Matt Fleming wrote: > On Tue, 24 May, at 09:54:31AM, Tom Lendacky wrote: >> >> I looked into this and this would be a large change also to parse tables >> and build lists. It occurred to me that this could all be taken care of >> if the early_memremap calls were changed to early_ioremap calls. Looking >> in the git log I see that they were originally early_ioremap calls but >> were changed to early_memremap calls with this commit: >> >> commit abc93f8eb6e4 ("efi: Use early_mem*() instead of early_io*()") >> >> Looking at the early_memremap code and the early_ioremap code they both >> call __early_ioremap so I don't see how this change makes any >> difference (especially since FIXMAP_PAGE_NORMAL and FIXMAP_PAGE_IO are >> identical in this case). >> >> Is it safe to change these back to early_ioremap calls (at least on >> x86)? > > I really don't want to begin mixing early_ioremap() calls and > early_memremap() calls for any of the EFI code if it can be avoided. I definitely wouldn't mix them, it would be all or nothing. > > There is slow but steady progress to move more and more of the > architecture specific EFI code out into generic code. Swapping > early_memremap() for early_ioremap() would be a step backwards, > because FIXMAP_PAGE_NORMAL and FIXMAP_PAGE_IO are not identical on > ARM/arm64. Maybe adding something similar to __acpi_map_table would be more appropriate? > > Could you point me at the patch that in this series that fixes up > early_ioremap() to work with mem encrypt/decrypt? I took another > (quick) look through but couldn't find it. The patch in question is patch 6/18 where PAGE_KERNEL is changed to include the _PAGE_ENC attribute (the encryption mask). This now makes FIXMAP_PAGE_NORMAL contain the encryption mask while FIXMAP_PAGE_IO does not. In this way, anything mapped using the early_ioremap call won't be mapped encrypted. Thanks, Tom > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Lendacky Subject: Re: [RFC PATCH v1 10/18] x86/efi: Access EFI related tables in the clear Date: Thu, 26 May 2016 08:45:58 -0500 Message-ID: <5746FE16.9070408@amd.com> References: <20160426225553.13567.19459.stgit@tlendack-t1.amdoffice.net> <20160426225740.13567.85438.stgit@tlendack-t1.amdoffice.net> <20160510134358.GR2839@codeblueprint.co.uk> <20160510135758.GA16783@pd.tnic> <5734C97D.8060803@amd.com> <57446B27.20406@amd.com> <20160525193011.GC2984@codeblueprint.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160525193011.GC2984@codeblueprint.co.uk> Sender: linux-arch-owner@vger.kernel.org To: Matt Fleming Cc: Borislav Petkov , Leif Lindholm , Mark Salter , Daniel Kiper , linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, iommu@lists.linux-foundation.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Ingo Molnar , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov Ard Biesheuvel List-Id: linux-efi@vger.kernel.org On 05/25/2016 02:30 PM, Matt Fleming wrote: > On Tue, 24 May, at 09:54:31AM, Tom Lendacky wrote: >> >> I looked into this and this would be a large change also to parse tables >> and build lists. It occurred to me that this could all be taken care of >> if the early_memremap calls were changed to early_ioremap calls. Looking >> in the git log I see that they were originally early_ioremap calls but >> were changed to early_memremap calls with this commit: >> >> commit abc93f8eb6e4 ("efi: Use early_mem*() instead of early_io*()") >> >> Looking at the early_memremap code and the early_ioremap code they both >> call __early_ioremap so I don't see how this change makes any >> difference (especially since FIXMAP_PAGE_NORMAL and FIXMAP_PAGE_IO are >> identical in this case). >> >> Is it safe to change these back to early_ioremap calls (at least on >> x86)? > > I really don't want to begin mixing early_ioremap() calls and > early_memremap() calls for any of the EFI code if it can be avoided. I definitely wouldn't mix them, it would be all or nothing. > > There is slow but steady progress to move more and more of the > architecture specific EFI code out into generic code. Swapping > early_memremap() for early_ioremap() would be a step backwards, > because FIXMAP_PAGE_NORMAL and FIXMAP_PAGE_IO are not identical on > ARM/arm64. Maybe adding something similar to __acpi_map_table would be more appropriate? > > Could you point me at the patch that in this series that fixes up > early_ioremap() to work with mem encrypt/decrypt? I took another > (quick) look through but couldn't find it. The patch in question is patch 6/18 where PAGE_KERNEL is changed to include the _PAGE_ENC attribute (the encryption mask). This now makes FIXMAP_PAGE_NORMAL contain the encryption mask while FIXMAP_PAGE_IO does not. In this way, anything mapped using the early_ioremap call won't be mapped encrypted. Thanks, Tom > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id 001CF6B007E for ; Thu, 26 May 2016 09:46:15 -0400 (EDT) Received: by mail-ob0-f198.google.com with SMTP id dh6so126572573obb.1 for ; Thu, 26 May 2016 06:46:15 -0700 (PDT) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0076.outbound.protection.outlook.com. [157.56.110.76]) by mx.google.com with ESMTPS id w189si5197745itc.91.2016.05.26.06.46.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 May 2016 06:46:15 -0700 (PDT) Subject: Re: [RFC PATCH v1 10/18] x86/efi: Access EFI related tables in the clear References: <20160426225553.13567.19459.stgit@tlendack-t1.amdoffice.net> <20160426225740.13567.85438.stgit@tlendack-t1.amdoffice.net> <20160510134358.GR2839@codeblueprint.co.uk> <20160510135758.GA16783@pd.tnic> <5734C97D.8060803@amd.com> <57446B27.20406@amd.com> <20160525193011.GC2984@codeblueprint.co.uk> From: Tom Lendacky Message-ID: <5746FE16.9070408@amd.com> Date: Thu, 26 May 2016 08:45:58 -0500 MIME-Version: 1.0 In-Reply-To: <20160525193011.GC2984@codeblueprint.co.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Matt Fleming Cc: Borislav Petkov , Leif Lindholm , Mark Salter , Daniel Kiper , linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, iommu@lists.linux-foundation.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Ingo Molnar , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov , Ard Biesheuvel On 05/25/2016 02:30 PM, Matt Fleming wrote: > On Tue, 24 May, at 09:54:31AM, Tom Lendacky wrote: >> >> I looked into this and this would be a large change also to parse tables >> and build lists. It occurred to me that this could all be taken care of >> if the early_memremap calls were changed to early_ioremap calls. Looking >> in the git log I see that they were originally early_ioremap calls but >> were changed to early_memremap calls with this commit: >> >> commit abc93f8eb6e4 ("efi: Use early_mem*() instead of early_io*()") >> >> Looking at the early_memremap code and the early_ioremap code they both >> call __early_ioremap so I don't see how this change makes any >> difference (especially since FIXMAP_PAGE_NORMAL and FIXMAP_PAGE_IO are >> identical in this case). >> >> Is it safe to change these back to early_ioremap calls (at least on >> x86)? > > I really don't want to begin mixing early_ioremap() calls and > early_memremap() calls for any of the EFI code if it can be avoided. I definitely wouldn't mix them, it would be all or nothing. > > There is slow but steady progress to move more and more of the > architecture specific EFI code out into generic code. Swapping > early_memremap() for early_ioremap() would be a step backwards, > because FIXMAP_PAGE_NORMAL and FIXMAP_PAGE_IO are not identical on > ARM/arm64. Maybe adding something similar to __acpi_map_table would be more appropriate? > > Could you point me at the patch that in this series that fixes up > early_ioremap() to work with mem encrypt/decrypt? I took another > (quick) look through but couldn't find it. The patch in question is patch 6/18 where PAGE_KERNEL is changed to include the _PAGE_ENC attribute (the encryption mask). This now makes FIXMAP_PAGE_NORMAL contain the encryption mask while FIXMAP_PAGE_IO does not. In this way, anything mapped using the early_ioremap call won't be mapped encrypted. Thanks, Tom > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org