From patchwork Tue Apr 16 06:22:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 13631351 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 8F3EBC4345F for ; Tue, 16 Apr 2024 06:23:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.706594.1103832 (Exim 4.92) (envelope-from ) id 1rwcDl-0008PO-2i; Tue, 16 Apr 2024 06:23:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 706594.1103832; Tue, 16 Apr 2024 06:23:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rwcDk-0008PH-Uk; Tue, 16 Apr 2024 06:23:08 +0000 Received: by outflank-mailman (input) for mailman id 706594; Tue, 16 Apr 2024 06:23:07 +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 1rwcDj-0008OO-Pa for xen-devel@lists.xenproject.org; Tue, 16 Apr 2024 06:23:07 +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 c8af5c23-fbb9-11ee-94a3-07e782e9044d; Tue, 16 Apr 2024 08:23:05 +0200 (CEST) Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 3D499364D0; Tue, 16 Apr 2024 02:23:04 -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 16B97364CF; Tue, 16 Apr 2024 02:23:04 -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 246A6364CD; Tue, 16 Apr 2024 02:23:00 -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: c8af5c23-fbb9-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=nVGF93SwVxjmd/Ty6DZ8L8PrhTbVuUWdW/P91kcIR4Y=; b=Dhoe hpAsN9S9fZki+jlw7w7X7i9TxdD9gVrOXbzlqTCM2vOy0Wgz1J+Dsc/ZEaLjkdlr BNOzj1Shg0ZyuOL50hS4DntD7//ocr5rI6y7nhHZBg/CP/iH11GFeV1WPkyMgA6w eNmikVRcJR3inQ9X/rJijvPswG0NysRfY4OeOdA= 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 02/15] x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers Date: Tue, 16 Apr 2024 09:22:58 +0300 Message-Id: <20240416062258.3468774-1-Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Pobox-Relay-ID: C66D5B70-FBB9-11EE-9473-F515D2CDFF5E-90055647!pb-smtp20.pobox.com From: Xenia Ragiadakou Since start_svm() is AMD-V specific while start_vmx() is Intel VT-x specific, one can be excluded from build completely with CONFIG_SVM and CONFIG_VMX, respectively. No functional change intended. Signed-off-by: Xenia Ragiadakou Signed-off-by: Sergiy Kibrik --- xen/arch/x86/hvm/hvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 0ce45b177c..3edbe03caf 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -156,9 +156,9 @@ static int __init cf_check hvm_enable(void) { const struct hvm_function_table *fns = NULL; - if ( cpu_has_vmx ) + if ( IS_ENABLED(CONFIG_VMX) && cpu_has_vmx ) fns = start_vmx(); - else if ( cpu_has_svm ) + else if ( IS_ENABLED(CONFIG_SVM) && cpu_has_svm ) fns = start_svm(); if ( fns == NULL )