Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753456AbcD0OpN (ORCPT ); Wed, 27 Apr 2016 10:45:13 -0400 Received: from mail-by2on0087.outbound.protection.outlook.com ([207.46.100.87]:4307 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752401AbcD0OpH (ORCPT ); Wed, 27 Apr 2016 10:45:07 -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 01/18] x86: Set the write-protect cache mode for AMD processors To: Andy Lutomirski References: <20160426225553.13567.19459.stgit@tlendack-t1.amdoffice.net> <20160426225604.13567.55443.stgit@tlendack-t1.amdoffice.net> CC: linux-arch , "linux-efi@vger.kernel.org" , kvm list , "linux-doc@vger.kernel.org" , X86 ML , "linux-kernel@vger.kernel.org" , kasan-dev , "linux-mm@kvack.org" , , =?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: <5720D066.7080409@amd.com> Date: Wed, 27 Apr 2016 09:44:54 -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: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR15CA0027.namprd15.prod.outlook.com (10.163.200.37) To BY2PR1201MB1111.namprd12.prod.outlook.com (10.164.168.19) X-MS-Office365-Filtering-Correlation-Id: 7594de47-8c17-4211-66f9-08d36eaa81eb X-Microsoft-Exchange-Diagnostics: 1;BY2PR1201MB1111;2:ADnRvAo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l97df/Fm47aqi+d9invCXpB3oCCsPSQuQ0VWkuxPYJTQlgzOsLW2fKwAGprNg0desCG4ivarSnVuLzKZnYKWj65Nc0yBeN5MW8p1T3edkgIjnv5b5etNwqtcQnKC9yW2B7xt/ceKDl0eMG5PahnRoZEcfy+ABCGOeHJqolid1DJejex0+uq4NDnog5HSC5OFTpgZNHwAhKo5bLmZ1T5x+SRxJ0oaJzqrYEQobxecYl+gBk9puRb81yMxvvECy2rNFJT7Wps/2UJwZeRKTvw13j/dQ4OWmGQ4hKohU5CMEBnOCGX0Cxb6GavmutjgYx4R/daueE9b5bbnIGIwD6RcGkoiwXWCSFfJOa9raIMVGO1tmCjX5EBNHg09m10LzICnJCYWPMZ1OA3ueLFNc68hlOhtelrdzuskG4Uo3pXuEF5RZWjPsJsl2STzVa1qwna5zuJnK7Wd3cRwC3R1FGv1mlOUJGVBRtStVOHxG0NTyAxHmkFWycRnrd;4:K3PP+nUhbwHRVLTJbgORues6B9jhAY4SjAU3HlKiSMOKE4dfcLgwL0PpWM0FQVtuENxU0N7jAvDmU4lwXi9xQlITxFRlUX5/E++2m/6QFTeP21t111Rp/0nCGKzxTtYu0BK3eMWucgbP0OVsvomW/G/SY2NuYLmvPEbAv1Y4moCrtzz+tga2ZgPgNl/Lh7LRlA09bx2+08nIcdLXQyab+rap4vp2PvSBwes1lKhvSFMeXGRrBttHOBdrGGrUN3ya1huwi+gn7NqR2phSoQcY8REUKo06Mo4BKQnxIteFJro6XaBmhsj6SfokpsAC0WKnQptV+0lmFhfnoAq77JI5Fnpaw4DC2BF5+5d+/mRGs/1IcKa0feuDOQVpCzVKOt0YQIt2CkQMpbTtBcGi60Zacle/mknkGPlQ4HNqMz60RJg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:BY2PR1201MB1111;BCL:0;PCL:0;RULEID:;SRVR:BY2PR1201MB1111; X-Forefront-PRVS: 0925081676 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(24454002)(377454003)(77096005)(5004730100002)(2950100001)(59896002)(33656002)(189998001)(4001350100001)(110136002)(42186005)(54356999)(86362001)(50986999)(76176999)(65816999)(87266999)(80316001)(19580405001)(230700001)(92566002)(19580395003)(5008740100001)(50466002)(83506001)(81166005)(64126003)(47776003)(3846002)(65806001)(6116002)(36756003)(65956001)(66066001)(1096002)(4326007)(23676002)(2906002)(586003)(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: =?utf-8?B?MTtCWTJQUjEyMDFNQjExMTE7MjM6KzdjWWVEdXVvNHdmOVd5bTJGazlMemNU?= =?utf-8?B?RW10a3grTDVtczNZNVA1VUhFU09lMjVlSWhYMTBkZ3dkbFhodjd4bENaTnNm?= =?utf-8?B?K25mdGdOZWpvMEdpb3VsbDE3ZGllcGQybHhjcmlZbnVhOStmU2FCekZ2MG5T?= =?utf-8?B?Z3BHc2NSay8vQTZjcG9sVjl5WTh6SklqaDJPUGRwd1hWVjNRdnYxR0JPcVV4?= =?utf-8?B?L2ZPNHRqNWxEYzFRSEdWSGZqMjZzd21VQktkejFIYjE2blVnLzZRZGFBZ0pY?= =?utf-8?B?WlUvZmF1ckFSWGlvL2dRSDhxOWltcXFKd2FmQ1l6SUViUlhEcUxidHFKdjFp?= =?utf-8?B?R2MzMVdobFBUbDBKZG9IZEdlVUhkNys1bGw1ZmFBTXZXYUpBRU9pMEJwajhH?= =?utf-8?B?cnFzbUlHTUpjVHZPcXZzMkNOUU1oYitIbE1jN0tBRFB3dWJPUEptaG4rOUpW?= =?utf-8?B?M3dyeElVcUV0SWFZV20vMnA0eE5Zb3d5TEVaSklDTjNKK3I0TnBQOWkwMm16?= =?utf-8?B?c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DZj?= =?utf-8?B?R0ZwSW9Cek5mbWRXakhxVWgzQTFoRlhtekZjdkY0dGNTOHQvYzBpdXF3TEhm?= =?utf-8?Q?3YNRmtLOVQWCF/j3kLMOaHXH6zU=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR1201MB1111;5:5xJfRBfqoBie0esr1mHXM2OyKMTO5Vq1wDZYRs7aIYuPdTxt4hEt1486KCkRo7xXVo/LH3zdb/x/hZzR02wjuGhHG2rLdnptTxzOWmsen5sqYpdLLsHQWKkVKV6JtQXQmq4ebSESNd6a4gWdOmLNOg==;24:P4v8J+wyBmmWQ9REv2VTOO7yrFK87yU46TIToFMR+yjJom7rjcacACfzIsS6l0fXefudYLWiZ9xmv1e3XbwId6cVzJ1dkT4y+f4ImI/EPeM=;7:Fu9Up/CW4AMIyYUoklM3a/TxsTDKHV0j4WGwlRmM4bzBZqZNNKlEazVGOy8AeMeE/amD8madUCKt1xY9gJkAvmjZtd/T7eP8PxJPIDm9rm7BsDlHvWNelKGlqhal8Aai/TgdmQw6WNfS2EgGx/lEluzZKKQDKq2SsMCGgjJucoq5uhQxXjQGHpE+GAuhK8W2;20:FmrtH/TCC8jLJ2GWSsLtNTc6THV1lb7tGmHd9VkxFmFhY+iSuXndiIk7lzMGltdLKcHnl3PMt3n3zrVM1cGAkU49WtiungeL3COY97ZtHRb1NlgKTSbwfm+NH2U62W2odOO49b2n+xHMx17C8IT8POC3aeWAySxmd/l79RolnmDM9OXas992h/GjkzguQGpbUEeBtbmDyuWwgu9M8oWeAWbugE8WUwbOZxqG0m/jFU1n6CpANKmDaeRcew5Nlrjo SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2016 14:44:57.8492 (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 Content-Length: 688 Lines: 20 On 04/27/2016 09:33 AM, Andy Lutomirski wrote: > On Tue, Apr 26, 2016 at 3:56 PM, Tom Lendacky wrote: >> For AMD processors that support PAT, set the write-protect cache mode >> (_PAGE_CACHE_MODE_WP) entry to the actual write-protect value (x05). > > What's the purpose of using the WP memory type? The WP memory type is used for encrypting or decrypting data "in place". The use of the WP on the source data will prevent any of the source data from being cached. Refer to section 7.10.8 "Encrypt-in-Place" in the AMD64 APM link provided in the cover letter. This memory type will be used in subsequent patches for this purpose. Thanks, Tom > > --Andy >