Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1501078lqp; Fri, 22 Mar 2024 18:22:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU08km9y8gSmtQapCrAdcfokP4D8vj1ExKNrhYq5GEMojiZOHBhMsJHe6qxtJ1l+5d12gcMVvNXwQjox6DnJRm6Z6uXEjih0t6Zm+4isA== X-Google-Smtp-Source: AGHT+IH/0ODHrKCr9Zv7gNkBJ2bozsDRx5chTGax5EECQ0bRoH8kfwyb+AqY7A3visKYJX8OLFHY X-Received: by 2002:a17:90b:3715:b0:29d:32cf:a60e with SMTP id mg21-20020a17090b371500b0029d32cfa60emr1379658pjb.0.1711156956494; Fri, 22 Mar 2024 18:22:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711156956; cv=pass; d=google.com; s=arc-20160816; b=daDPe14oZsQhs2QV+ORzITzmWlFGPD+TfYT8JJUb3REbq8dwbQXPZN9ljZu6ZoY7bC aIJeWNbZhrdYvDV/UEBR4WDWrwqaKLdDzshr/S/29Hu2iQlAFz14WOERRzVbnuaV8ZjL l6h8xTWM7s1zGyGMg+FavB7ajQSKm/FdSTN/6bo29C8yIUPc0WzSOiThsD9UbhYFu6WK dqrZmdgaj0wA9B+yeWQGS29dytev2o6k2riKBscdQyA2qRvkQ6vllD5drBicG0WYA87K aUkzYpMu1grN+NSYEKYoyx9aMpMFcqvhb9OzftaktF/dkakbwXe/1gfPIRU2wK4AK/8x LPJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=e4dKH7DufkICJq4e9CqWmGR5s44XOH0A6eek7yO8xr4=; fh=vpMrYZkWWzsWAEfJBv0kzXTtjq6m2YH0KRoJu79Ukck=; b=rxqoLJvOxF8hqrHId/tx8Lf8zrZhKih59osUeylV9Sz37K3Q6oE8cTjWZR0drdkSjJ fqlwz5if1fTNlhMLjY+xWOV5/WeFaqtnY1k0UTjWKMBcw/zf8PJ4+qxnubfBSlQXQWDv SlfFC+6m1husrxqaEttltXDZy/ZVlplBVRNKrbYZSEWuadKD+flq76sSL/9Q78fy7lSI J0xWFXhbsQn7mEh4Q4tsEWH7ofQMLS+kvB1KIUesGbP36VujZJto/0nYXYOZa7BSQyxa UTVMpre6hZTUP3n0/TSFeEL21GRSYb7drlmEN/3Nql0F4F/4XzW9jGyG1R3E2RIMbKw9 oPuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Fk3HzJj1; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-112156-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112156-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id sr3-20020a17090b4e8300b0029fb33b185bsi3266080pjb.52.2024.03.22.18.22.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 18:22:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112156-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=Fk3HzJj1; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-112156-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112156-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 6E8E5283CE9 for ; Sat, 23 Mar 2024 01:22:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11BC815A4; Sat, 23 Mar 2024 01:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Fk3HzJj1" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 65C7AA41; Sat, 23 Mar 2024 01:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711156947; cv=none; b=aZ19vGmiEGGVMWjv904mNIQwwT65JZJ+0SYVIHe4uiGUIFAcSboT+2qawCtiUeBjV22hcJBCX7si/4I9tHoeFmQHAznStCJqBMMsaO1C+fyrPHCiMhdN7bmScuUPY+MKfdQZjlKLy8SsEwow4ahvXOwVwSMrO+ZXmiRCMpufZ2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711156947; c=relaxed/simple; bh=xFHg9bMUkkDlShpLt1baft+c1rw1IBRTJLqE+kKG1CY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n66oexHWthhWY16wX07YNvS1u62+Qc+fwFShtn/32LUuxiwuMT5SMYgFrAkh2lthRz6bxP+Mxt+gL6eH/6bwvI9t2gfiJrHRPR0sNJU8f26C9lBiTd04IN/iQZpSnv4pZmQt3efj2rbw3ypVhlOLP9gctxQAi1m+BQ9EZKbDd24= ARC-Authentication-Results:i=1; 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=Fk3HzJj1; arc=none smtp.client-ip=192.198.163.8 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=1711156945; x=1742692945; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=xFHg9bMUkkDlShpLt1baft+c1rw1IBRTJLqE+kKG1CY=; b=Fk3HzJj19djg4jeO0jf6h9NKN1YjXDO+TxrQkMaovurFKfUOmMEVzMh5 O/LyhHD9bB/zZGL4tGpSe14MNrJJ5irK65xBv186uKZsTwC1XP/k5TUXx HspfJlPVKtChbbCahn39yjl8L5Ges7Zdo+wXIklWQL4arRo7lmCsZfYVO nd5rvwgsklDS+/9UUhkESus9+qn6blXh2Ph9+jMG1Rnb+QXIKMz2lwywl t2UXAKA2fDS6T4EM1NXfY2x2M6v3LE+Ud+lNjnj2HzIXE+K6QLY/m9et/ 9FNHUT4CfXjtJ4ewqvxItzyXG986Edrl4MJEPm/lHjUSwjOZ0EeqNlFLp A==; X-IronPort-AV: E=McAfee;i="6600,9927,11021"; a="23714724" X-IronPort-AV: E=Sophos;i="6.07,147,1708416000"; d="scan'208";a="23714724" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2024 18:22:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,147,1708416000"; d="scan'208";a="19763481" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2024 18:22:24 -0700 Date: Fri, 22 Mar 2024 18:22:24 -0700 From: Isaku Yamahata To: "Huang, Kai" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Yamahata, Isaku" , "Zhang, Tina" , "seanjc@google.com" , "Yuan, Hang" , "Chen, Bo2" , "sagis@google.com" , "isaku.yamahata@gmail.com" , "Aktas, Erdem" , "Li, Xiaoyao" , "pbonzini@redhat.com" , isaku.yamahata@linux.intel.com Subject: Re: [PATCH v19 039/130] KVM: TDX: initialize VM with TDX specific parameters Message-ID: <20240323012224.GD2357401@ls.amr.corp.intel.com> References: <5eca97e6a3978cf4dcf1cff21be6ec8b639a66b9.1708933498.git.isaku.yamahata@intel.com> <5f0c798cf242bafe9810556f711b703e9efec304.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5f0c798cf242bafe9810556f711b703e9efec304.camel@intel.com> On Fri, Mar 22, 2024 at 11:20:01AM +0000, "Huang, Kai" wrote: > On Mon, 2024-02-26 at 00:25 -0800, isaku.yamahata@intel.com wrote: > > +struct kvm_tdx_init_vm { > > + __u64 attributes; > > + __u64 mrconfigid[6]; /* sha384 digest */ > > + __u64 mrowner[6]; /* sha384 digest */ > > + __u64 mrownerconfig[6]; /* sha384 digest */ > > + /* > > + * For future extensibility to make sizeof(struct kvm_tdx_init_vm) = 8KB. > > + * This should be enough given sizeof(TD_PARAMS) = 1024. > > + * 8KB was chosen given because > > + * sizeof(struct kvm_cpuid_entry2) * KVM_MAX_CPUID_ENTRIES(=256) = 8KB. > > + */ > > + __u64 reserved[1004]; > > This is insane. > > You said you want to reserve 8K for CPUID entries, but how can these 1004 * 8 > bytes be used for CPUID entries since ... I tried to overestimate it. It's too much, how about to make it 1024, reserved[109]? -- Isaku Yamahata