Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752050AbdFHWix (ORCPT ); Thu, 8 Jun 2017 18:38:53 -0400 Received: from mail-co1nam03on0052.outbound.protection.outlook.com ([104.47.40.52]:23520 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751524AbdFHWio (ORCPT ); Thu, 8 Jun 2017 18:38:44 -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: [PATCH v6 10/34] x86, x86/mm, x86/xen, olpc: Use __va() against just the physical address in cr3 To: Andy Lutomirski Cc: linux-arch , "linux-efi@vger.kernel.org" , kvm list , "linux-doc@vger.kernel.org" , X86 ML , kexec@lists.infradead.org, "linux-kernel@vger.kernel.org" , kasan-dev , "linux-mm@kvack.org" , iommu@lists.linux-foundation.org, Rik van Riel , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Toshimitsu Kani , Arnd Bergmann , Jonathan Corbet , Matt Fleming , "Michael S. Tsirkin" , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Larry Woodman , Brijesh Singh , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Dave Young , Thomas Gleixner , Dmitry Vyukov References: <20170607191309.28645.15241.stgit@tlendack-t1.amdoffice.net> <20170607191453.28645.92256.stgit@tlendack-t1.amdoffice.net> From: Tom Lendacky Message-ID: <85355c4c-2cc1-daac-d8fe-ac6965b34606@amd.com> Date: Thu, 8 Jun 2017 17:38:18 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.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: BN6PR03CA0035.namprd03.prod.outlook.com (10.175.124.21) To DM5PR12MB1148.namprd12.prod.outlook.com (10.168.236.143) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR12MB1148: X-MS-Office365-Filtering-Correlation-Id: 0dc900a2-b358-41ea-5d3c-08d4aebf131a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:DM5PR12MB1148; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1148;3:yZVxeLWZ7rIMkjXTxGhU7Www6ydEFEhdTWG2osU9Dsa6LkqvGErs70+yE5HXfhvR2PWbdjUlzFmghPXW0iARp+Tfu2P7zt75vjFNZyKMd6UXWuO3zAnHZRxuk4IqkHQuZPGN0ZVwiDyYJrAiTlCC2UqQBhaaiIZ73+w6sRQ5PrVde7r8CwMlectSTORKFwgGBMo0vS/81qbqChIHkjhkn1Vvyf+RA2/WjuMefvyG6jK7E4AhMdo25BRLiaUrFD9CcbrG0ICdEBsFuyy8LUKX7Zu8dmgF7GUwYfMBzdbW/qARGy1YO7KfPY4pdH7lNLKep+6XErluAYCKSCHcj7KhXK23HMV3Tt9sBiVSmSNc9/Y=;25:5L529QEsnhHHu0RRRPY/Lw4fD+qyWY1uSXXLD/anbcxQmUk2vOnlr1dU+m57Gj5L/JW5LEthv9yGudFPG1H2ZYprbmNgA8DlUxS2uwnW0qXIcZp2v2lzBTZ2a1ViCYzGoZ7yZjwg5PNbH0pdTHW/lLyitp+Di/LeUdXbNJ4gGukSVdkHwCgMeNjaCxbjT4HXK92Z7o3LbCYnJkFovDPcv030UZw7NfVwE94q8yyeUwsPEEbj4lkL/y3rDmmtoOWge2QFdnbEl6JjWSLoCz2M0p24V1FvEy8PmI4T7QhhvkbZ3M0FLZCeQQAiwoM/E+CbnrNY18ACH6N/TWKRTElHipALpmJVzmyC3mZziiiuvPoWCP0a/QsqzWwb0fOoNbZ4aV8PEUjkUBtQ6gbcKh07iuUIHvCGX7wBcyhxlguCINsNEiwVTB+DY+/+fAavZIjF1V9iOrOobDHRdoPHFnozpygQKcFzCIje9ymTUF7Q3r4= X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1148;31:1avQTr+IAdFH9ahtB06DJUceZgkwzPdxaojzq9yi+RsFrKO9igxCg/cp6W0odZHVIk7C8ltgbXnnDipGhZde6zLvnGNn9wWhCHLXDRFsQ5j22/q2er75sdf2K+apuTq6cq+pbdqGPziwvjcRa/K0+6/qABDdXTmTD70U63V1m5K+4RWZH/dnw+qHvS5DxgzVpUE0VOo6Q42WOiBqyNw5qFbxd3IcTQwwIosjqH329p0=;20:5Qchbs4NGx2ZzCKjNw7csAZhHxITD/MDHXJIXB3czuK3UReYLB/e01+l5yyF215p92WTW6yVfiOH2Y8+qc5UuuWUJ4GidK2ceh60bgm9sIsXHLN86sbwp/s64PFLH9Ab9I5Pohrc5kYh6w+XT0vklvC9VzM7nINXx9A68rK9+tsPOHrtNsugXmcwNvUuUKhJmWN7aSG+jXp0Co+EukVZxEPaDZmQvik/HuZRWb5EmqIhk5OFqfk4lcJ/0yCnVV0gCfgKdLMzKRT6knXmwppI03gYzabTdH+MAfU2ua8naTM0f8u9xUbg4mUdMIZinlTBtZjrIkjIc5fvAPt1R5JfdWHatuwhYuYEGDCc+pmPY1vjim3fk/WQKqnsT5mfPy36xrZZv8bk0A7/u3ygUiWNyVAZcg4W22590qnnBD4yTPsMPBkg8wSfF6/8Y8SIYSjX+XNEGEcDF5pJ4Z+ICAseVHx3wTIqtey/XPmImAkfhN3dsAo0F3VFNxbTE/M1HyC9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(84791874153150); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(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?MTtETTVQUjEyTUIxMTQ4OzQ6Zm8zajRhNnhkQnRWWjNoNXRobG5wNFdSZkJB?= =?utf-8?B?NTl3UnlMa05UWExDN1MvbmdLYTJsWmNQSVc3RmhrZG9oM3A3RFNDbmZPQk16?= =?utf-8?B?Ti9haEduY1I0Q0NGMDloMzNBYlVZQk1BbDlOelVMNlVNbld0RVB4QldFWnV0?= =?utf-8?B?akhka0NiNGtwTUlJVkVvUXFWTzJpZ1VWcnVlY3Y2WUp0cVdyUGQvTUV5SnFF?= =?utf-8?B?YlFiUnRpUms0b0ZMY1VSZnpQVzNMR2h0ZzdCM0I1UE8vZmJWREk2OHBTT3Zt?= =?utf-8?B?cGxoMktqaHcwZndxd01JVWplS1VqL0t1blhrTjBuNEtneW9ZWXo1b0RnTUJG?= =?utf-8?B?WW5PS1ZpeXRTQWcwZzE1aE9veFdhMDZOMGgzVUMwckp4ZlQ1RWxNd1VvTnRq?= =?utf-8?B?Vk5zZTB5aU1kbmpyT2VMVjMyZUJlR0pncURQejA3bmNYKzJGZXoxcDlUKzB4?= =?utf-8?B?a1MvbHhXVGplRWM1L3pHL2p5MDc2VUx3bHFnVzBJZ2ZmK0lkOFRUMUxwVi8w?= =?utf-8?B?Ym52RHRIZjRHR3JSR2dSNW44RlFxWFJ0WXprajNGS2hyVDN1Uk5WelFYeDdB?= =?utf-8?B?aFdTU3BYSFh0TmxBQ01iUEpjSEt6SWpJT241YUwvTWsxOE1qbThJRHdHbVFr?= =?utf-8?B?SW91YTFiMlQ0bUNIbmVN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8?B?QWoxYnVyeEd3ckpMT3VjWE8rM1ZkTzhQL1hNSER2aXlnbElPakVlSU8rVGs2?= =?utf-8?B?UFBoTTYrU3dyNDV3R1pvck1XYUFSdUlsSlVwWnY2VmE2VHJXK21BZ1ZtZjc1?= =?utf-8?Q?uEIGYq+SVE/IFg1b0=3D?= X-Forefront-PRVS: 0332AACBC3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(39410400002)(39840400002)(39860400002)(39450400003)(39850400002)(39400400002)(24454002)(377454003)(47776003)(54906002)(86362001)(31696002)(53936002)(90366009)(6486002)(8676002)(77096006)(230700001)(81166006)(33646002)(6246003)(6306002)(38730400002)(110136004)(64126003)(65826007)(3846002)(23676002)(4326008)(229853002)(53546009)(54356999)(50986999)(76176999)(3260700006)(189998001)(25786009)(6666003)(6916009)(2950100002)(7406005)(7416002)(2906002)(478600001)(305945005)(7736002)(65806001)(65956001)(66066001)(5660300001)(966005)(36756003)(42186005)(72206003)(31686004);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?MTtETTVQUjEyTUIxMTQ4OzIzOjMrR1NxNG1KcGY0ekVwTkFjT3c4T2RyRXBY?= =?utf-8?B?Z09CUm9FQVQrOU55T0dKYStic3UvdWZyL3FMS3cwSGRqc2RGWkhzbDh1OUxq?= =?utf-8?B?RGQ0NDdzUlhMWFhqbkZDVmNHNGF5dW5idnlCaHFhUnc4QmhGVmIvTmxUdTVx?= =?utf-8?B?QkJVbUdVT3Btb01Ed0dWOWlyaldPQUhxL2poQnRyWVgzRThFM3pEcG5tQWNI?= =?utf-8?B?SG93UGYwZ09CckRmYU9ZYU5DOHBjeGh0ajJqc1l3cDdFYXVCdWhPNy9hWW9C?= =?utf-8?B?UDZQQXUvdllpRzRPem8vMko0U1JwbS9qTnBIQ01VL1RlVWFQVmtzMFNp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hqGVaH/ndzNrH5+29C8+1TB4MPkguT6sdjf9fk++ymx0l0BHNQY9onpjb9fsyDGmfB3syujPfls67aalJUrElDACbOftFdW/o+3egMEC6VpFMJqEx5DT/RCzk8UZG1XJs1JHRpqhya/gwEJMHeJ1oLmwxYagWSqSmZo8RIsIO7xYC17cAh1d0bJpfGkqj0+wSHMg+pjPYYJFFB7eicxHvNBpmyc+cnSE1BmolOuE3crspTLUpNqCZPz+Gomj10b4lTW8Wv01Vx19wLDIYXOY9e5YUiStJHCZxh9q63W+IKaswrbxvda462U5ih288KqO5RwmBbV+ZCU6A= X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1148;5:2OrmTRpG3KnKd54RG2rkX/jnTxWIf/ciA/c+ckBeA1KwCf+Ui+CacYVTINn6Fwp6U4uDbawZzbfiFOga9YLRMr2Mx1n9HroeFbsCUCA+ah+GG3WMezAKYnRkSboqS57p7j9IxDlJT1x7tXtLAvsKapm0lHzKbN41FwaxlkCkhvDIyvM/VpqqYF7FE4QHy/gRhcHLMxmEEQZan9imCQ3VeNIqGdxJ35I08DOhaChKjaroAh1wCmmQy+YIMpkvwd50PycnEpEKKbzYjWI6loJgbs6sm2XoOz8XXQo7gRB5E3kx7yrBMZT+PdAYyZJjk+o6IBJkUDDooW08fdjr8Ogq5jKSqpHL+AExpErXXUMxRTOylfIgFZC/tvSUfYldmvUUGb4S93ZRVPyzuHhLiadyMxvUpOWZ0uiXuvGHDkTsn2anqwcmq5vV/z/EmHxvWAK6XUt5yLvRoeKt5vGVEN3nXkP4FQzLTWTnWSt2DJIwyPel4ApA5okYUikA8fcN7B0n;24:TG/8S6xbwQ9zQi4SYqv0/JOlFyRWWwsgIZ227Iif2YPUEPALmUww9MtEgq0bmlXSBHy4XuJm0mYqkbFcfQPxoTJF0r5AXSAV/gXIH3OVZ/c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1148;7:BBKrVmExN89eEFvik3afI7d2Ji+09M8/vnVocbz8D7VOumLlt0yRaYgqjdNv+l7t+crREsXAYdLp5zyhZx0+mNelGmkMO7Un+uiFlAt1naeyZ2ek5stW5EOpYP3nZsz5h5seoFrBtJe5q3wPBr4KOoJSX/CtKwesTNWSmNtDu3a0nz3QGrqukB7khJBA/QzygT2MT/Tp5kNa96VKr08RgQsQQFRGH2tt+q5djhdukSLbfLyrm7O+MCDEM9iyc4MZB7F+YGg/A1ZWqbzC16rjsqULLAV1s6xnj9YesOIsgwE9SRhlNG7xsCP3AKLO7IWX4FgZgVRjvqNUbbCV85Du5g==;20:/1G4d5Ph2koH7klrY5Q3u/0jcndNb3CIxKCU3pBOClqiiI8PuaBI8GIL+O+4dW3QtpmNX6ABWlmd67uZp9Vag1mYYroCW0IBBHduO0ndHOe/HIiFi2y9L7wVGRcIFOynvpJ54zGpUmqjnYozCdR+iVMfdN4C0WczR2o9X41HFFJPMApvUHgidO3k3NNkvU7QwTOUIpwIIPZdkolS3Bpdujrgr1rcCNR1ArsgjGYB2XxSlklaRNnv6esvOtUi8y2W X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2017 22:38:22.1581 (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: 1787 Lines: 48 On 6/8/2017 1:05 AM, Andy Lutomirski wrote: > On Wed, Jun 7, 2017 at 12:14 PM, Tom Lendacky wrote: >> The cr3 register entry can contain the SME encryption bit that indicates >> the PGD is encrypted. The encryption bit should not be used when creating >> a virtual address for the PGD table. >> >> Create a new function, read_cr3_pa(), that will extract the physical >> address from the cr3 register. This function is then used where a virtual >> address of the PGD needs to be created/used from the cr3 register. > > This is going to conflict with: > > https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/pcid&id=555c81e5d01a62b629ec426a2f50d27e2127c1df > > We're both encountering the fact that CR3 munges the page table PA > with some other stuff, and some readers want to see the actual CR3 > value and other readers just want the PA. The thing I prefer about my > patch is that I get rid of read_cr3() entirely, forcing the patch to > update every single reader, making review and conflict resolution much > safer. > > I'd be willing to send a patch tomorrow that just does the split into > __read_cr3() and read_cr3_pa() (I like your name better) and then we > can both base on top of it. Would that make sense? That makes sense to me. > > Also: > >> +static inline unsigned long read_cr3_pa(void) >> +{ >> + return (read_cr3() & PHYSICAL_PAGE_MASK); >> +} > > Is there any guarantee that the magic encryption bit is masked out in > PHYSICAL_PAGE_MASK? The docs make it sound like it could be any bit. > (But if it's one of the low 12 bits, that would be quite confusing.) Right now it's bit 47 and we're steering away from any of the currently reserved bits so we should be safe. Thanks, Tom > > --Andy >