Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1929351lqb; Mon, 27 May 2024 02:05:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1Jvv/ijHgjzE4WxsYYfm0Gyw24SelFNhlqowdoOSjsqXYJpy/0+UI347zWZR4PPHrl2pXtC7WutJQD+0Hf9gpWGtDBreubjeTp+ueQQ== X-Google-Smtp-Source: AGHT+IFpTf2q7RPYAyapgY0xaxqTlhfeU36RN37ef3JU4FArHHD55ANb3kJ7sfjcQ82l8DbDiyrJ X-Received: by 2002:a50:f605:0:b0:578:5d83:baf1 with SMTP id 4fb4d7f45d1cf-5785d83bfc2mr4681556a12.2.1716800753739; Mon, 27 May 2024 02:05:53 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-578659484d9si2777692a12.37.2024.05.27.02.05.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 02:05:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190285-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TafEHwL5; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-190285-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 54F601F227BD for ; Mon, 27 May 2024 09:05:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 254FB12AAE2; Mon, 27 May 2024 09:05:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TafEHwL5" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C683B17BCD; Mon, 27 May 2024 09:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.13 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716800738; cv=fail; b=a0FKClMMYwOLZP2KH99MJN4Fqgyp2oTyx0JR5hD3ErXuFy6oxyFyiIoXS61pbcZj1G1RKMt1NsKJXDLcWTkCfmxQrXOAWl8qJ4MQe6Fc09REMs2kwdNGmlR2q4DL4fPpYXL1UqsWlA0+WVphpdgS/gMGI2YRIWKUORexB1c35Mw= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716800738; c=relaxed/simple; bh=stYkrR7fQ3ZNydyib7bz3G1yYhFC5dEip7Hs0J9+Oo4=; h=Message-ID:Date:Subject:From:To:CC:References:In-Reply-To: Content-Type:MIME-Version; b=Gm393rKeYw2fWKFRNYcIFgloX9wDP+Rzc71Zv+hBp9cHL7mZ2AEwVm6QHMs6wUNYIf78+PearP78FZ2pLZ6hcqNCDf97nb4aMQZpcCNJ+nDhV+shbib/bNj/vhM8J7GvU09UA9KxSUtcRmDxUvRmuwRhDgt2+9p6Pqnbt93Iab8= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=TafEHwL5; arc=fail smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716800737; x=1748336737; h=message-id:date:subject:from:to:cc:references: in-reply-to:content-transfer-encoding:mime-version; bh=stYkrR7fQ3ZNydyib7bz3G1yYhFC5dEip7Hs0J9+Oo4=; b=TafEHwL52pbq7Zo1yMg2i8IKz37XNSpK1nTCPmvgOazBIgH+YKnnUitz pHbDImTEdQMfCK7Y4IpurO4uaFf8h53iTTeRJt3N5wRwaXPLsg31WWAgA EJKpn0jJ0Q/gCD1gSmIHrSvPTZVwyTXnJ0RAtj46e/SORKFK4CyxgZXUX 6NxSgxWw/PAYuDZnxWrNV5ruwSKU+dWsxZKq7tise7Sg8LFO/M0uXK8d8 GeWz22oxuDgjnPb7wnKVmRo+aCOemitncbc6CWmf2Vk/Rj+OBHVG7jN5o 9l/rabgQky9ifzcsMvPtAH38GMJZ2MFyp1fRis6Ktdp/z5NZfEtb/pg0Z A==; X-CSE-ConnectionGUID: 4c/UiUjFRpyhIxX0J8kO3Q== X-CSE-MsgGUID: gqLI8YNpR320IVa843Wq3w== X-IronPort-AV: E=McAfee;i="6600,9927,11084"; a="16051919" X-IronPort-AV: E=Sophos;i="6.08,192,1712646000"; d="scan'208";a="16051919" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 02:05:36 -0700 X-CSE-ConnectionGUID: cletZ3baTx+PaWb5q4MGsw== X-CSE-MsgGUID: AOrlcdsfSDC8CCE0gOHa7w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,192,1712646000"; d="scan'208";a="35176740" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 May 2024 02:05:36 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 27 May 2024 02:05:35 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 27 May 2024 02:05:35 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 27 May 2024 02:05:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QqZbJyOLjxqAagGjuMVFilcmmPunXiLPo3HZxhLq08lqlH9aoS5KFn4jrliQemS3JFsHsftrR0cqllzr2qLGP9kNiGxezN+BJq+ljk9VN93rKfm35POUDiWVIUf2DMbrmo/Wy3cV8fA2OK3aYTFEHkTUk4ELtRXb717aFOrZCImylC79oFxvkfJ1edPeUdT5rl6Jrtc9DKHshC7V9D5YoR+2PF2E95ajCQvXcZn67NnoHLso+zR0chSbfvSXVMf9S2d+U7jTKklPmODQJX7pmxuMXB/LEqnmyh7hJ6/BWyFNAsXQBYNfRBKqURg0YZzWHVw5VFSUIba68t33j7Yo/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=stYkrR7fQ3ZNydyib7bz3G1yYhFC5dEip7Hs0J9+Oo4=; b=fDtWBPG8VCIxydzATkcQTT6eDRDnJ1MZGSpwCXB1HBvA1M/y7nNxAKYJvaCr1qRcUco0BVL6dPsakaZOaUH+U8ErBB+dLa1bI2F7W1vOKnxcMAZXoIcvTIf4PXzQVT4IOhOkP7jc331tDYb4hQ9DdlrHehTe6B6wTjZogJaS7sQPRBxVpeQGHCiWGYRwmJg1AxO/QAhAxIgKV+jONFBdpBD6zAd5pjTff5sKIVIT5MC+8hPHu3aXxqTfDdIkRjXhJjT+tfv050Vaya2SIiSUfLsV/Umur9Wd+rquifhODJssbSxT8r6hFN1LA879XGvqN2Jll4jvXN1lCaxZwIXe5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB4965.namprd11.prod.outlook.com (2603:10b6:510:34::7) by IA0PR11MB7258.namprd11.prod.outlook.com (2603:10b6:208:43d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Mon, 27 May 2024 09:05:32 +0000 Received: from PH0PR11MB4965.namprd11.prod.outlook.com ([fe80::36c3:f638:9d28:2cd4]) by PH0PR11MB4965.namprd11.prod.outlook.com ([fe80::36c3:f638:9d28:2cd4%7]) with mapi id 15.20.7611.030; Mon, 27 May 2024 09:05:32 +0000 Message-ID: Date: Mon, 27 May 2024 17:05:23 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 24/27] KVM: x86: Enable CET virtualization for VMX and advertise to userspace From: "Yang, Weijiang" To: Sean Christopherson , , CC: Thomas Gleixner , , , , , , , , References: <20240219074733.122080-1-weijiang.yang@intel.com> <20240219074733.122080-25-weijiang.yang@intel.com> <39b95ac6-f163-4461-93f3-eaa653ab1355@intel.com> <87r0e0ke8w.ffs@tglx> <07fc9f6f-721a-4b89-baa5-986664ad5430@intel.com> Content-Language: en-US In-Reply-To: <07fc9f6f-721a-4b89-baa5-986664ad5430@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI1PR02CA0028.apcprd02.prod.outlook.com (2603:1096:4:1f4::6) To PH0PR11MB4965.namprd11.prod.outlook.com (2603:10b6:510:34::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR11MB4965:EE_|IA0PR11MB7258:EE_ X-MS-Office365-Filtering-Correlation-Id: e6d14f40-c885-4be9-15a1-08dc7e2c29a0 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?T1JVYzdlRnVNeEt2ckZpWnlIbERmdlZQWXNub05MWVBQbHpvMmV1azBKK1pm?= =?utf-8?B?N09XVHpZT0RDOGdYemZKMnUxUHBFY2ZUNlFsZWZ5WnkxakFNNTdaL0tMM1Nm?= =?utf-8?B?VkhBaHg0YmFTMlEzZFNTSG5WK3J6R3V2bzN4MjhKZURDK3pkMjloU05YS2hZ?= =?utf-8?B?MFNwWnFhSWpCMk9mdUpDYmIyL3k5cnRtSTl1bFNXd3NqSTc4OWZDSlZzMzR1?= =?utf-8?B?dzliQ24xTS9mU2x1OHJ0c0o1enFacHBPMjMxSVRFT3pqVTB2V0VJSTBibG1r?= =?utf-8?B?bzBnREdKeExuVEZIRW53SGF0a3phNmVmajRncUV6T2NvTXFScm02ZzE0V1dH?= =?utf-8?B?QlkyRzBwQmRhL1lLVDNr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utf-8?B?VDg5UFBHeTVna1FNS2pqWnVwSmFqbEw3d3dqZjRnOTZSOVhJRzBiaVExNDUy?= =?utf-8?B?R0RTUktEVVJDaXdkT21sR2RRRG5jVXIrZ3lDeGg5OER0UHNYckkvT21qeElV?= =?utf-8?B?MldyUTZpV3NsaWZRMS9DVmF6SjJyRE8vampNYnVXQlZJODN1UlU5R2J2MTFL?= =?utf-8?B?THJaME04dktzMmJlMitzU201SDBOTVlCRE1yd05JVzg1dStQOHNPTk1jWUYv?= =?utf-8?B?VEJ1Mk0rc3IwbjgvSExLMVBCeGI4Y0NqSENLQlVxVVZ3S0NuRG9YVVZ1bjB5?= =?utf-8?B?WWhlclF6WDdnSGdLckljQzgrVW1IWTZHYk9yL0wwNTZDdlo0cDM3cnUwL2tN?= =?utf-8?Q?kZoeU+3+F5gyoDW6rcxVtOsCauSMC7y0NlQEZYMuoKZ4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB4965.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U05KN1hyK0QrYTZFQnQ3MTlUUk82aXdKVkJtU2tMZGdSZ085cktySnBHVzJX?= =?utf-8?B?T3VxeG5CRmhsUkMvYTJQb0RaOVlNL1VGOVdYdG95YjNnMHJtVGdmZmkxREkv?= =?utf-8?B?Q0hQb1NNbGk3eU01YTFBMFM0Y0tPeXU4SmlqN2hOYWZUbHFZU0tTOUdFTXpB?= =?utf-8?B?RGVQdmI3MHJWTXZ1dk5GcE5IUC9zWEt5M1dqRTlGaExNeThDNXgyRGVJSUpz?= =?utf-8?B?WFF0NEF3VWh0SUFIby93Q01mVW1PYVRJOWZrRmg4MHVpSTVyRnFudTJCdTBn?= =?utf-8?B?NG42T1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xwbXduRVNsdmhwdkJVaERCL1luY1RG?= =?utf-8?B?UWdZSW5abkdkY016cHVjQ2gxWXQ4ZDd3NURaSmFzWE9oWWVvZVoxMjBHaWpV?= =?utf-8?B?bHc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: e6d14f40-c885-4be9-15a1-08dc7e2c29a0 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4965.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 09:05:32.5208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WDlofNSXodiC3aga0MhqXR8ZmBDF7OZ/YMKE3V1LRhuvW4/EMrpSQ7vAYG3qQpnFA59BwVhRBCyS2xV9Ia94ag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7258 X-OriginatorOrg: intel.com On 5/22/2024 4:41 PM, Yang, Weijiang wrote: > On 5/21/2024 1:09 AM, Sean Christopherson wrote: >> On Mon, May 20, 2024, Weijiang Yang wrote: >>> On 5/17/2024 10:26 PM, Sean Christopherson wrote: >>>> On Fri, May 17, 2024, Thomas Gleixner wrote: >>>>> On Thu, May 16 2024 at 07:39, Sean Christopherson wrote: >>>>>> On Thu, May 16, 2024, Weijiang Yang wrote: >>>>>>> We synced the issue internally, and got conclusion that KVM should honor host >>>>>>> IBT config.  In this case IBT bit in boot_cpu_data should be honored.  With >>>>>>> this policy, it can avoid CPUID confusion to guest side due to host ibt=off >>>>>>> config. >>>>>> What was the reasoning?  CPUID confusion is a weak justification, e.g. it's not >>>>>> like the guest has visibility into the host kernel, and raw CPUID will still show >>>>>> IBT support in the host. >>>>>> >>>>>> On the other hand, I can definitely see folks wanting to expose IBT to guests >>>>>> when running non-complaint host kernels, especially when live migration is in >>>>>> play, i.e. when hiding IBT from the guest will actively cause problems. >>>>> I have to disagree here violently. >>>>> >>>>> If the exposure of a CPUID bit to a guest requires host side support, >>>>> e.g. in xstate handling, then exposing it to a guest is simply not >>>>> possible. >>>> Ya, I don't disagree, I just didn't realize that CET_USER would be cleared in the >>>> supported xfeatures mask. >>> For host side support, fortunately,  this patch already has some checks for >>> that. But for userspace CPUID config, it allows IBT to be exposed alone. >>> >>> IIUC, this series tries to tie IBT to SHSTK feature, i.e., IBT cannot be >>> exposed as an independent feature to guest without exposing SHSTK at the same >>> time. If it is, then below patch is not needed anymore: >>> https://lore.kernel.org/all/20240219074733.122080-3-weijiang.yang@intel.com/ >> That's a question for the x86 maintainers.  Specifically, do they want to allow >> enabling XFEATURE_CET_USER even if userspace shadow stack support is disabled. >> >> I don't think it impacts KVM, at least not directly.  Regardless of what decision >> the kernel makes, KVM needs to disable IBT and SHSTK if CET_USER _or_ CET_KERNEL >> is missing, which KVM already does via: >> >>     if ((kvm_caps.supported_xss & (XFEATURE_MASK_CET_USER | >>          XFEATURE_MASK_CET_KERNEL)) != >>         (XFEATURE_MASK_CET_USER | XFEATURE_MASK_CET_KERNEL)) { >>         kvm_cpu_cap_clear(X86_FEATURE_SHSTK); >>         kvm_cpu_cap_clear(X86_FEATURE_IBT); >>         kvm_caps.supported_xss &= ~(XFEATURE_MASK_CET_USER | >>                         XFEATURE_MASK_CET_KERNEL); >>     } >> >>> I'd check and clear IBT bit from CPUID when userspace enables only IBT via >>> KVM_SET_CPUID2. >> No.  It is userspace's responsibility to provide a sane CPUID model for the guest. >> KVM needs to ensure that *KVM* doesn't treat IBT as supported if the kernel doesn't >> allow XFEATURE_CET_USER, but userspace can advertise whatever it wants to the guest >> (and gets to keep the pieces if it does something funky). > > OK, I think we can go ahead to keep KVM patches as-is given the fact user IBT is not enabled in Linux. > I only hope other OSes can enforce both SHSTK and IBT dependency on XFEATURE_CET_USER so > that user IBT can work well there. > > Then IBT can be exposed to guest alone because guest *kernel* IBT only relies on S_CET MSR  which is > VMCS auto-saved/restored. > > What's your thoughts? If there's objection I'll do below changes for this series: 1) Remove patch : https://lore.kernel.org/all/20240219074733.122080-3-weijiang.yang@intel.com/ 2) Remove reference to raw CPUID for KVM IBT CPUID, handling it the same as SHSTK. Meanwhile still allow userspace to enable IBT feature alone because user IBT is not enabled in kernel now, leave enforcement of user IBT dependency on XFEATURE_CET_USER in future. > >