Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1488416rbb; Mon, 26 Feb 2024 10:47:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVL3oBoUrge1C4hCS4YH3hfdImaaWrj+D36pBqc04vbYO0tqTWRTiU/iP81HlWfrZ8QsyBnGuJzB94SGNF3+d2fFev5bFyHRnir/xHiXg== X-Google-Smtp-Source: AGHT+IEMY2piUhrJEkjz6cS8IyTG6fiaEZr68eL8wb1wXfkStMNPAPSyv/6d42zRNirGiEbLDPtG X-Received: by 2002:ac8:5e08:0:b0:42d:ff6f:d68a with SMTP id h8-20020ac85e08000000b0042dff6fd68amr10907769qtx.24.1708973229580; Mon, 26 Feb 2024 10:47:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708973229; cv=pass; d=google.com; s=arc-20160816; b=Zk9cRazFovIyXLkxhOPZ/TkRwmgftOKYXqbvEMOteQtHcmuDV0gxq55K8pcKez0+Oc ibj+Rtv3vEIyF+o7Ua12UdDbr72Lu8K9B3Yb3HzuEBQjG1RLrIUFKhKZk+BRhSAnTkux 0vFVRw9GG2EYrl+Q7Kbv7iQa+TL1AAeRhSvs/0OJ1CdhA2GlzJIWpudpK8B9TnyRf78p Hx0I8gIbabRvZRMK1dZcTNCt1Cl0AzxiwvmXJFXzO6+w1mW+JJTn7R8W7EGAc+jHkVSq gRotzsCR+r2aEwwpsWrTSuUEwpsvGOemSr22rOuJYLiv4MJ3m45/E+RcCxPl7hUTWrpZ xpOw== 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=VTDblYvDHwbCvEJqkAs3ZG1h4p+/xDFhIHiaabaKQTY=; fh=2+G4KEaq7OXKefERxVphpK3HDJ8eJ+3FEULa0BsCEfU=; b=cHbOTm8Y5DzI0MxUNMoSDG2sbiWCSf+FUzwSJS6DjGHbd7pH/0HUtSK+keFikm/l1Q TIEpoo2e0DuiRx0O8KwnTtsmrqLh2Z6BSBq3YmuXpLGpfTnlToRrdFQg5SMr+Lsbwh0m mOq837COhblZL1itiHr8TqNJPI7hcyKAUHazgDVTReDD63BMuTErV2brMVmELxhYlOAX EjDPGx8DFrPTedeLSLGma3l7xvWvnZZsNQODEURTWpjYtEvGHU5WBnD1DDWVz4UfH8iS ptJLtEJJHyyHNav+gPwPn37AnvMNQ4ogKSvKQWs6Q/8rqZSwx2aZ8eoyTAl+wKUTS9QQ af0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aWKluxCG; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82152-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c17-20020a05622a025100b0042e8c2c4558si1653151qtx.392.2024.02.26.10.47.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:47:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82152-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aWKluxCG; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82152-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82152-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 542E11C23655 for ; Mon, 26 Feb 2024 18:47:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05F1E12F39B; Mon, 26 Feb 2024 18:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aWKluxCG" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 2AACF12BEAC; Mon, 26 Feb 2024 18:46:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708973219; cv=none; b=c6jyZVEbexMAA+tS8gBFzkNkc8dXl70d+cAfvmSuUbKZItIqBB8D4ojXoImXCZnu3tnhp37U+1xL2VB3QHhl71H5fsd9lZ/UEriCJMSycWkH2hjOVaru3l7Z1LPQazdQLxeVs00/n7MSNN5jj4HHVNeYfpiPxKlKsyY/Lljr0zY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708973219; c=relaxed/simple; bh=IEHN+hbJJ2pkcDOFbDZUNs1LJ5lMb5GwZOaxnquvMI8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ce1+gP5kuhQa7FFWoARxVE54GkfqZkev5nX7hPvP98bDqkNvwNem5YICgoJUruEBAqEbx6idbRrcjFrSHwNlMHF28uG4rWQ1z6eQHIMl5B9KDKlyh1PoWzbQ7cojmwauztUn1Rglo+EpT0a1i4BmWkLi5ACLmHwRVFNQTwMA900= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aWKluxCG; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.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=1708973216; x=1740509216; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=IEHN+hbJJ2pkcDOFbDZUNs1LJ5lMb5GwZOaxnquvMI8=; b=aWKluxCGffHd+IZ9pMuO1gv6eJ132N3wufiUGDaP6Ing6yPkFBLVVKOA S/DpIQjO+moaoAEt4OwLdv5g9/MhI3bCiqDM4Tcmk2IXawxcWfAKHaoAS YWlFbB3CWd17JFO9ZHX0wNPA6DT3LnP8a3jw2DElxA+zVz8QpfhOg3uDK EJCiox8aZBIZ/MnHcHoU3mwhMXY2TMPvNRU/BF9GkCqjD4qk13J9GflvK tC+g1of3b2wzNBgSTX06GSLV7xTzybrBiIOrIvk7Z56QdJytoz2C1bA+n zi1ZnVO4hKm7n3ercLbUZBPvtbn9zrjLS1+XiL7aDyZb2t80YUMJlzypl A==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="3408157" X-IronPort-AV: E=Sophos;i="6.06,186,1705392000"; d="scan'208";a="3408157" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 10:46:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,186,1705392000"; d="scan'208";a="7298753" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 10:46:55 -0800 Date: Mon, 26 Feb 2024 10:46:54 -0800 From: Isaku Yamahata To: Yuan Yao Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com, isaku.yamahata@linux.intel.com Subject: Re: [PATCH v18 001/121] x86/virt/tdx: Export TDX KeyID information Message-ID: <20240226184654.GG177224@ls.amr.corp.intel.com> References: <20240201015729.6n5uavy7rxdjtqwc@yy-desk-7060> 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: <20240201015729.6n5uavy7rxdjtqwc@yy-desk-7060> On Thu, Feb 01, 2024 at 09:57:29AM +0800, Yuan Yao wrote: > On Mon, Jan 22, 2024 at 03:52:37PM -0800, isaku.yamahata@intel.com wrote: > > From: Kai Huang > > > > Each TDX guest must be protected by its own unique TDX KeyID. KVM will > > need to tell the TDX module the unique KeyID for a TDX guest when KVM > > creates it. > > > > Export the TDX KeyID range that can be used by TDX guests for KVM to > > use. KVM can then manage these KeyIDs and assign one for each TDX guest > > when it is created. > > > > Each TDX guest has a root control structure called "Trust Domain Root" > > (TDR). Unlike the rest of the TDX guest, the TDR is protected by the > > TDX global KeyID. When tearing down the TDR, KVM will need to pass the > > TDX global KeyID explicitly to the TDX module to flush cache associated > > to the TDR. > > > > Also export the TDX global KeyID for KVM to tear down the TDR. > > > > Signed-off-by: Kai Huang > > The variables exported by this patch are used first time in patch 18 IIUC... > So how about move this one just before the patch 18 ? With v19, I put those tdx host patches in the first part. -- Isaku Yamahata