Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1773430lqp; Mon, 15 Apr 2024 17:56:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcObJEPj1izc1Fy/OVd5N6Ia2+Zj78qH/tr8H8CbXPXHEITh2tqOULgfW4onzednxeiG1/H3zipWiEaw7tXaxKhHmGi/q4jS2hT7LYsQ== X-Google-Smtp-Source: AGHT+IHLE6PRwOD/P9wdN32wseum3ieVzvEq1Kq30EWL6vz3uAI1iql5mJzBOyVLIU6p8J1T+G7H X-Received: by 2002:a05:6a20:100e:b0:1a9:694b:5b0 with SMTP id gs14-20020a056a20100e00b001a9694b05b0mr8556837pzc.21.1713228966253; Mon, 15 Apr 2024 17:56:06 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s12-20020a170902988c00b001e5299e6f61si8396012plp.566.2024.04.15.17.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 17:56:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146051-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lbzdBNgy; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-146051-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146051-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D3DCF2834E3 for ; Tue, 16 Apr 2024 00:56:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A89EE6AB9; Tue, 16 Apr 2024 00:55:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lbzdBNgy" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 41AAE1849; Tue, 16 Apr 2024 00:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.9 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713228954; cv=fail; b=g2wsAz8WkVUIbzMNt0FUMPlUaqpIeq3TabWs3ts1jSt3R071XGgeENY2jgOsq0bzsHrdSM+j7tLufC3uZZXJNUVj21UZAJV+qvdwWjk7zVnpbBh15ap2G554+4TT7NesWhlACCq3hqbZjZiKlLFJzSDds1GXR2pCgSasljW1xWU= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713228954; c=relaxed/simple; bh=ScV7LmoyEvWBSJUHpvsyhsuZLBesi4i800GWRqaSldg=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=LchpKk5rseDfv07ycfZafcC6n8jxkdz+/Ln6MHWHDDr+b9x/BWmSiTJl4S0Dldy/UuS7aMss14ItmdO/oRwjuXX0UVIK5N1i3lHgkgXoJ60EmbjZBsHK20oRHNqfJ2o/3jhYP0pF9/UIC0njnAxd6ArRRQvDdAQFIfYOJNgdwlk= 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=lbzdBNgy; arc=fail smtp.client-ip=192.198.163.9 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=1713228952; x=1744764952; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=ScV7LmoyEvWBSJUHpvsyhsuZLBesi4i800GWRqaSldg=; b=lbzdBNgyFNV3bvvtqkifIAyDfUQdZVcwmkvnchl8/jKEYYyjDGUgqWDz t6OTlZNntU4H7mSD17YAgNJxcjomPH1WOj+hhA5vXYFzPlgXJQ2M8E3F5 CodL9UZVn4sQEz7U717HrIsXNFRfdunxXXD27RRp9bD/+AE3lGj/jeM17 NefVZVwlkLo7JNDUYNGORrYX3cAEipoPjpLjKTCDkvQ3Tx34vzanxZGH9 QME6hQOWo7Ov/AfeEyPfLFmraH0tlnDWTit10wEYojxDMHhdhZwZ+lEXG WtNv9wOSNQR2T+abuAP7z4nDtAHmTKB2LbRyZNW3Snd+vScjTlA9Zp4cI A==; X-CSE-ConnectionGUID: XPUx0FbFSx+TL5xcYtYIMg== X-CSE-MsgGUID: Wk7mUm3NSWqucAuSYb3G9Q== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="19354356" X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="19354356" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 17:55:50 -0700 X-CSE-ConnectionGUID: T1T3481RTfWwU+o10gjMlQ== X-CSE-MsgGUID: G5SXvN1sRLe7e6fV9O9YLg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="26749432" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Apr 2024 17:55:50 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.35; Mon, 15 Apr 2024 17:55:49 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Apr 2024 17:55:49 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 15 Apr 2024 17:55:49 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 15 Apr 2024 17:55:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iBW1SLUdrECCu5YM/BJOmyv2mlG8y1I/GOwDpMW1M50e2uPgC5n1CJX+AIMLZFO3WOg44hxv99oxc5O4LwMEDea3c5RSolMG22dEBjlRbfQl602NfEI6d033sPsMPIqI5DHwNMfz0zMX4hQARdC0dVHryv8dzt39f7lpi1jgo3E/jvPG8Q7F2R3ogXL019zQACKoPekfJ7AhBeeLcev8BOn/ncwvjAUw1PycpHbSjnijHo4Dag+nns1iFz6WgHO8uXFYm0ELo8N/mhk/iu7RBVeBqxl0cr+0cg/+YvLuU8bKu+g34jCwHtYIDlkLMbxMuBIPQHAR5jSVc8bSwwaNWw== 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=UPYGtG+j5Nx+oakv/ftgoqhySTAO+Nd3K7IlNf4FL5M=; b=Kwtipkfk93NJhgs1bpB1BJIUzjBXaudXF7fGN14/o5HilMG42n8Ux6FnoFTBAbDmSKhA0agaiRzUSiXm9njjZyclUthWGZs37zlCIMYXP9UW/on5H3gbHNU53TjxRWHnfendYfTwPkeAxh9XUOaHK9R96e8JwCyCjecPdmE1DvGuH5XxA1g7Jn3s/s4tXYi5rZ7N/O5R+S7k2Ckv8vZ+AK0C3bWaFfTAWxD66FM6GiEd0IixZ0g40pXV70Y2o4Qfk80dMp3vV8uR0pbx/8/+J5+SsfTZ5/aplTSuE5JPihohLtiu4OU/PhjHSWaUrh3LwyS/uSBg0OeOTe2Ee7mcOQ== 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 PH7PR11MB5983.namprd11.prod.outlook.com (2603:10b6:510:1e2::13) by SA1PR11MB5801.namprd11.prod.outlook.com (2603:10b6:806:23d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.25; Tue, 16 Apr 2024 00:55:43 +0000 Received: from PH7PR11MB5983.namprd11.prod.outlook.com ([fe80::dd06:e9e7:d35a:77b0]) by PH7PR11MB5983.namprd11.prod.outlook.com ([fe80::dd06:e9e7:d35a:77b0%5]) with mapi id 15.20.7472.027; Tue, 16 Apr 2024 00:55:43 +0000 Message-ID: <34d64c12-9ed5-4c63-8465-29f7fdce20dc@intel.com> Date: Tue, 16 Apr 2024 12:55:33 +1200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v19 027/130] KVM: TDX: Define TDX architectural definitions To: Isaku Yamahata , Yan Zhao CC: , , , , Paolo Bonzini , , Sean Christopherson , Sagi Shahar , , , , Sean Christopherson , Xiaoyao Li References: <522cbfe6e5a351f88480790fe3c3be36c82ca4b1.1708933498.git.isaku.yamahata@intel.com> <20240305082138.GD10568@ls.amr.corp.intel.com> Content-Language: en-US From: "Huang, Kai" In-Reply-To: <20240305082138.GD10568@ls.amr.corp.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR03CA0320.namprd03.prod.outlook.com (2603:10b6:303:dd::25) To PH7PR11MB5983.namprd11.prod.outlook.com (2603:10b6:510:1e2::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: PH7PR11MB5983:EE_|SA1PR11MB5801:EE_ X-MS-Office365-Filtering-Correlation-Id: fab8cc67-7c29-4f74-4412-08dc5daff1bf 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; X-Microsoft-Antispam-Message-Info: /DyDM8tEwZbUEiLMIxtZL1EghugwO7olB4a6kFFAdUTCT8fKrzL80QnzqF+n7X+uNyQVzO22TCzkb5zA9ZtFCl4u6CBpFX8Euq1FFgEUtVf/MFLjvYHImhEgTHtbN3QE/fXYcepP8GqypZPl0Y4Ec3ucawsLxVZ9RvhZmcS/ob7C/SlWuWT7pM/tSUsSDKHdJvgCF9t7Y4Kvo50SDHFPaJHIs1ikiJh4Q6J/WWNWpD/frZFCeDJ4N4ZQao+bFwVWUkXVZzsFTc2yVOL9wX4Ao+olNl45GxGhbr00QMR9GDw8kdN4EjCB3FF5bGmjqt70YsJHOjBtZVvfDFOBoYHuWFCyyZvf8OjwzNrnOZ3Lz+NmQYoPdU4vAmG7uu1IvxCyvCpKoKJfwaPdEayFjs578CZ9QuChN8knardS8SMN4Z8L1ledd1W665ss1nCCnAEDsKElXpj9hWqXhx+PK5MJs+KubTHpHqj5SiHT6XuF3elOnjox6R/KSiAc9jufG7tdLLiWcgPp2aO1/LBvisyeEUBkOqMrkCBto3p96gisoyqnoyd3RUOpOGX4ytkBkxGhJm3aZJ1SZpl1A2aUBgX49vP+pm3z5qBzN4Epmw7xz32MihXrbKRIE+m0soGglEbg22IylUdxAHeWWe1ss8TTwBbqvxAhWssBvdJDdaryyqM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR11MB5983.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QUtJcFNET2FnWkVBUllyYkpBYnhMUGtBQWZ2c0lvazVXdHZpVVpMRXZRMFM0?= =?utf-8?B?NktDZUVMM0RtaVlSOTgrOE9CZGtSSkNXcitLVVFwUHhvSHVyQmltR00vNUFH?= =?utf-8?B?elRING1UY0NhenBWQ1ZvSlpKMkNxWjhiRTFRbTNEemc1N3IzeTFZSkM2Vjlh?= =?utf-8?B?Ync0NFRaNFZRZjVNYWF4WjQxZEYwQ0dKcGhkMnJLOGRDOUowSnZNMnZvOFBO?= =?utf-8?B?cXpnRXQybk5CMm1xcDAxQUdDZUdlWUJkYzhLdlZob0hITlo1ZUVMaWtMOEo4?= =?utf-8?B?b3lWYnFsaGJFQXlYWTBJREZlTUREbWpuY2IwT1AwczdLL1A0RCtFT080TE9I?= =?utf-8?B?SGh4UUJWSmNJL2dSemwrU2E3R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4f74-4412-08dc5daff1bf X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5983.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2024 00:55:43.7771 (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: 9gbOo1x2BX7HfaxXyrHJeRYNEzTBYAuc008cX8enrt5LBQTfuzOJqFBWLgkOakGFllUSTnUfw9VsOESZdHFDIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB5801 X-OriginatorOrg: intel.com On 5/03/2024 9:21 pm, Isaku Yamahata wrote: > On Fri, Mar 01, 2024 at 03:25:31PM +0800, > Yan Zhao wrote: > >>> + * TD_PARAMS is provided as an input to TDH_MNG_INIT, the size of which is 1024B. >>> + */ >>> +#define TDX_MAX_VCPUS (~(u16)0) >> This value will be treated as -1 in tdx_vm_init(), >> "kvm->max_vcpus = min(kvm->max_vcpus, TDX_MAX_VCPUS);" >> >> This will lead to kvm->max_vcpus being -1 by default. >> Is this by design or just an error? >> If it's by design, why not set kvm->max_vcpus = -1 in tdx_vm_init() directly. >> If an unexpected error, may below is better? >> >> #define TDX_MAX_VCPUS (int)((u16)(~0UL)) >> or >> #define TDX_MAX_VCPUS 65536 > > You're right. I'll use ((int)U16_MAX). > As TDX 1.5 introduced metadata MAX_VCPUS_PER_TD, I'll update to get the value > and trim it further. Something following. > [...] > > + u16 max_vcpus_per_td; > + [...] > - kvm->max_vcpus = min(kvm->max_vcpus, TDX_MAX_VCPUS); > + kvm->max_vcpus = min3(kvm->max_vcpus, tdx_info->max_vcpus_per_td, > + TDX_MAX_VCPUS); > [...] > -#define TDX_MAX_VCPUS (~(u16)0) > +#define TDX_MAX_VCPUS ((int)U16_MAX) Why do you even need TDX_MAX_VCPUS, given it cannot exceed U16_MAX and you will have the 'u16 max_vcpus_per_td' anyway? IIUC, in KVM_ENABLE_CAP(KVM_CAP_MAX_VCPUS), we can overwrite the kvm->max_vcpus to the 'max_vcpus' provided by the userspace, and make sure it doesn't exceed tdx_info->max_vcpus_per_td. Anything I am missing?