From patchwork Thu Jan 25 03:23:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 13529909 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 416BE8830 for ; Thu, 25 Jan 2024 03:31:08 +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=1706153469; cv=none; b=r8oS6qYe5Xwfcs2PurgYPHzAl5Qn61juaYpofuGhK3b2T4eimwlQFY9VrVIuBBfh5ZsBtGCatO+4+KG4UqDUGeO2V487iKEUbKy1QHBkFrSb5lBqYv1sOrtYQneTKpl6X/TWocSbS+leBFJ1NYaFmtqYwLl/q22DPKrhv/+Uu30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706153469; c=relaxed/simple; bh=06fQye4ab2G7q75ZKWk8jLhdTnPCEpYY476w3krl16E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sEBVRKOzCiqul3oY8dR5+qHBmVUtY/QLLdbB5+sg5S+NnbDFnOy5XO0GnN+LAqttIM0lDtxo+seh6z7w16WfLKO+C0WCwlIoegRpiK3iL7n2UhgX/m6Y+tLzTFKVxUeETc7oBx7fFnbvNmUEmEa2VV5nClkpSnDbyD1CaL3BatI= 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=WNlHprzy; arc=none smtp.client-ip=192.198.163.10 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WNlHprzy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706153468; x=1737689468; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=06fQye4ab2G7q75ZKWk8jLhdTnPCEpYY476w3krl16E=; b=WNlHprzyDPOBWQhDPVrCvvWRGnytKoGjsJAh0APYXAkmxiw3B6Ic5WUJ v9fiQ3qu1uuQW6wKzge3rdk6slbuO4UwNjeWh0JKeJLYT5/+egI+22IL8 6QoP1ZybeYoH1VNNy+bK7D66ZYC3zQo/HtI4h5A5lHAPtqLMAhtplmucG Zb9c39VEuyMnbqZNKI9vxF6g8RFClkrzGmAQqQ1ZAH75dsj2zGNCyNm+q NsBqqKS6NNy5FARAKUcCHt+ErfwWOlA63ydcbumYMPzqsroan+zKPd/LX 1dcKN5/QS0fVHZC1ZzZxfiamJiPVPyvejcV5a/6pDbX8ToL+r118Vc/NL w==; X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="9430379" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="9430379" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2024 19:28:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="2086449" Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by orviesa005.jf.intel.com with ESMTP; 24 Jan 2024 19:28:50 -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 v4 58/66] i386/tdx: Don't allow system reset for TDX VMs Date: Wed, 24 Jan 2024 22:23:20 -0500 Message-Id: <20240125032328.2522472-59-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240125032328.2522472-1-xiaoyao.li@intel.com> References: <20240125032328.2522472-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 e36ece874246..0ec0584d22ca 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -5686,7 +5686,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