Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751823AbdFIS7d (ORCPT ); Fri, 9 Jun 2017 14:59:33 -0400 Received: from mail-dm3nam03on0040.outbound.protection.outlook.com ([104.47.41.40]:40850 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751584AbdFIS72 (ORCPT ); Fri, 9 Jun 2017 14:59:28 -0400 Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=amd.com; Subject: Re: [Xen-devel] [PATCH v6 10/34] x86, x86/mm, x86/xen, olpc: Use __va() against just the physical address in cr3 To: Boris Ostrovsky , Andrew Cooper , 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: Brijesh Singh , Toshimitsu Kani , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , Jonathan Corbet , Joerg Roedel , "Michael S. Tsirkin" , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Dmitry Vyukov , Juergen Gross , xen-devel , Paolo Bonzini References: <20170607191309.28645.15241.stgit@tlendack-t1.amdoffice.net> <20170607191453.28645.92256.stgit@tlendack-t1.amdoffice.net> <4a7376fb-abfc-8edd-42b7-38de461ac65e@amd.com> <67fe69ac-a213-8de3-db28-0e54bba95127@oracle.com> <12c7e511-996d-cf60-3a3b-0be7b41bd85b@oracle.com> <9725c503-2e33-2365-87f5-f017e1cbe9b6@amd.com> <8e8eac45-95be-f1b5-6f44-f131d275f7bc@oracle.com> From: Tom Lendacky Message-ID: <33f20df0-bf71-bd9d-7a7e-4fb5e8793400@amd.com> Date: Fri, 9 Jun 2017 13:59:21 -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: <8e8eac45-95be-f1b5-6f44-f131d275f7bc@oracle.com> 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: DM5PR15CA0023.namprd15.prod.outlook.com (10.173.207.161) To DM5PR12MB1145.namprd12.prod.outlook.com (10.168.236.140) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR12MB1145: X-MS-Office365-Filtering-Correlation-Id: 4b40e120-f965-4ee0-c114-08d4af69a52d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:DM5PR12MB1145; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1145;3:n4u/nWA+dSJrk3R7U8Ora7fd1+/pqVNW8tk0avMIXhucWaIPJ7KCut0INfln1GVtdPa/Vh2B3mtVgpDMdDgO29n4a9ttUWFrBkt3OBjCZFV6zJLuBnf2U0QorWQWYlwi+oERQZUp9qFx98kUqr5VpYNq52Xe6dcRx6eBqGSLk5CWIkrsqGKwo1oShAAqhmmifl4Cot0UUyPE+3IByCEidICvsbz1yNHWpdVuo9UAtVKIH7iuc2DS86p7qJ2WU41xtb4pyJOMkpdxEMjk0gydb+CwhWebdCjUPF4HK/hcul/bJMAqO76VmrVffeP9aHospn43UuDwFETwjBJT90P6QVONDLWRTE0ud+BTWmIBZBI=;25:N1eA+0fbHet3RPov8+zgVvLDK2NpEvf9NMEomIKE3R2iIi9kWV/pv6sXzTFQo4N/ouOj/PPsdu2YSNyv/9jzGDJM2r2DmvILGTbzLEFqxr6YGX8eF5UOBnG/n3AGx/R9HCxdgaBFbMQytJ7C2x9XQ7eBU3F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A/ITtpIovETvAB0zXiDOSxRKmbsUOBvU6r3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1145;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1145; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ1OzQ6NnpoRkM0K3ZHVEJWNVJNZ3Bkd3BMQTRKazdD?= =?utf-8?B?M1NuaW1BV21IR1RvNDU3MjZqYXl5R1BNVTBtL3dRVkFCQXpMM3p4ZksrRlpN?= =?utf-8?B?Y2dScjJjd2g2R0lXSWF4NTBneHBzckJUOFJhL3UxTUljajVQR0ZSUC9rRXZr?= =?utf-8?B?V0xLZ254ZGVCQnRjeTVJWDFITG10cElIK2l4OCtOeS9pVXlWWTM4ZDFzMDVl?= =?utf-8?B?TVArdU1abmpld3dEUk9GNlIxd09HbHM1citTWjVwSmUxSzVRbGk5NUk2Uk0v?= =?utf-8?B?a3h0NVVhb2FHb0UrRUVITHo0SkpmZ2xOV29PdjNwalRzQjkzSDlBeExBMDZW?= =?utf-8?B?VFI4dDhGZHZyWmVFRE5lZEZjNXdzMkZNOGtSTkE3M09mWlZxRUhTN3V2UHpD?= =?utf-8?B?akVJa0VsSjdOM0VkMXhuSUJzQmRKWWU5Q3gyLzBvcmkrenh1NUlielUvaTZH?= =?utf-8?B?ZlB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?utf-8?B?RzhkejVVejhlTHEwaTFYcG15Q2RGYWs0WTZwK05FMTlXenYxSG13UlF5a2pG?= =?utf-8?B?TFI2VDVrbEg4MU5BWlRvN2VsZnBqb0dtTm9LV2loZDNOU0VxbUhMbWVFeFhZ?= =?utf-8?B?OUxZWVd6UUNic25rbEl5Z2RpdUhma0c0dStzSllkMHFtUG1aYzk1dG9WSGpX?= =?utf-8?B?TVRZUlhLbm05eDJXb2tEa3h5RGI2TGtRRlVoN2RDSjFpRjVkeXVDSkpCMXhV?= =?utf-8?Q?lU4+ZklV2iYuu0gTjz3?= X-Forefront-PRVS: 03333C607F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(39400400002)(39850400002)(39840400002)(39450400003)(39860400002)(39410400002)(377454003)(24454002)(81166006)(7416002)(305945005)(8676002)(54356999)(76176999)(7406005)(6246003)(7736002)(478600001)(50986999)(64126003)(229853002)(23676002)(33646002)(72206003)(93886004)(36756003)(38730400002)(31696002)(42186005)(86362001)(90366009)(2950100002)(2906002)(8666007)(3846002)(47776003)(189998001)(230700001)(54906002)(77096006)(25786009)(53546009)(3260700006)(6486002)(4326008)(53936002)(65826007)(31686004)(5660300001)(65956001)(65806001)(66066001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1145;H:[10.236.64.250];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ1OzIzOkgwdDlvQmN2S01GTFV5ampBNkc1N2lnVVBF?= =?utf-8?B?RThjWVdhQmFoU2lmM29oV2hTSGtDQ1hPZWRxc0NPazNvc1A3cHNHQ3MrOTNR?= =?utf-8?B?cnBpWWVNZm5iVXpwUncyS0o3RzZiSVZvc09xbHNTeWc1dy9iRlFnUjdLc2o1?= =?utf-8?B?b3hTMTgzTUdOT2V0aVNCbjJ2SW5EbnNVUFJIaGNpRjk0Y0ZreTBmcTNyTHNx?=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zPr//xsey7vxHIOPAtHmwUfjdGbNQr0r86ntqPJs8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1145;7:7ppQPbnbrOvb1/m7izkmZ4MQLSuDVzBZMMSK7WSCkhvuW8r1ApfPSd2DG1QerUb1jz3FhHsQ2GKqfBOYhT8fIMVH+gguiC/7ACIUTPRkitoEed3Wvs8kvLSYDU6yUbOq+HBdHgvzEd9zzRtJldMUcGhnTtvEpZMWGvyIH8Zaes82UFN3XUqcpK8EhfC7sBpRIQ2n2bJUxO71nvnEVndfo9xuC3mv/G4cJs0PWr/BReC1ZUn2MMBG19V978oIMMMaEWEkc4gE7K4GHd3i9TY324UqviJAgGsUnns4uaOwad8ENKOm9fq0pGPYXngP6PxcjJ4A74Yz9XUR+0daf8YpJw==;20:iqHwUtVnDqI71ieEGC5ILjv7cCU0sBcQAum1+HksC0I4OtH2O7BVf9m1pjR4C34UMX5Q7Noy0fVAS79gzKjNh0dmYDkZ5YCm8Ru/zNjC3GP0NboDDUF74McISU7ExwVcwFPbD+MaJKUk5CwTmMVAt3c5QxVfOe3fiJVSmcLkHqzY4gMOZzw8p95nrZW/enRiLtOx40G2TGgOF5TF0qxZMBLZCJNWdS/3X3TRGcyJJlI/VK68z45uZyn96Hqn1ZFx X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2017 18:59:23.3169 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1145 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2803 Lines: 76 On 6/9/2017 1:43 PM, Boris Ostrovsky wrote: > On 06/09/2017 02:36 PM, Tom Lendacky wrote: >> On 6/8/2017 5:01 PM, Andrew Cooper wrote: >>> On 08/06/2017 22:17, Boris Ostrovsky wrote: >>>> On 06/08/2017 05:02 PM, Tom Lendacky wrote: >>>>> On 6/8/2017 3:51 PM, Boris Ostrovsky wrote: >>>>>>>> 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. >>>>>> >>>>>> Only on newer versions of Xen. On earlier versions (2-3 years old) >>>>>> leaf >>>>>> 0x80000007 is passed to the guest unchanged. And so is MSR_K8_SYSCFG. >>>>> The SME feature is in leaf 0x8000001f, is that leaf passed to the >>>>> guest >>>>> unchanged? >>>> Oh, I misread the patch where X86_FEATURE_SME is defined. Then all >>>> versions, including the current one, pass it unchanged. >>>> >>>> All that's needed is setup_clear_cpu_cap(X86_FEATURE_SME) in >>>> xen_init_capabilities(). >>> >>> AMD processors still don't support CPUID Faulting (or at least, I >>> couldn't find any reference to it in the latest docs), so we cannot >>> actually hide SME from a guest which goes looking at native CPUID. >>> Furthermore, I'm not aware of any CPUID masking support covering that >>> leaf. >>> >>> However, if Linux is using the paravirtual cpuid hook, things are >>> slightly better. >>> >>> On Xen 4.9 and later, no guests will see the feature. On earlier >>> versions of Xen (before I fixed the logic), plain domUs will not see the >>> feature, while dom0 will. >>> >>> For safely, I'd recommend unilaterally clobbering the feature as Boris >>> suggested. There is no way SME will be supportable on a per-PV guest >> >> That may be too late. Early boot support in head_64.S will make calls to >> check for the feature (through CPUID and MSR), set the sme_me_mask and >> encrypt the kernel in place. Is there another way to approach this? > > > PV guests don't go through Linux x86 early boot code. They start at > xen_start_kernel() (well, xen-head.S:startup_xen(), really) and merge > with baremetal path at x86_64_start_reservations() (for 64-bit). > Ok, I don't think anything needs to be done then. The sme_me_mask is set in sme_enable() which is only called from head_64.S. If the sme_me_mask isn't set then SME won't be active. The feature will just report the capability of the processor, but that doesn't mean it is active. If you still want the feature to be clobbered we can do that, though. Thanks, Tom > > -boris > >> >>> basis, although (as far as I am aware) Xen as a whole would be able to >>> encompass itself and all of its PV guests inside one single SME >>> instance. >> >> Yes, that is correct. >> >> Thanks, >> Tom >> >>> >>> ~Andrew >>> >