From patchwork Tue Apr 16 06:37:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 13631376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFF80C4345F for ; Tue, 16 Apr 2024 06:38:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.706638.1103915 (Exim 4.92) (envelope-from ) id 1rwcS1-0006vp-4e; Tue, 16 Apr 2024 06:37:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 706638.1103915; Tue, 16 Apr 2024 06:37:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rwcS1-0006vi-1U; Tue, 16 Apr 2024 06:37:53 +0000 Received: by outflank-mailman (input) for mailman id 706638; Tue, 16 Apr 2024 06:37:51 +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 1rwcRz-0006va-Kf for xen-devel@lists.xenproject.org; Tue, 16 Apr 2024 06:37:51 +0000 Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d765debc-fbbb-11ee-94a3-07e782e9044d; Tue, 16 Apr 2024 08:37:49 +0200 (CEST) Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id D5B9D36586; Tue, 16 Apr 2024 02:37:47 -0400 (EDT) (envelope-from sakib@darkstar.site) Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id C0FCF36585; Tue, 16 Apr 2024 02:37:47 -0400 (EDT) (envelope-from sakib@darkstar.site) Received: from localhost (unknown [185.130.54.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id B4E8D36584; Tue, 16 Apr 2024 02:37:43 -0400 (EDT) (envelope-from sakib@darkstar.site) 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: d765debc-fbbb-11ee-94a3-07e782e9044d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; s=sasl; bh=9Zw6Q89ndDALDigv8IS7imOfjSDEUzFnmBNeSU/Q/xY=; b=TkFo iZVtU4VyBn+zFeGpwLM4tVTkkaKEk24s+noMTIIecFoQYYcN0/qF88jEOdpbfUGP xPeUlFnTYSUtcgPUHvHAn9UFBg6DGSTAbjbJu++eDUMhizYy2GNUATZtgG4W4AL1 /zEpyRGvmtrLETxN+mLc09NB1LcKxIDDkTkJuBo= From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Xenia Ragiadakou , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Xenia Ragiadakou , Stefano Stabellini , Sergiy Kibrik Subject: [XEN PATCH v1 09/15] x86/traps: guard vmx specific functions with CONFIG_VMX Date: Tue, 16 Apr 2024 09:37:40 +0300 Message-Id: <20240416063740.3469592-1-Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Pobox-Relay-ID: D47E1B62-FBBB-11EE-BE54-F515D2CDFF5E-90055647!pb-smtp20.pobox.com From: Xenia Ragiadakou The functions vmx_vmcs_enter() and vmx_vmcs_exit() are VT-x specific. Guard their calls with CONFIG_VMX. No functional change intended. Signed-off-by: Xenia Ragiadakou Signed-off-by: Sergiy Kibrik --- xen/arch/x86/traps.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index d554c9d41e..218eb5b322 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -676,7 +676,6 @@ void vcpu_show_execution_state(struct vcpu *v) vcpu_pause(v); /* acceptably dangerous */ -#ifdef CONFIG_HVM /* * For VMX special care is needed: Reading some of the register state will * require VMCS accesses. Engaging foreign VMCSes involves acquiring of a @@ -684,12 +683,11 @@ void vcpu_show_execution_state(struct vcpu *v) * region. Despite this being a layering violation, engage the VMCS right * here. This then also avoids doing so several times in close succession. */ - if ( cpu_has_vmx && is_hvm_vcpu(v) ) + if ( IS_ENABLED(CONFIG_VMX) && cpu_has_vmx && is_hvm_vcpu(v) ) { ASSERT(!in_irq()); vmx_vmcs_enter(v); } -#endif /* Prevent interleaving of output. */ flags = console_lock_recursive_irqsave(); @@ -714,10 +712,8 @@ void vcpu_show_execution_state(struct vcpu *v) console_unlock_recursive_irqrestore(flags); } -#ifdef CONFIG_HVM - if ( cpu_has_vmx && is_hvm_vcpu(v) ) + if ( IS_ENABLED(CONFIG_VMX) && cpu_has_vmx && is_hvm_vcpu(v) ) vmx_vmcs_exit(v); -#endif vcpu_unpause(v); }