From nobody Sat Apr 5 15:03:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1743515840; cv=none; d=zohomail.com; s=zohoarc; b=Ix02PCi+3ww2UuLpihXX7Do09fvO5qBbWEdJaK39ms4H2Iha0Uyee+9zk9OfuzVwWIUZXijSfAeFq3iN8bpS2jEtmc8oTP/w5Ny1iu+mN35rIMYeoVDjfuIGThOpvOU6pv/EPf3n/IzY6DgEzz6ZqqZamhPFs2Asqf5aosE0whY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743515840; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1cZKQsUPXHz10fvO+pSiPFJja10cTTzv7yMS/jDUqQY=; b=JQzXoi3SfjXgguubA54/fHSKDAffpsk1WXMLzHh8aaqsaZRJgyAqle6UcmAcHGq4xOuZjRn3EPXVzAOH6q9Ic2T6QvdRk7vpWjkwXUK4MYkCmw2alpExyZ467g9xQCzIbcEK5fMlwMMm+1lJ6IHZYcH9K3LW5aeTCvX6OjS2XpA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1743515840128203.07439648302386; Tue, 1 Apr 2025 06:57:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzbyY-00050a-LI; Tue, 01 Apr 2025 09:48:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tzbuL-0000ZM-Jf for qemu-devel@nongnu.org; Tue, 01 Apr 2025 09:44:06 -0400 Received: from mgamail.intel.com ([192.198.163.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tzbuJ-0006ZP-Rw for qemu-devel@nongnu.org; Tue, 01 Apr 2025 09:44:01 -0400 Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2025 06:42:48 -0700 Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by fmviesa008.fm.intel.com with ESMTP; 01 Apr 2025 06:42:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1743515040; x=1775051040; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UW3eh1d/yIqkVIs20XJ3rA7CLhgkMPTvF23AkfBXCms=; b=f12gi7RDaKgFxp+X/UmzWttVBoQ7Srja+SoU/Ri/2F2ir/mdAuEyolI0 970X6uKp5W8Roa9VmJyNICrlYFscvi29C29duquwq4dj7s4RwB5qHz0l2 FTwcfzBw87UK2tnC1g0JR502mTwK/ULWJqblBgXJ1EUPZX4uVKdt4SC9r 8TX4mSPCBmptSr89x+QbuBe6vjWSPJ5DZLEnZUBCAcJWqCyapbo7tDq4S azO5boeXxc7pNN1KyC0ZQ7nCzHWcGPo2WXtj3+glMXUCX4qk54fjtjnCi +7YPuyqbFzHQgMpxlx8nds05Gm5VuhPAjpTw3RAMX1QE2iHE+zjjelO2X Q==; X-CSE-ConnectionGUID: lBlblmw3Sa+wCTRyhtftoA== X-CSE-MsgGUID: F0AdUXtbSDufEeYvTuBrhg== X-IronPort-AV: E=McAfee;i="6700,10204,11391"; a="32433483" X-IronPort-AV: E=Sophos;i="6.14,293,1736841600"; d="scan'208";a="32433483" X-CSE-ConnectionGUID: X8AXFYTmRp+31arsHcsM1A== X-CSE-MsgGUID: szIn5RjrShO/5hmlcbC1Bw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,293,1736841600"; d="scan'208";a="126640150" From: Xiaoyao Li To: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Cc: "Michael S. Tsirkin" , Markus Armbruster , Francesco Lavra , Marcelo Tosatti , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rick Edgecombe , Xiaoyao Li Subject: [PATCH v8 38/55] i386/tdx: Set and check kernel_irqchip mode for TDX Date: Tue, 1 Apr 2025 09:01:48 -0400 Message-Id: <20250401130205.2198253-39-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250401130205.2198253-1-xiaoyao.li@intel.com> References: <20250401130205.2198253-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.198.163.16; envelope-from=xiaoyao.li@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.997, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.999, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1743515842760019100 KVM mandates kernel_irqchip to be split mode. Set it to split mode automatically when users don't provide an explicit value, otherwise check it to be the split mode. Suggested-by: Daniel P. Berrang=C3=A9 Signed-off-by: Xiaoyao Li Reviewed-by: Daniel P. Berrang=C3=A9 --- target/i386/kvm/tdx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 0d30506c2021..4128f27d6b64 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -16,6 +16,7 @@ #include "qapi/error.h" #include "qom/object_interfaces.h" #include "crypto/hash.h" +#include "system/kvm_int.h" #include "system/runstate.h" #include "system/system.h" #include "exec/ramblock.h" @@ -390,6 +391,13 @@ static int tdx_kvm_init(ConfidentialGuestSupport *cgs,= Error **errp) return -EINVAL; } =20 + if (kvm_state->kernel_irqchip_split =3D=3D ON_OFF_AUTO_AUTO ) { + kvm_state->kernel_irqchip_split =3D ON_OFF_AUTO_ON; + } else if(kvm_state->kernel_irqchip_split !=3D ON_OFF_AUTO_ON) { + error_setg(errp, "TDX VM requires kernel_irqchip to be split"); + return -EINVAL; + } + if (!tdx_caps) { r =3D get_tdx_capabilities(errp); if (r) { --=20 2.34.1