Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp87932lqp; Fri, 12 Apr 2024 11:11:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWitdq1Cd9oww3VD8ZBmkDqS6QNw1l4l5YjsoJ/KqH//7GB0BFRV69HUtpxvXsFqPR2wGao6qI1eEoOTp1tH9+RRU02ozpw0OipulqXmg== X-Google-Smtp-Source: AGHT+IG9ZpwBLeea8jjg/EnWffIQ9U9T3WkL2Qd6xNOi+S5ty767GcpBCdKgDEYZ0IKEI9fdKMrQ X-Received: by 2002:a17:902:6909:b0:1e4:9c2f:d4f7 with SMTP id j9-20020a170902690900b001e49c2fd4f7mr2923450plk.28.1712945504482; Fri, 12 Apr 2024 11:11:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712945504; cv=pass; d=google.com; s=arc-20160816; b=YvjeziRWr64PPwh3GtrCsNZnAINzgzMsYokFKzcSrx9u7DHerb9AZG5WjYhsPKI527 wCW8A3a5lsJoZhXB8xnb26STVdjdlzEXr0pjsxvLetFit0u5pKGz7NYOuLqkKu4p0OO/ o1PogiY1I6d7Od+wZsf/goR3s1pkLMbquzYggWn8Fz0aZe8JopUh9hC7+mVkDIO5ikg5 rzPE3HV5h0kkbXt/0Jm6kh6UABLlUCWleLVBFfYXWVcleOUg42T+PU1VqLZRkQjOPP7Q diVTy4egXNsD7o5m6/7fpbHhlaYY7nt7ERdrynJVO8aSIz2Wrb5oijEuRanKfGiKMhPE UVSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=93zwTQNW+QknqEkvXzcoVD4jHRP4HYJibsVE/K7qtTc=; fh=qqtW5HQG8ZSoSJroMykHarc6L7Dj+eLwjyXnoJq76UE=; b=sWjL6G1cKwcTt+HhTlBSasmAr73MhyEgWGm+71SZkihkscfRo1zeWrcTtxrBbRuDWW kRz9KNJBqey2HuoPEanmp4aaZHlkH/oOLQVGQPSM9YzBhKCYMLGHJfvaVNLvvQtLGHSZ DQ7qtYDw37+3F4FA/DtP0WrMSw6tm8gKd5Tx7AZCMwX2m0Hat6IR7KvmP0wiQsazJYn7 KcxEeOjCTutB2hbWdb+zyFa/aLbYSicVcrKzp8q+hTpRj0AD6DS8demcn2pZqKBg8rdX oxCWoURALEW/kK+El3rmsam750HeG0S7kCxwbwGtm/HGkPDMwejUxc4xFVRCYrl9AjRS nohQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bm1cA1ya; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-142895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142895-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j5-20020a170903028500b001e4807217fcsi3683761plr.16.2024.04.12.11.11.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 11:11:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bm1cA1ya; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-142895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142895-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9C4F0B241E3 for ; Fri, 12 Apr 2024 15:02:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 865061474D2; Fri, 12 Apr 2024 15:02:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bm1cA1ya" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 0521F146D68 for ; Fri, 12 Apr 2024 15:02:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712934124; cv=none; b=rVT/6BNtKxL6mHcWvn+bfon701weM7UlXYKnUPLt3yeL4azSwUWYBNuXLashHMil5ojUAaaPzke4bfiaR8xH/e3IkwlB+Nrn1enSqZCyCTean7YwNzmhyJAWzF5L1/REKPF5WdpJ5Jyh0cQgfREdQrxsH8QbMr6SlUFjuYhcvtY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712934124; c=relaxed/simple; bh=uMShFtLOUG8eV3KMCwAPHQbJV1SdgUmb18i0oOTiTpk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bgQK1TUi5F3DMMUFEF9W8wB2jmMmjIuQB95PUaeGlHvu6dRxEJHU8T7507Pa7u8CVHninn7LfNc9S91dDsCmVunizgxHBXwbml+NpNX/dPJLglpQEt/5ScmyfWVfuW27DtNg/RdQQuqkG80cS/kG6Eu+RyVLq+G95/mEKd/KvRc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=bm1cA1ya; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712934123; x=1744470123; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=uMShFtLOUG8eV3KMCwAPHQbJV1SdgUmb18i0oOTiTpk=; b=bm1cA1yak0r3+RMO/7mjcuGJ+l1khXSGO1Px3NdmDd1nn0zjdU9mL67+ +fpwkEBcfspBQmBLcYbetygYc20eSkM+oQRkliB1wisD9T6V9C63pmSWI ChhXdVe7BSBVKTzONujeb00ujz7S6ge7j1HKkG1yJjivgdeH/lV94hblU NdLz6iSXkvN7yokOlVGK6gmZFlTLIKBB6ZrUzI88RReGRrNWLZ6FM1/Oi CC6CEIsb/U68G9JdBxCuZeG62uO3noRMqt7s3/z/emCJGzKRdycvLL0dZ WbH8D4/IoK42l3PcvEo/ARRiLUcKenTLE7UmvQOfu6FiJmLgNFE+Q/6xX Q==; X-CSE-ConnectionGUID: fGfX9lJvShKktvByN47pOw== X-CSE-MsgGUID: +qSY3yqEQwmR9MqLvNDv3A== X-IronPort-AV: E=McAfee;i="6600,9927,11042"; a="19786970" X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="19786970" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 08:02:02 -0700 X-CSE-ConnectionGUID: /S7f/l5ET5e4oP9wsilGiw== X-CSE-MsgGUID: kE81WDBHRhuHx/4CFCqFjg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="26063040" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 12 Apr 2024 08:01:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 43ED4E7; Fri, 12 Apr 2024 18:01:58 +0300 (EEST) Date: Fri, 12 Apr 2024 18:01:58 +0300 From: "kirill.shutemov@linux.intel.com" To: "Edgecombe, Rick P" Cc: "tglx@linutronix.de" , "mingo@redhat.com" , "Hansen, Dave" , "bp@alien8.de" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "hpa@zytor.com" , "Reshetova, Elena" , "seanjc@google.com" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCHv2 0/4] x86/tdx: Adjust TD settings on boot Message-ID: References: <20240325104607.2653307-1-kirill.shutemov@linux.intel.com> <46cb81e0dda6196a1339cdfc93ea93f2d13c3e4b.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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <46cb81e0dda6196a1339cdfc93ea93f2d13c3e4b.camel@intel.com> On Wed, Apr 10, 2024 at 02:41:13PM +0000, Edgecombe, Rick P wrote: > On Wed, 2024-04-10 at 17:37 +0300, Kirill A. Shutemov wrote: > > On Mon, Mar 25, 2024 at 12:46:03PM +0200, Kirill A. Shutemov wrote: > > > Adjust TD setting on boot: > > > > > > ?? - Disable EPT violation #VE on private memory if TD can > > > ???? control it; > > > > > > ?? - Enable virtualization of topology-related CPUID leafs > > > ???? X2APIC_APICID MSR; > > > > Any feedback? > > It is missing a lot of the normal things that come in coverletters like what is > the problem and importance. It might help attract more review. What about this: The patchset adjusts a few TD settings on boot for the optimal functioning of the system: - Disable EPT violation #VE on private memory if TD can control it The newer TDX module allows the guest to control whether it wants to see #VE on EPT violation on private memory. The Linux kernel does not want such #VEs and needs to disable them. - Enable virtualization of topology-related CPUID leafs X2APIC_APICID MSR; The ENUM_TOPOLOGY feature allows the VMM to provide topology information to the guest. Enabling the feature eliminates topology-related #VEs: the TDX module virtualizes accesses to the CPUID leafs and the MSR. It allows TDX guest to run with non-trivial topology configuration. -- Kiryl Shutsemau / Kirill A. Shutemov