Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1886479lqz; Mon, 1 Apr 2024 23:53:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXD3HXNCAkUCnKJludxRgXouvynYqkYuo/Snh8dZxKAkWjdPoO4fE4dFHp17rPL1K2vJO2JS/knDqZfII2edmxraGSoCKc0VdIOaA7JjQ== X-Google-Smtp-Source: AGHT+IG+su8+b3MY23nN9oJ5q7hvmX7L69oB1pxoh64CaURgP+gP137VUyPkk2rKZ+4Kgv7pvGiW X-Received: by 2002:a05:620a:2af3:b0:78b:c776:2664 with SMTP id bn51-20020a05620a2af300b0078bc7762664mr11564625qkb.74.1712040787793; Mon, 01 Apr 2024 23:53:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712040787; cv=pass; d=google.com; s=arc-20160816; b=qBmyaHa+WyO+V21q2lczbcKWD+gqX4dE90wliUY4yjm5Cy4STymSZh1R4iEvMQtxrs Ffs/aB9dAGJvRSq0qDmcwM4tllxrBSyJlolVZzvutEH6mCvMBl3bqTKvFO7sLGbCI/Ng 1HA5fiiJ5xJFLWS4rHJTi6SCQCWXcHSYAlLydU/SlDyt1qFoPsp+H6IwYCgkHmTnzlpv 6mLliYK8WxJW1IQksIZr/MgqZPoG7hUoWh38ltfUq9f9APtNrH4vEwHkOCA7F6j0YGH5 Us3yk6/4MPl6OJB7P8393/R3XFpEO6aciw45wACn82fYTqC0BaF89+O4lvJhxlYeRCs1 ODlw== 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=+UvFh/tBu0VqOeph3GqbnM3nLwbufgqCduOTjA7pOFo=; fh=tt0CEY5xhom/IlvDKU6vi+rzDvhB3cKAIKF4sAkibAI=; b=kRT1EXDO4Zc226Gz/hSIb2yfhtjE7YKlIHWwL6FCzICda5s5HwUtbMy+JaCFwcOCzA FFVNAT9/rYvPmpFZIzSBrF20MDl9DG1UMFQUnHZxHAv1jH8440NDMHuF+KBWCbjHYRmb y0jDW6v3X+6CGMijbBI9jRS6RhF7iu6RgZ7CFgxS60aMN1sHpZRnNnNUjAfson3uhSap 6e/pcnuD7cppjfjvitoSZtdMvQ3ZrLVIZydvG1E94XAszKBP871SiQ44y8AuH6eg0QmW Hg2WM5Ar/1yEhtk94xGmXbmi0qB+81DJ1nYVSQgc8MGUGENvVjPNb0kwSAZjtgfzRXOq pOhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Gc52YStr; 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-127462-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127462-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 s4-20020a05620a030400b0078be3918e13si3938831qkm.743.2024.04.01.23.53.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 23:53:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127462-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=Gc52YStr; 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-127462-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127462-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 634C91C21B16 for ; Tue, 2 Apr 2024 06:53:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5BF333062; Tue, 2 Apr 2024 06:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Gc52YStr" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 6D33B2C689; Tue, 2 Apr 2024 06:52:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712040778; cv=none; b=QkmIxn2zOH8OmQN0XRyO1B7/8aplc2Hmp2ghO0KzOGmF7OsiKsJV9JM07wOsiQCwD5rcceyqXMPvNeni4dSnPWBW1uL6rW5DFznE2t1AY2dvQdNS90pzlXp1d5sbOkqPFWxQoN2xnb/1bFMCAaSq7kO5zwfld0UUVxVFrzbMkCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712040778; c=relaxed/simple; bh=8U+o5ZPPyeR6k/u71wLfHh1u9kvqRkSFl8fCN0tDQ0s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sisbg8bK/xwsuZNbhfnXdVv5EcSw3xHiDebjj4hwjn7CoCRWCOX80p96cdxR95H21Oj3G5fv/B/ye+5Fu1zgW5VDF3jxjWGzXJOwoQzqP20kgvwhMb8NzbH1TmSoTJM6Et62BA1UsAdrl+ZgxX4Aiufb2zGsq8Al4LX9tFvNj7Y= 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=Gc52YStr; arc=none smtp.client-ip=198.175.65.20 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=1712040775; x=1743576775; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=8U+o5ZPPyeR6k/u71wLfHh1u9kvqRkSFl8fCN0tDQ0s=; b=Gc52YStrdzIIIEeUgDrpxBK8ktSVfvANZCcH9jlco4zGRv+WnLXRtVaB 4JFrYdxwvwhisChcYrACnLgNyQOF6/2xzO/qi01zkK6gj0YVPDGRyajSW xahiHX4mfSadQRHwKtCqk+dH+dF4XBRweOKDHQXam2m5lj22oHb57WC6V IQKl3iT5DiHVoD77z0IHw8uFmgJ5dvYyCws3g8TnKvQJyxubjf6BRHxpr y9KKgNAoDs9JWFZmCAYc5a2ZZe+vQVV7uRl75qnv0ZGb4cL7oeYPxhQDK cBIwq1YHDetanHVf05Ukik9IXKPdnC3Mem36vScgwe7LRU4HRTcTkLb7S Q==; X-CSE-ConnectionGUID: uleWtztsRvac2Q32WZWFEQ== X-CSE-MsgGUID: 5XhIILKkQZy15smCwQVA+w== X-IronPort-AV: E=McAfee;i="6600,9927,11031"; a="7095788" X-IronPort-AV: E=Sophos;i="6.07,174,1708416000"; d="scan'208";a="7095788" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2024 23:52:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,174,1708416000"; d="scan'208";a="22409021" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2024 23:52:54 -0700 Date: Mon, 1 Apr 2024 23:52:54 -0700 From: Isaku Yamahata To: Chao Gao 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 v19 093/130] KVM: TDX: Implements vcpu request_immediate_exit Message-ID: <20240402065254.GY2444378@ls.amr.corp.intel.com> References: <3fd2824a8f77412476b58155776e88dfe84a8c73.1708933498.git.isaku.yamahata@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: On Fri, Mar 29, 2024 at 09:54:04AM +0800, Chao Gao wrote: > On Mon, Feb 26, 2024 at 12:26:35AM -0800, isaku.yamahata@intel.com wrote: > >From: Isaku Yamahata > > > >Now we are able to inject interrupts into TDX vcpu, it's ready to block TDX > >vcpu. Wire up kvm x86 methods for blocking/unblocking vcpu for TDX. To > >unblock on pending events, request immediate exit methods is also needed. > > TDX doesn't support this immediate exit. It is considered as a potential > attack to TDs. TDX module deploys 0/1-step mitigations to prevent this. > Even KVM issues a self-IPI before TD-entry, TD-exit will happen after > the guest runs a random number of instructions. > > KVM shouldn't request immediate exits in the first place. Just emit a > warning if KVM tries to do this. 0ec3d6d1f169 ("KVM: x86: Fully defer to vendor code to decide how to force immediate exit") removed the hook. This patch will be dropped and tdx_vcpu_run() will ignore force_immediate_exit. -- Isaku Yamahata