All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: "Xenia Ragiadakou" <burzalodowa@gmail.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Xenia Ragiadakou" <xenia.ragiadakou@amd.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Sergiy Kibrik" <Sergiy_Kibrik@epam.com>
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	[thread overview]
Message-ID: <20240416062258.3468774-1-Sergiy_Kibrik@epam.com> (raw)

From: Xenia Ragiadakou <burzalodowa@gmail.com>

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 <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
---
 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 )
-- 
2.25.1



             reply	other threads:[~2024-04-16  6:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  6:22 Sergiy Kibrik [this message]
2024-04-18 11:18 ` [XEN PATCH v1 02/15] x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers Jan Beulich
2024-04-19  8:19   ` Sergiy Kibrik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240416062258.3468774-1-Sergiy_Kibrik@epam.com \
    --to=sergiy_kibrik@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=burzalodowa@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xenia.ragiadakou@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.