From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 A59B228F5; Mon, 10 Mar 2025 03:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.15 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741578606; cv=fail; b=CaOy4N/hfakknmVDMRNicb3HdwIROpCABffechRQ1bZME1khquncw3Qr18WdCH8Ly5+BVsro21XO7w8766GtNHh7moH0cbt4EO8mmMwvWS6IUmm4xq2YG7/mAUoqu6e35kkgUV7Dy15C6z8ZqNxGLqJy4z0Pmg6p22asRjdrVLw= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741578606; c=relaxed/simple; bh=BtGAuhpBojkW476shtZyRUtjMpLJp4KZ5XKDXczICVg=; h=Date:From:To:CC:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=jfyUzy6APo1ClwzFo0dlDN6A0xQ7KS1jWb7GCV7BD/LBZmjLVYQ8GIRhayP7dh/ffOU3/okNsTXukfhvwbLfROk3dP8KS3sgV4GkwU8s7rKvrkOgCdWdOa/V3iMRnosKpFvueOAUupeFysWSupo8TMF6EugLyfiWPmEi0Dt4CIg= 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=Cp/znHzB; arc=fail smtp.client-ip=198.175.65.15 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Cp/znHzB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1741578605; x=1773114605; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=BtGAuhpBojkW476shtZyRUtjMpLJp4KZ5XKDXczICVg=; b=Cp/znHzBuA7woU0YEHCydoqBck2wA5bX1GboqFrTXHv2RCHSO0gU48CF AreOSkYa1CGNHi/g1ufqlMUtmD/t0FVsKLdvaAx7PY2l8qN+5BhxYC5uk ja5bEUwvFWslPUVSoyOz+CCD+vZ3Uz3qphPZx1gPRa/RplZcV3CfsdEGU Q6XsliSysRyAOhzhIPFrpNUvRg97IRPF7260GcjAKuX9fNzath9bcB/9a w7U/nOqLESxKh7hiEatRGWNIVcL6kFpDtqmWX9ZTehOdiVNAyTiAnGrZQ Ir9St6jY6Udgtn2rlloYLSrspsE7NtLJ4l7s62VJL4eVE3AzcDj30xffH A==; X-CSE-ConnectionGUID: G2FIgVumQVKJl+ck1BhbSA== X-CSE-MsgGUID: IDn5XceaRpWDW9+2/B/OAA== X-IronPort-AV: E=McAfee;i="6700,10204,11368"; a="46205688" X-IronPort-AV: E=Sophos;i="6.14,235,1736841600"; d="scan'208";a="46205688" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2025 20:50:04 -0700 X-CSE-ConnectionGUID: w40Tc434Tva1swPK3BcHJg== X-CSE-MsgGUID: E+4Y2OUyRZS58/f+OBqX/A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,235,1736841600"; d="scan'208";a="120354857" Received: from orsmsx901.amr.corp.intel.com ([10.22.229.23]) by fmviesa010.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2025 20:50:04 -0700 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 9 Mar 2025 20:50:03 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Sun, 9 Mar 2025 20:50:03 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.47) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Sun, 9 Mar 2025 20:50:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oDmKVONzsnPDvxGHpKBBJ+AERmKKtnpIh6umreHqopspfh5Vt3nGoVf6lGJVltJ0vfKuXQFbUbLI4a/9M6qUDCufRG4iFdpK0oXvUyBGhhqJWcYVHMbRKkh/3zGGtlaulumlmXSzVDF91N4p3KbLFp7xTS+bGAiXfJ8Ew7NZ2Msz3Yuar0XR4JkhR0gffnk8r9oS/3yxdKIoN/zhQo91rMWhx7OVCnHHv2TfFrb1YO9CyY2as1q+X9dFZFuHHhdti73iUlRoxr3kQAdOqhWVNbPwfIA6aMnUzLXLZ+CyK8QiNTULCLrB2EKH+Ez+vJVyTGruO2o/gqZo+ioWNuWAJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/cmS+Pi5A9i8Hs6qCZyAko7oCkja6jdLyvhRYTRwzDs=; b=LQb//mrFOH2M9sX4abI6BUA/hrPEfx+bGieTks+nse33GQfQZGPF3LyndZLs/L12OFNkg16SXrYxGkpnNUtzRM6qUqQTmioiN6HxqzJOBw9E20ikIOnLOVR04ihvFmHDDBCEiS2t8GOuuH/0rYRv7k8RrgaYMxnXBvSAsCfQAwZ6a8mN4Yg4ePvPplpDyKnXh6ylR1lQISLA74D0jSg63qTCxXYsKQvbhxazgkUPiCPH+30h777vGAX3MWuzt6uOKLxdt1HVbEuAEuu/iXRJmS3snBDJ8IOJUCBWge8bQdt8EpbGk/iD4sSLkZdy5oOJ5fl7CqhPx1goLzCfPghAzg== 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 CH3PR11MB8660.namprd11.prod.outlook.com (2603:10b6:610:1ce::13) by SA1PR11MB8811.namprd11.prod.outlook.com (2603:10b6:806:467::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.26; Mon, 10 Mar 2025 03:49:30 +0000 Received: from CH3PR11MB8660.namprd11.prod.outlook.com ([fe80::cfad:add4:daad:fb9b]) by CH3PR11MB8660.namprd11.prod.outlook.com ([fe80::cfad:add4:daad:fb9b%5]) with mapi id 15.20.8511.025; Mon, 10 Mar 2025 03:49:30 +0000 Date: Mon, 10 Mar 2025 11:49:19 +0800 From: Chao Gao To: "Chang S. Bae" CC: , , , , , , , , , , , Subject: Re: [PATCH v3 09/10] x86/fpu/xstate: Introduce XFEATURE_MASK_KERNEL_DYNAMIC xfeature set Message-ID: References: <20250307164123.1613414-1-chao.gao@intel.com> <20250307164123.1613414-10-chao.gao@intel.com> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: SG2PR02CA0127.apcprd02.prod.outlook.com (2603:1096:4:188::7) To CH3PR11MB8660.namprd11.prod.outlook.com (2603:10b6:610:1ce::13) 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: CH3PR11MB8660:EE_|SA1PR11MB8811:EE_ X-MS-Office365-Filtering-Correlation-Id: 074321d9-4f2c-4971-91af-08dd5f868ff9 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:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ck82R3V2aUlKWFRXNnp4MStKQUNzMFJlY1ByWnF5Y0ZvOGMzMC8zaUFTYTM5?= =?utf-8?B?U3dWeXpFZHNDcUJVN2tNbHlKYk9tVk9GOE5lYXhVYlpHdGRFVG5EbTM0TVJz?= =?utf-8?B?ZWlGd0ZmNEJJLzcyRkZCVnlZRytVOWhEYnpIVUFyNGZlcW5HV1licVhSLzVa?= =?utf-8?B?Z25kNFlkSDVwVnRuSm4yVmZWbXNWeCtKWitESUtDM2N4OXBNOGNvZ2F5N2xp?= =?utf-8?B?NVBHQS9KS2NQSll3WlgyZlczTnhGRHo4UjVZeEdXWWdPa3krL0M2WEZwSE9H?= =?utf-8?B?U0FvejhCdnlZendEbXNXc1JqMEptT25ZeGgzN053OFh2N3l4Z0hLSExwQU1Q?= =?utf-8?B?c3o5N1NVNnVybnJjQjU5ZTcwM05KK1JveXpLbU9Bbk5PUXJlZ1VKU3ZpTTk0?= =?utf-8?B?bDYyU3c5ZGRhelJHNzlNVWhDd2Z4Y0RWTk5IejVoVVBCZFlGVWI2Uis4Zmtr?= =?utf-8?B?Q2lyNHhCTUp4d0ZJVlp5R3BkZCtNUFVnNkc3MnNoK2hUYjN5VEc2eGl3K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bFlEYzNjaDZaS2Q3S0hSQnY1Wk81?= =?utf-8?B?NEtLdkxqL2JWSEIyRDd0TmVhZkRYdTVWUUhrWU5XMGhRTWkyUjhwTzdsQUhp?= =?utf-8?B?WERTby9KbTI1eTFCMW9xSmF3Y0ZpdHBTYkZtVEVmVkdMbkVPUTVMOUtSOXd3?= =?utf-8?B?dVFsODJwSHlSNzFyUEJsbjVUVnQ0OWo0NWFQb05FQW5LczBjNjFnbGZHNW5R?= =?utf-8?B?UGRYQ3psUDhWMUZqVXQ3c1plMXZGS1BSKzBFZ0JHYnNrOUhtUVpNa0hDUW44?= =?utf-8?B?V0J6MEV6MkVZOHVxUnlOd3NBd1RGQUtpeWZ2T1hnTm1WUm9OMGUxc0FPZ2p0?= =?utf-8?B?Q2lQZTdrbnU2UUljNnZXenJwbmtVZjc5dTdDNzJMOE9CdXdXWXVuZnZDU21Q?= =?utf-8?B?VTQ4M09KcmpHeXdlL0llUT09?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR11MB8660.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WkZXVy80Mm9xRnArZE5ObFZDWHZISkdiRUVlTHV0YUk2NWI1eUVvNTRzTFg0?= =?utf-8?B?aFdOZFhtRVJ6T29iWVZLeWZjeGRFVmZvMjhTbTZNVjIyaUpDSnBzZUdBLzZD?= =?utf-8?B?MUlLNThBWldKRm1pUFVnUi9wUlE3eGNLcGFhM0pTT0ViZ0VCaytlZ3Npd0RW?= =?utf-8?B?UmhsVDljWXJCdXZOMy80K2dUTnhNYTlBaVVBTFczZk50RFlFK2J6RFVCSzRS?= =?utf-8?B?YUhLZkhMV3UzM2ZvUUdEVzVQWjRQdk0vaGdiRVFiTlhxTE5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?N01ENjc1T3dXSUN4WGxhUk1CNTF6ZUU4YmtWOVZuUWI3UHljc3dCeVRacjdL?= =?utf-8?Q?pRYLKrx40ZuOFIxd0icFhX9ZR?= X-MS-Exchange-CrossTenant-Network-Message-Id: 074321d9-4f2c-4971-91af-08dd5f868ff9 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB8660.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2025 03:49:30.3843 (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: ZkbyDyYfTala8KtXNYJc1QqL4NvC7GOt9kb46sSvPCOkpiLzgDYf6I3/pDxJ5EDWGiA8VifNLY9iCK171mCx1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB8811 X-OriginatorOrg: intel.com >When introducing user dynamic features, AMX required a large state, so buffer >reallocation for expansion was deferred until it was actually used. This >introduction was associated with introducing a permission mechanism, which >was expected to be requested by userspace. > >For VCPU tasks, the userspace component (QEMU) requests permission [1], and >buffer expansion then follows based on the exposed CPUID determination [2]. > >Now, regarding the new kernel dynamic features, I’m unsure whether this >changelog or anything else sufficiently describes its semantics distintively. >It appears that both permission grant and buffer allocation for the kernel >dynamic feature occur at VCPU allocation time. However, this model differs >from the deferred buffer expansion model for user dynamic features. > >If the kernel dynamic feature model were to follow the same deferred >reallocation approach as user dynamic features, buffer reallocation would be >expected. In that case, I'd also question whether fpu_guest_cfg is truly >necessary. > >VCPU allocation could still rely on fpu_kernel_cfg, and fpu->guest_perm could >be extrapolated from fpu->perm or fpu_kernel_cfg. Then, reallocation could >proceed as usual based on the permission, extending >fpu_enable_guest_xfd_features(), possibly renaming it to >fpu_enable_dynamic_features(). > >That said, this is a relatively small state. Yes, there's no need to make the guest FPU dynamically sized for the CET supervisor state, as it is only 24 bytes. XFEATURE_MASK_KERNEL_DYNAMIC is a misnomer. It is misleading readers into thinking it involves permission requests and dynamic sizing, similar to XFEATURE_MASK_USER_DYNAMIC >Even if the intent was to >introduce a new semantic model distinct from user dynamic features, it should >be clearly documented to avoid confusion. The goal isn't to add a new semantic model for dynamic features. > >On the other hand, if the goal is rather to establish a new approach for >handling a previously nonexistent set of guest-exclusive features, then the Yes. This is the goal of this patch. >current approach remains somewhat convoluted without clear descriptions. >Perhaps, I'm missing something. Do you mean this patch is "somewhat convoluted"? or the whole series? I am assuming you meant this series as this patch itself is quite small. Here is how this series is organized: Patches 1–4 : Cleanups and preparatory fixes. Patches 5–7 : Introduce fpu_guest_cfg to formalize guest FPU configuration. Patch 8 (Primary Goal): Add CET supervisor state support. Patches 9–10 : make CET supserviosr state a guest-only feature to save XSAVE buffer space for non-guest FPUs (placed at the end for easier review/drop). I believe the "somewhat convoluted" impression comes from the introduction of fpu_guest_cfg. But as I alluded to in patch 5's changelog, fpu_guest_cfg actually simplifies the architecture rather than adding complexity, with minimal overhead, i.e., a single global config. It was suggested by Sean [1]. In my view, it offers three benefits: - Readability: Removes ambiguity in fpu_alloc_guest_fpstate() by initializing the guest FPU with its own config. - Extensibility: Supports clean addition of guest-only features (e.g., CET supervisor state) or potentially kernel-only features (e.g., PASID, which is not used by guest FPUs) - Robustness: Prevent issues like those addressed by patches 3/4. It is possible to make some features guest-only without fpu_guest_cfg, but doing so would make fpu_alloc_guest_fpstate() a bit difficult to understand. See [2]. [1]: https://lore.kernel.org/kvm/ZTf5wPKXuHBQk0AN@google.com/ [2]: https://lore.kernel.org/kvm/20230914063325.85503-8-weijiang.yang@intel.com/ > >Thanks, >Chang > >[1] https://github.com/qemu/qemu/blob/master/target/i386/kvm/kvm.c#L6395 >[2] https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kvm/cpuid.c#n195 Thanks for these references.