From patchwork Wed Nov 15 07:15:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 13456370 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 447984419 for ; Wed, 15 Nov 2023 07:23:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gEeKxxmx" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4616F1 for ; Tue, 14 Nov 2023 23:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700033010; x=1731569010; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H2r+ccbc41orXJzKOTmTCpHgbj6YS/1xLLl39/BjPwI=; b=gEeKxxmxKmxz1uJimv0BzV72D3AMYPM9UXRkQBYUDr0ssrhxoBheTBbv VQUK3eX+na/c/Pmdq8gVDeJhjDWTFJJR7ECziaFOX8CyCG+SvEdY4RIRa GsKprjpJhN3iWISl13DBIbU0SOFOsskMlFPla1tmS7BiUmXdoc8/NIoyl BDu2gu1s8oa2ZINI7jOYNtJl0Pkj7m/Oejsbl2NlSAUqha8O2ug3sc4A9 zrpQbwN82rPO1daGapMm28VKKBZhnre74JPwSrAD02Jt7DnFrmP/ekVOW NiWiJCR3xe1G03rEdoYK4a3FU73ptMfhOcPek0xO078yAp7p/LF4zUYIL g==; X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="390623612" X-IronPort-AV: E=Sophos;i="6.03,304,1694761200"; d="scan'208";a="390623612" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2023 23:23:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="714800388" X-IronPort-AV: E=Sophos;i="6.03,304,1694761200"; d="scan'208";a="714800388" Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by orsmga003.jf.intel.com with ESMTP; 14 Nov 2023 23:23:23 -0800 From: Xiaoyao Li To: Paolo Bonzini , David Hildenbrand , Igor Mammedov , "Michael S . Tsirkin" , Marcel Apfelbaum , Richard Henderson , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Eric Blake , Markus Armbruster , Marcelo Tosatti Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, xiaoyao.li@intel.com, Michael Roth , Sean Christopherson , Claudio Fontana , Gerd Hoffmann , Isaku Yamahata , Chenyi Qiang Subject: [PATCH v3 62/70] i386/tdx: Don't allow system reset for TDX VMs Date: Wed, 15 Nov 2023 02:15:11 -0500 Message-Id: <20231115071519.2864957-63-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231115071519.2864957-1-xiaoyao.li@intel.com> References: <20231115071519.2864957-1-xiaoyao.li@intel.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 TDX CPU state is protected and thus vcpu state cann't be reset by VMM. Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann --- target/i386/kvm/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index f1c4dd759b3e..a74a0d8e0891 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -5675,7 +5675,7 @@ bool kvm_has_waitpkg(void) bool kvm_arch_cpu_check_are_resettable(void) { - return !sev_es_enabled(); + return !sev_es_enabled() && !is_tdx_vm(); } #define ARCH_REQ_XCOMP_GUEST_PERM 0x1025