Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752760AbcD0OVk (ORCPT ); Wed, 27 Apr 2016 10:21:40 -0400 Received: from mail-bn1on0053.outbound.protection.outlook.com ([157.56.110.53]:24179 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752049AbcD0OVg (ORCPT ); Wed, 27 Apr 2016 10:21:36 -0400 Authentication-Results: google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=none action=none header.from=amd.com; Subject: Re: [RFC PATCH v1 00/18] x86: Secure Memory Encryption (AMD) To: Pavel Machek References: <20160426225553.13567.19459.stgit@tlendack-t1.amdoffice.net> <20160322130058.GA16528@xo-6d-61-c0.localdomain> CC: , , , , , , , , , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov From: Tom Lendacky Message-ID: <5720CAE7.10005@amd.com> Date: Wed, 27 Apr 2016 09:21:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160322130058.GA16528@xo-6d-61-c0.localdomain> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR0501CA0038.namprd05.prod.outlook.com (10.163.126.176) To CY1PR1201MB1116.namprd12.prod.outlook.com (10.169.19.20) X-MS-Office365-Filtering-Correlation-Id: 4738512e-2c53-4ab3-ac19-08d36ea73b6c X-Microsoft-Exchange-Diagnostics: 1;CY1PR1201MB1116;2:+gg7CnGOSMEPPyOG3jAjnDJ+19klTNmUveISYPabJXsuVT3kgF35eWG53mH792jR1Zr3OtPqE81mY/ArehiujjGCBnULcJpFVTOWbWPB86Z/PYYcnQgevLA880UcJ8I860fHYmEqnLxuZ3w9+cdJG0exYq7uER9vOvcf3cHUyBxuK8DGBwF6RK3JHTeXmGZp;3:HuE2nvGTjEmP4TpjWuWqn18Db2WDI6vA/MMSj17mJIgRNdc5U7NRwO7UMuiBoODHBXetj3zaxbQMyhmGWJ8S1IZE+bCMQwBu3+yMg8BQSH4uj+nAnX0y9Idk9ZlYif65 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR1201MB1116; X-Microsoft-Exchange-Diagnostics: 1;CY1PR1201MB1116;25:0PsJSTEliO2jirgRkGsBYBx0xPvuztYf0lLL3mH5iEKSwjb6VkYBnAH7S0OIxolInB8ucANEsDRibDnaD0EfsGR8jp4RgU6Ra2BCd8OSKggFU2EGpOYHwfumGw/sUFG5xfdkzWp9CMMH0oIFQaBWx0NUC0nbVe++jdwJ+c6N1DyENnQV0l7OjjvuTvT+nRQWHdFGyKuisnbAmJKB/golER5t+DoEp4vEt2zoLLKIXg/j9H4axgUJmTBr8hnTjyG8buoeH/aJwqd+ZxGkXVE039XqEVpzRDfMvQ1AcjKositFs3IrhY21Ek9cFVylQUnYjaHd+6OJTtsqu9UwU7m94r6sz7URIRNMD5vUf7Rv2ZncYDKw53VbcI21n3AaIn1tmnhZuD7srrYMnb/Cnc6k9LVtzBSV4euKPZ1ks/JytaUA4OhuQHqByDyGKvkHU4ovmaNhnHuQ9gd+EGJvOlLBxZM79Led1kc50F//hkuD+v8qbb1CIoMfmd73rdRgwEf2km2YuxseqmsgAUWLmuiAMnIbdCph0SqKvWDqGQaE2dxdjGm797o5L35w/OKbbenGYY+4ooStWZgozYCk27aXj9aWXr+cKq43VWfENo/bURgJGn7Y/SatpIAi+AHcMVc4FiiQv2FzLL8y8uV3YRzNBl+U9eHqT5mbfFDvJnmRkx4= X-Microsoft-Exchange-Diagnostics: 1;CY1PR1201MB1116;20:Z0JaeEWZBPX58y0nVVkTFm+BUC4AK44ylSACeqJsvvMXffRMMcorUFOGxAAvPsC8DiD6AzZ79bZP7hyTbhay5W6sltS/xOuT8/io4GgQldKRhh6gkxZIYwC5iFTXCWhQY5dxyDkHkBDfClXfJfAxzjLbvG9tyllwSuG6t1rtQJxg35Umj5IXOnI6igdr6Mw1VPX8m0e+6w8fhrsoa6NSSLiYwwE8KHTCdNRlkuwak+brqdh1XBY3SqkAJ22TjcNk2iRiVQxb1QdlS2dcRrd3N7HSmK+zInetYU8Os8lO7PuT+lYfGtv0Tddpn1V4UmAXC00OmCvZQwaBWSrxMneU0a9C+giWYhogVi2AHJRFISDG/dZw0aHAQdXgOhhhUbWzdjTf3pyrV/plk8TmstgVKJ6DfgwfRnRyF4pYZUXjBUWTUXZrQ0e8Nffhraswskb/fmK0B+nKeTcB75koEmO8JnFz1YOoSj25T/XPKJiy28Hy1SeqJNI0uSJ3NNx+8Y16;4:NAImoEz+/BmJ9hvmpFw/VddQxi1zM7EsXyeRzhSOt8aTYi7Zj4RGt01kQhBgF4+/nt/6NgsKOoItHVYnSbPgVBznfT6tRkwKBQIJQ/ZUqH6uNaRMG8f+oCyMxsemGWCPxE4+TckQU6bFJoRBfqqXtD/6zXDczM0U3UvY20QyWFnfyW2/vFKrOcq0I3otVip7y+w4vGH/wqiXpxO8qvKFPE3I5oINVS8nu1H8vBzfKUfsbV+sPDdUmO2b1PoIVrTjTElxOewzmmqWIoqsOqsox3uV6oWtF4509iVbqbkbNkbz2g4/Dlzrx//YLhmbmh1/SYKWhjrBkRiVN6zApSdrSS4s7w/3slM9xRWSsZuT/hHI/6pnhJbR1F7vI+bIgQNYUD1mlDDc+xyFmhpmY5hbaI5vS2VwGlVRuqZEi9xEYZ0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:CY1PR1201MB1116;BCL:0;PCL:0;RULEID:;SRVR:CY1PR1201MB1116; X-Forefront-PRVS: 0925081676 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(377454003)(24454002)(66066001)(65956001)(65806001)(42186005)(76176999)(4326007)(110136002)(586003)(65816999)(33656002)(92566002)(230700001)(1096002)(23746002)(2906002)(47776003)(5004730100002)(83506001)(2950100001)(189998001)(36756003)(5008740100001)(77096005)(50466002)(4001350100001)(54356999)(64126003)(50986999)(3846002)(86362001)(81166005)(6116002)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR1201MB1116;H:[10.236.18.82];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY1PR1201MB1116;23:sRpd7Zz6+iQ3VU4kjAfRdiClXEnraIlAiPK?= =?Windows-1252?Q?JT6h7JVketA74yHg81Oyl00rKcR6IrkuSgyyx5lAfGg+v/h15wBGN3NI?= =?Windows-1252?Q?qYl/h/Zh0M5CprPRjp+0SeHpuN8DlKByITW4ns/qWIkyYtY6w1WdUgH6?= =?Windows-1252?Q?XjKtCgOwI2ktckXpNOz7atGv9b4cF0J9OrOBY1qegoasbnbXhqTqQu8L?= =?Windows-1252?Q?0WMNt96bOjf0kr2Gx8k9DAeS8Myf7Ezm1s2w5OvU86FzsjX7mwV/tmBo?= =?Windows-1252?Q?J5aU1epNbWM8eWQNeOvj7/WrQRrnWl2r+Q4C/MZ5gXqJ+PRYANoU6+yX?= =?Windows-1252?Q?M83DtXS4d/2RjpPLOq8X1lvn/I2wdlus2wxOOWG4mWp6S3xJRGNj5IT0?= =?Windows-1252?Q?GWfgAPF+okEDXHWsINYvE6CdBwwyiJPC0t3IVS4mG7HMcrS76H7R/bgh?= =?Windows-1252?Q?x55B5SDFmA2mgFTvdo9CN0ZZ29LxepAmNSrGMZ5/Z6uaJT0v70jEUXsi?= =?Windows-1252?Q?5hfnC+2qj+QMM/rJoX+qwDFlPoBWUBFMTAwSWILxpdCpgQRLl8ubPUvS?= =?Windows-1252?Q?g6bG6iWPTY5ikXsAV9qM7llc9nyq4MWIp9u+fXdT3cNg7hFYQyFLPFPN?= =?Windows-1252?Q?qwSlIAQJt4IiODmK0rE6HWrS1ccZnqhz/aTkWw+ULDU7JZSyeLP/S8Jq?= =?Windows-1252?Q?gpQzqHk12g1mglV3EXCHiwZKSK2HgJkH8DMtue33aJcA45pdLbsRCrL9?= =?Windows-1252?Q?kygBkOS1xIbPcyTZC7vukfl5ctcoZPrtIZaKASS1+IxwLsPanJVaEUgW?= =?Windows-1252?Q?wK1SSBbmHc43BdGxfEzgmhJRtCBPcEkf+9KzBIQXD5661LNXbBpy5KHz?= =?Windows-1252?Q?d3ilxOUAlKO6XKr0WGUu8UthhZPdaPH8huEViexQknnHy8IOIlpYvj0y?= =?Windows-1252?Q?3+Bohnke6A1LFE5RhBeS1jzhXKM3Dq0adaajaqsuVTOa5zod9HC7E8Un?= =?Windows-1252?Q?+6VT3rIPuZiHU3Gv6k/V4QCsHq7ZWLI/Eh1u1u8Q9zp0ZO164Z4lCNsU?= =?Windows-1252?Q?eCKLdC1bgD/3AumT6C2YV8nYhneZW3NJ8PMba?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR1201MB1116;5:Yocn8GXAGButOrn0hKV/p5d7ppl6tU8q+wx1Gb/8j4BiEROoqjQ3dsynb0A2UrQESCNMRV3GGOFbB65TxG3H8pVJNgzz7+3vYZQSDLEEzQMseutjz+VrobeyF7yGQ09x7Dh7u33zRW/U0LWR2H2sJg==;24:YcDkra1KWE88z2gdUPg5CrtqKXa/227iIuSgMegNVol1555XJQVPKFFiFFQFQ1hj67xq3nFi0ltODga41x+HEpxAaARbvJRdxqYvU/qjjrk=;7:J6w3Ok/mzyWQ4p9KkfAJrW9qADSH8Hq+tQaWXTeADxpT3L65YpuEkxiNHcDgPTBOu+Y8WRQEMlykSOyd196PEtWPUQ+zLo8KzkQKbVrH0YwGGY1+IOahPsRw2UW2H9CwYg9RWG6Kk3Mrj2PbwBu23LemhV6FpQ3LRd5DNtSEPJXXJFgYnOIy+AZOBigcPOBS;20:vn6DwJXhBeb/czU+rQmubkAjBoKsOQD/XwRhAi6mPu7FogI0FXXs2ZlHdtFGcWJdjCRXHCZCuI5r4DCAM/j1UEiWGbQENDV6zrsPf2NL3XI+fJBEtcv6+hNn7730G1qv/bk7PbCwV4K1793RfiJpOmd5C42Pj3P9qNRg2MLfs2J6ufZBxL+KKLodYRE0OCtSCge/j2corkKNPFUJn2xVE0aONbNNRm/REc85a16iQatQqmT8ovJtRmmvH/dUet0m SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2016 14:21:31.3849 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR1201MB1116 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2101 Lines: 59 On 03/22/2016 08:00 AM, Pavel Machek wrote: > Hi! > >> This RFC patch series provides support for AMD's new Secure Memory >> Encryption (SME) feature. >> >> SME can be used to mark individual pages of memory as encrypted through the >> page tables. A page of memory that is marked encrypted will be automatically >> decrypted when read from DRAM and will be automatically encrypted when >> written to DRAM. Details on SME can found in the links below. > > Well, actually brief summary should go to changelog and probably to the documentation, > too... > > Why would I want SME on my system? My system seems to work without it. The whitepaper explains the technologies and the value they provide. It's up to you to decide if you'd want to use it. > > Does it protect against cold boot attacks? Rowhammer (I guess not?) It does protect well against cold boot attacks. It might offer some protection against Rowhammer since if a bit got flipped the entire 16B chunk would be decrypted differently. > > Does it cost some performance? The whitepaper talks about this a little, but it has a minimal impact on system performance when accessing an encrypted page. > > Does it break debugging over JTAG? > >> The approach that this patch series takes is to encrypt everything possible >> starting early in the boot where the kernel is encrypted. Using the page >> table macros the encryption mask can be incorporated into all page table >> entries and page allocations. By updating the protection map, userspace >> allocations are also marked encrypted. Certain data must be accounted for >> as having been placed in memory before SME was enabled (EFI, initrd, etc.) >> and accessed accordingly. > > Do you also need to do something special for device DMA? DMA should function normally unless the device does not support the addressing requirements when SME is active. When the encryption mask is applied (bit 47 of the physical address in this case), if the device doesn't support 48 bit or higher DMA then swiotlb bounce buffers will be used. Thanks, Tom > > Thanks, > > Pavel >