From nobody Fri Dec 19 07:21:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1747156250; cv=none; d=zohomail.com; s=zohoarc; b=CDhxipJchsrkTbcNaXmUf8tDsuvfrazLLDMlppfvRAF97orbYjK+3HMvmergPFp007Sc1ySACn4M910IgE8bqN19YKu3pw8KSHCEXpxwriyLom4pPVQ5GcxE4B5N4rRNRxG9Wv3zGcs2XpgixOlE4IzJy3CMIJx9oxA0akb0mfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747156250; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QnIKAND7PaaYiBZpdm/P7GTarwHPzvaPJ5XCEeh+pOQ=; b=aIWqJ7w8JZpNSAi6O4Y5X111v2xtRGX+3cmSc7wF+imOzJFP7fHtwjgXi5/GAtpE+229YM/RgW4dbpVBQ2qtfvYd89F7l8UWDqBqWAOtWdKH0DtpvjTivvaTqpVEzHeTMd6zqni97ZceI41iRPHIKXitu2S5ZZjLGtlvVuuw1yY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1747156250372497.27858030246637; Tue, 13 May 2025 10:10:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.983245.1369606 (Exim 4.92) (envelope-from ) id 1uEt9M-0000XT-A0; Tue, 13 May 2025 17:10:40 +0000 Received: by outflank-mailman (output) from mailman id 983245.1369606; Tue, 13 May 2025 17:10:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uEt9M-0000W0-66; Tue, 13 May 2025 17:10:40 +0000 Received: by outflank-mailman (input) for mailman id 983245; Tue, 13 May 2025 17:10:38 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uEt5n-0003Uz-2u for xen-devel@lists.xenproject.org; Tue, 13 May 2025 17:06:59 +0000 Received: from 1.mo575.mail-out.ovh.net (1.mo575.mail-out.ovh.net [46.105.41.146]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ad499f14-301c-11f0-9ffb-bf95429c2676; Tue, 13 May 2025 19:06:57 +0200 (CEST) Received: from director10.ghost.mail-out.ovh.net (unknown [10.108.17.234]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4ZxjZ903vYz1sPK for ; Tue, 13 May 2025 17:06:56 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-frdbc (unknown [10.110.118.120]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 53D9C1FE02; Tue, 13 May 2025 17:06:56 +0000 (UTC) Received: from 3mdeb.com ([37.59.142.114]) by ghost-submission-5b5ff79f4f-frdbc with ESMTPSA id zV6+ADB8I2jomQcAYR2MaQ (envelope-from ); Tue, 13 May 2025 17:06:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ad499f14-301c-11f0-9ffb-bf95429c2676 Authentication-Results: garm.ovh; auth=pass (GARM-114S00879e9d5e9-aa55-4b5a-911e-f42410b055f4, 0F27B6D195039ACFBDF5EC7F2AC12BEA7E98F15C) smtp.auth=sergii.dmytruk@3mdeb.com X-OVh-ClientIp: 176.111.181.178 From: Sergii Dmytruk To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , trenchboot-devel@googlegroups.com Subject: [PATCH v2 12/22] x86/hvm: check for VMX in SMX if Slaunch is active Date: Tue, 13 May 2025 20:05:49 +0300 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 8948652463133537436 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftdegieeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefuvghrghhiihcuffhmhihtrhhukhcuoehsvghrghhiihdrughmhihtrhhukhesfehmuggvsgdrtghomheqnecuggftrfgrthhtvghrnhepgeekffeiiedtveekhfdugeffveeigefgleegvdeghefftdetheefueeliedukedvnecukfhppeduvdejrddtrddtrddupddujeeirdduuddurddukedurddujeekpdefjedrheelrddugedvrdduudegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehsvghrghhiihdrughmhihtrhhukhesfehmuggvsgdrtghomhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeigvghnqdguvghvvghlsehlihhsthhsrdigvghnphhrohhjvggtthdrohhrghdpoffvtefjohhsthepmhhoheejhegmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=QnIKAND7PaaYiBZpdm/P7GTarwHPzvaPJ5XCEeh+pOQ=; c=relaxed/relaxed; d=3mdeb.com; h=From; s=ovhmo3617313-selector1; t=1747156017; v=1; b=VzxWWIYxhIyfqWtPHgEDUu+GFg49EFzsOGB3xjFxv8UTm08ad5Ir1uP3XX78Kfm7N/jGXYZC QWqrlcWUyU37SGZxEuJ72cF4Qq5sV169PW7JihtnDDOa2TZpwNdPSVo0f0JMU+ONlpP5EEwfYRt 2fKUVM4uM5DKQUEy4CkUdHJoq6NnBpEJVzOZiAdCQv5L4+OJ4InKO1+UA2wk+MaQSHEAXIFDleN 7N/bbyBR3nin47UZjjY53EVqHwpVd0RHkJOzZZ1xTAIf8TVl2l/u5SFAdRX9ZkB1eaOdN11XQli FN63Wo8gZetsyBPrmzNrZbERO/eersj7ia+9BYB2kWPpg== X-ZohoMail-DKIM: pass (identity @3mdeb.com) X-ZM-MESSAGEID: 1747156251038116600 From: Micha=C5=82 =C5=BBygowski Check whther IA32_FEATURE_CONTROL has the proper bits enabled to run VMX in SMX when slaunch is active. Signed-off-by: Micha=C5=82 =C5=BBygowski --- xen/arch/x86/hvm/vmx/vmcs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c index a44475ae15..ef38903775 100644 --- a/xen/arch/x86/hvm/vmx/vmcs.c +++ b/xen/arch/x86/hvm/vmx/vmcs.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -724,7 +725,7 @@ static int _vmx_cpu_up(bool bsp) bios_locked =3D !!(eax & IA32_FEATURE_CONTROL_LOCK); if ( bios_locked ) { - if ( !(eax & (tboot_in_measured_env() + if ( !(eax & (tboot_in_measured_env() || slaunch_active ? IA32_FEATURE_CONTROL_ENABLE_VMXON_INSIDE_SMX : IA32_FEATURE_CONTROL_ENABLE_VMXON_OUTSIDE_SMX)) ) { --=20 2.49.0