Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751940AbdFHNnV (ORCPT ); Thu, 8 Jun 2017 09:43:21 -0400 Received: from mail-sn1nam01on0043.outbound.protection.outlook.com ([104.47.32.43]:39526 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751422AbdFHNnN (ORCPT ); Thu, 8 Jun 2017 09:43:13 -0400 Authentication-Results: lists.xen.org; dkim=none (message not signed) header.d=none;lists.xen.org; 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: Boris Ostrovsky , linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, iommu@lists.linux-foundation.org Cc: 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 , Andy Lutomirski , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Dave Young , Thomas Gleixner , Dmitry Vyukov , Juergen Gross , xen-devel References: <20170607191309.28645.15241.stgit@tlendack-t1.amdoffice.net> <20170607191453.28645.92256.stgit@tlendack-t1.amdoffice.net> From: Tom Lendacky Message-ID: <4a7376fb-abfc-8edd-42b7-38de461ac65e@amd.com> Date: Thu, 8 Jun 2017 08:42:51 -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: CY4PR12CA0037.namprd12.prod.outlook.com (10.175.82.151) To MWHPR12MB1150.namprd12.prod.outlook.com (10.169.204.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR12MB1150: X-MS-Office365-Filtering-Correlation-Id: 1aef7255-f838-47d7-12a9-08d4ae744983 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:MWHPR12MB1150; X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1150;3:2YRfhBK5IEf1n5uw+2EysruMV2aw7H6CWH4MjbcCFI4A5mATm479LFnOwpk7mEo3JMDQFzKcO760Pya6IoMudLqrvrKH9CvMt8rNnvrH+CeAEZvpey2SBInfKlqFM9v71bo5LolafBn/vdT/WCXS2WRTiwrjqdar7wD/udm9kwlSfJN5my6tz2pjL34jD9H0sq+Ed2dLVa4CL2S8zLbOkne0UYpn6DwVfcGbj5WSZw3IunPVzoKYNsl9Wk7AAqtVXhoGpGWxNgfWgQCAvS0LoDqsfqYkvTBJeGJzy6kEq/14PJmSPbV8W6ELQwY5ienaX8S5UO5Q3n1rorumZIuhaF6+dMiOtQLkg9KoFxnsSlw=;25:fHswKxIe6ug0Q9494YrNECwutFyx11DkqBIb7Wk3wlsw83Iw07c4uH+25ZWJXo6TU2hl2GKZ6PYJdLXDTOxGNLNRMjhjvCw9PpdDNPgcZq1QHQbpgPxfo2GGcGXedM2JcMVtw8Y4lg3L/U7pzZGHcjOCaoeAMO9ZRDSWHPjYdgwZJA5AWHtlJ5toh47hnj50lsBerznUGZi1XOei/HQdZfcXrK2b7CohmRoSFOQyuOl3uTCTevrrhgubP0H7p/vVB2eSAhO0ZfaSKltW1yZIWW6tgTbkPoen+3Kl8cDcZwBVJhpphBM02tju0YCVID8AvyZpvht4+1rqwQwdC8QJI0BIEe8VEpDk7kbaKBWJQ7wJCKZrcSg3crkyh//LGgdvM58bVCTqAXJdg1fy+3q2WjBt6+4pmY66HY5h+2RG/ubXAcxoa+QXIwcX1jv7Epzdy/pP6C1hND8yo/Ijp1YdD8Ojfxj7g9HgzB7MGcFLqXc= X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1150;31:8mjsIJcdiotItqNmbKvfV6i3ZzkNpXSH8pw7eqBhmwakeEPyE2PnvB8zll3kZreKtSDLNLXcMvS4sNaVnwUAwBAY4VPrq3ZTji8oI7w+okTvL+0NqgnvZiT32H3n8k2RUQoojWZN45dIdcBRtEGSA1myWYRfYV2vkBP4ir60LtKstiBWakVavemkknfxAFW6pCH/mLecEcuvrihWiTcCX7Pkx0wPOyR6GB6uF7UlrFE=;20:XiFGoRkn2AQltkzWvIH8dmQg59RIN6jwNsWUzqzkDKbsoSGiKChvWUbvYWDp+DU+vJD/8hj96IQFH7jqlxrDBJQ5Vz0GNxWtJE1Mi1gHkaPT7rO2mnzh1GGXslQrCua42qbjF1LUPL5PMCwwYZ89uXSsD2K4X9OO6knKBbxf6cT2+Q8GvR1SiGYx8DQNUIRHrI6U4b6UQBLjUiJibpzrbRlhqu0r39GkueO138SXs97QtNbzz+XdVsv3qX33a4/5RnPLhN8p2agRMyHU3K+eCVzIbZMsmDP0Hc/miL3NFnXXvyl24Z5Aw0fNnRn4lUl/CFm942FJ2W5t+fHZKG4JkzU5AwMBmlS4vkh51ghLYnJkGgylel9v8e6Uzmehbp1sUvponUbDNo/BlO+qTuj+W6IbpyiEQiicLXz6ZmoPBusg3N/I6I4WKbI8t+nZZt0b3SQk3NY3zRHCMGEK58Lk6HfuqWFhOF38g4bchvXY797rb2XgPbFo8pBK26aOUXvF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR12MB1150;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR12MB1150; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTUwOzQ6bjNEOXJaV2plaG5JQ0xvMGYzdG0yc3FqOFFI?= =?utf-8?B?UzNuWnJycWhXam1Uc3Z4TGM2ZXJrUVV5c0NMb1BTT1piY3Vxa080cmpmREV2?= =?utf-8?B?SEhGZlBjaU1nUy8yUGVLRzU5YnN2S1BvaEswUlp2dU5JZm4yeWZZOFdqTHdm?= =?utf-8?B?NHlnNjN4SklSMmlkR2FsdWZXTTdRd3Q3bFlLbzM5cDhwUU1rQzVHNlJZY1dr?= =?utf-8?B?ajFlNjJUMG95VUR0aXYwSW1TZUhDRGhXbjZjM3ZFVDFYZ0xqeCs2SVgzUEpU?= =?utf-8?B?dktweU9uRHpQUVVsVXNVeWFGdGlmTjM4eDRBNW5vQTN2WGJPWWhMa0loU1lF?= =?utf-8?B?Tmw2ZnVxSUpneDBkeldiazRuTzlUY0ZBZ2ZDQ2tKOTVKbVBsRXFxUmhRbm0v?= =?utf-8?B?WUU2SGZTZ1ltbGM1T3kyVDFLc0tWb1pLR0ZYRmN1dU9kR29WeHRkOU05Umkv?= =?utf-8?B?OW1EYnVRNzJqYXB2MVBKNTgxQXJVOXVWcTBTUTlaNC9Va1FlR05ZMlovYkZw?= =?utf-8?B?N2svK0VDWE81UC8xekYxRzBDTDZ4ZkZvRVJQT2dzaWNWSERDVW1pTTBlci82?= =?utf-8?B?OFdWeWRmQzh3RngrMEpoS3FRMVEzTU44SFo3WDNlK3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UnNsTDFXcHVNTnNTZUZ3NXZpbGFoSURR?= =?utf-8?B?aFVTOWRRd01GYWwya3FoODltN2NIMlJjRmVDcXNKTTBKZktVcHRJODFjRzBt?= =?utf-8?Q?fvfP/xAUmOHWv4gQND3?= X-Forefront-PRVS: 0332AACBC3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(39840400002)(39850400002)(39860400002)(39450400003)(39410400002)(39400400002)(24454002)(377454003)(36756003)(23676002)(229853002)(5660300001)(305945005)(64126003)(76176999)(72206003)(54356999)(7736002)(7416002)(478600001)(7406005)(230700001)(50986999)(3846002)(2906002)(86362001)(31696002)(65826007)(189998001)(110136004)(38730400002)(6246003)(81166006)(54906002)(33646002)(8676002)(53936002)(6486002)(77096006)(4326008)(6666003)(90366009)(42186005)(65806001)(53546009)(25786009)(2950100002)(65956001)(66066001)(47776003)(31686004)(3260700006)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR12MB1150;H:[10.236.64.250];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTUwOzIzOkJabEx4N2FjY3ZraTlCQjQ0ZHhCWGphSDJ0?= =?utf-8?B?dU1PbzYyQy9RQmplRXFYQWFONDdGc25CT2xNcGxYeFYycjJ0TG1DM29kUUR6?= =?utf-8?B?WFBSbVY2TU9STDc4aUozRmhEUEF3UWRoRDV4YlpTd1gzVUFWMkdSaE9Lb2pW?= =?utf-8?B?ZW9lcEdKc0g5N0dZT3dVR2dpQmlPdGg2UXJvd1pxWlRGVytVWk9pcm1WNi8v?= =?utf-8?B?SHFJUG9HOG1IWlFNM1k3WEpPSVpzVFlIWjhyY2J5bWhJY0dobms3Zmh1TlA0?= =?utf-8?B?L0JJbjdFaUVhRnAwbFdXakJMUWt6NS9KNXJrVm4zR3cxdVVXYks2dGJCUjBw?= =?utf-8?B?L0QyVnhETmo1S2hHcmF3TGdKODY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YAToPlLpeNvw3Prf15a3FIce85WZ8dyefBS5IBivPfaMWzBCk5tQ7gL/A7c/1hwEQLMIb7lMJgYDcOXTHW4+4NwHsKX2TJMcZn++rSsiQZ+tHTB3vUv64D2U6FYBT6xEO57g9MSXRykfxoKBRUdcrK5XKSry//NRwbU+pofkd169JhVSEHgDHrozufHLQZDj1DULIO/UTQJF7nSlZLuR9qgV+3Anj2wk51aiLf3oq8iVgTqkg2eTz6Gc= X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1150;5:9txHAJDX/e3ppj/zOQcgBq1OzPglAGAdR1f7KsjWqnoMmQCmPabZAcAVIoVHoqSzwEx0H5hMmtTzppc97jOaa7qGlOR0z9r7DbKpicIl5jKK3K4imuRJWqFe9FKzdnOVebLwMLZ0qGmdetIxSMGfYZQ7aUyLY1xthW12OTm6Egbsge3kdv1CYwO7ni+g3C27HNe3WAV/1cUgJupmWP17t2jsjLYc++hMk06Rw3/XCAzHZ69Vt5H4Yqhpp7T5bqxThHjrdYswGKJPuFmgWV5WIwScx+0Iha24igDLK87Yo4Uc+0KlBBUf0tVsuvCPMsLztfgoy1UfuO/HfyM5AJWAPHcqLAACQW1wvdGIxEKE2o3n6h17Azgelamk+ZrhOV0x3Ptl4K4XPLYfdywR2emMsYYSrrKTdW/a+2Rple2g730uY5euFHn7PEWOFeS/3+WORLDPAmullZowhhMfxUqKTI7DeE3CBGA7c9cjEl48gaUzWR5ZKgDr5D7gErtlvM25;24:/kG783KzZEO/G0wjYYEGwN/C28ddCsD24P8OcrWKII2lVxoFJEbxifqF3SfjI/B1pyAsVVqkKon404DK1gpQe8WZTcqWnhu1xTTZFiRnD2w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1150;7:1GJgC9KJo1j/xf25Wht19V7vEgcF3Owg6OuowRCYgfTyp1Rc5p6ObRbwGFE9TSeSgrU13Uvz3Fx9Q0opYVUBa2TXqHlddC2Tdw/MYK+LxGtUQ0UF7YEOEIq4/VyIhIHk2aQmH/RhtTqLLK3blZwMjWXyJgaO1HF2Z1qp5UnjiFygrNVwhkhuSSuy5Ve4e22+SMh1PkKKWELniiphsWGc5vjfQQ4eOis4YoYFD5PzqdkgMAFGJfydr6+10cKhnQBfmL27myk0W2m0j6cnlrSe9ZPbgc8BYjSIpJp4mbW+Zu2CsSdv2kGJ74X9iB5DcoPOJDR63DD5HGwZ5IzyGVS8HA==;20:1rE2O6Wy8qTts0T7wV34UlHOtl6RE7BydLJDEL2K6+u1j/kJVW6oQ2mjscPiHvY4g/gcbf2YvDiFllHELNS+28v3j2uz2mlO9WIZAhxhZj80xEQEzcEJhaz6Q1gAhjtcqEAFcFU0t3uehwJsS6OvNrxa+oP9DjGBwmxDmFqWWTylaEPyUE53gaiLMP/c7jpqKh7m4E4ZRfxgHL5lOF96B23AL2eBxxAo26LhHbOiFtCinxaRL4U6t7Gov1WVlOlp X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2017 13:43:01.4786 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1150 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2704 Lines: 79 On 6/7/2017 5:06 PM, Boris Ostrovsky wrote: > On 06/07/2017 03: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. >> >> Signed-off-by: Tom Lendacky >> --- >> arch/x86/include/asm/special_insns.h | 9 +++++++++ >> arch/x86/kernel/head64.c | 2 +- >> arch/x86/mm/fault.c | 10 +++++----- >> arch/x86/mm/ioremap.c | 2 +- >> arch/x86/platform/olpc/olpc-xo1-pm.c | 2 +- >> arch/x86/power/hibernate_64.c | 2 +- >> arch/x86/xen/mmu_pv.c | 6 +++--- >> 7 files changed, 21 insertions(+), 12 deletions(-) >> ... >> diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c >> index 1f386d7..2dc5243 100644 >> --- a/arch/x86/xen/mmu_pv.c >> +++ b/arch/x86/xen/mmu_pv.c >> @@ -2022,7 +2022,7 @@ static phys_addr_t __init xen_early_virt_to_phys(unsigned long vaddr) >> pmd_t pmd; >> pte_t pte; >> >> - pa = read_cr3(); >> + pa = read_cr3_pa(); >> pgd = native_make_pgd(xen_read_phys_ulong(pa + pgd_index(vaddr) * >> sizeof(pgd))); >> if (!pgd_present(pgd)) >> @@ -2102,7 +2102,7 @@ void __init xen_relocate_p2m(void) >> pt_phys = pmd_phys + PFN_PHYS(n_pmd); >> p2m_pfn = PFN_DOWN(pt_phys) + n_pt; >> >> - pgd = __va(read_cr3()); >> + pgd = __va(read_cr3_pa()); >> new_p2m = (unsigned long *)(2 * PGDIR_SIZE); >> idx_p4d = 0; >> save_pud = n_pud; >> @@ -2209,7 +2209,7 @@ static void __init xen_write_cr3_init(unsigned long cr3) >> { >> unsigned long pfn = PFN_DOWN(__pa(swapper_pg_dir)); >> >> - BUG_ON(read_cr3() != __pa(initial_page_table)); >> + BUG_ON(read_cr3_pa() != __pa(initial_page_table)); >> BUG_ON(cr3 != __pa(swapper_pg_dir)); >> >> /* > > > (Please copy Xen maintainers when modifying xen-related files.) Sorry about that, missed adding the Xen maintainers when I added this change. > > Given that page tables for Xen PV guests are controlled by the > hypervisor I don't think this change (although harmless) is necessary. I can back this change out if the Xen maintainers think that's best. > What may be needed is making sure X86_FEATURE_SME is not set for PV guests. And that may be something that Xen will need to control through either CPUID or MSR support for the PV guests. Thanks, Tom > > -boris >