From patchwork Thu Jan 25 03:22:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 13529868 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 0F59F11712 for ; Thu, 25 Jan 2024 03:28:27 +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=1706153308; cv=none; b=kahJWhgNRMAI/J546Dj9r41w9yh7A7w+/P52eCV/C73BuzmwHh/DD48IL8MDkF6UJKPB5rWqzBl1h7/mW10Q0J9mU7VhVXkDkGGgyYmxr74gHj5pVRJBvv8T4ho0t0wk6gPkEvmxH1pxyN7do4G2Ly4x16cgv8w9VViki661PJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706153308; c=relaxed/simple; bh=MDV1CK+CwY5NNGZELqNeBXtymIPsaa9CAufkhjBYBw4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ub+iOqBI4w40nxD9AyS/uUvXhAlDJeo4RX664V3rByulMVm+lRNSS0f22hWZAtkQADmBKEZx8nORqhpqEJQ2z8xWmxGAspdpPj7wvaV8wSL+owHpHilewOdwegXuBT/HcBWmoIqQWslDhtrTwsw617VWHNnbTRaaWFkZL5nwzms= 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=R0du6TdZ; 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="R0du6TdZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706153307; x=1737689307; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MDV1CK+CwY5NNGZELqNeBXtymIPsaa9CAufkhjBYBw4=; b=R0du6TdZ1n6U/dvqSJhTEkDnMEMmz+NliLhPtaXR7i+9vwh7SDOIcDpM 6Q1J/aaW64tpaSjSr/U9qpz9aWihPO/OZvWqAtR0ET+caYb+XNLrQWlJH Da2eeTlhk1UItAcLPKM/g69jR5WKSwtN+WICKqOOdF0wwXD9DqrYHk1+u IGCOHIwkzdKcSRxKxJlsaRk+ycYD3EN3R6HAIhPXRCicSDYunYHfr5xxn i9u/m4i1kHqzxrJeyeEVBha20yRFloXwdV5oY1IOKg4kEPZrl5bqWwYx8 KttjUfMNoumiR0zxByhTyq88fPss7WvR+uLRrAepW/rUlGnIgXxvTdZek Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="9428467" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="9428467" 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:25:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="2085263" Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by orviesa005.jf.intel.com with ESMTP; 24 Jan 2024 19:25:11 -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 18/66] i386/tdx: Make Intel-PT unsupported for TD guest Date: Wed, 24 Jan 2024 22:22:40 -0500 Message-Id: <20240125032328.2522472-19-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 Due to the fact that Intel-PT virtualization support has been broken in QEMU since Sapphire Rapids generation[1], below warning is triggered when luanching TD guest: warning: host doesn't support requested feature: CPUID.07H:EBX.intel-pt [bit 25] Before Intel-pt is fixed in QEMU, just make Intel-PT unsupported for TD guest, to avoid the confusing warning. [1] https://lore.kernel.org/qemu-devel/20230531084311.3807277-1-xiaoyao.li@intel.com/ Signed-off-by: Xiaoyao Li --- Changes in v4: - newly added patch; --- target/i386/kvm/tdx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index a962f8a4ea60..2703e97f991d 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -292,6 +292,11 @@ void tdx_get_supported_cpuid(uint32_t function, uint32_t index, int reg, if (function == 1 && reg == R_ECX && !enable_cpu_pm) { *ret &= ~CPUID_EXT_MONITOR; } + + /* QEMU Intel-pt support is broken, don't advertise Intel-PT */ + if (function == 7 && reg == R_EBX) { + *ret &= ~CPUID_7_0_EBX_INTEL_PT; + } } enum tdx_ioctl_level{