[XEN PATCH v3 06/16] x86/nestedhvm: switch to using_{svm,vmx} check

Sergiy Kibrik posted 16 patches 5 months, 3 weeks ago
[XEN PATCH v3 06/16] x86/nestedhvm: switch to using_{svm,vmx} check
Posted by Sergiy Kibrik 5 months, 3 weeks ago
Use using_{svm,vmx} instead of cpu_has_{svm,vmx} that not only checks if CPU
supports corresponding virtialization technology, but also if it is
supported by build configuration.

This fixes build when VMX=n or SVM=n, because then start_nested_{svm,vmx}
routine(s) not available.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
---
 xen/arch/x86/hvm/nestedhvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c
index 451c4da6d4..008dddf801 100644
--- a/xen/arch/x86/hvm/nestedhvm.c
+++ b/xen/arch/x86/hvm/nestedhvm.c
@@ -155,9 +155,9 @@ static int __init cf_check nestedhvm_setup(void)
      * done, so that if (for example) HAP is disabled, nested virt is
      * disabled as well.
      */
-    if ( cpu_has_vmx )
+    if ( using_vmx )
         start_nested_vmx(&hvm_funcs);
-    else if ( cpu_has_svm )
+    else if ( using_svm )
         start_nested_svm(&hvm_funcs);
 
     return 0;
-- 
2.25.1
Re: [XEN PATCH v3 06/16] x86/nestedhvm: switch to using_{svm,vmx} check
Posted by Jan Beulich 5 months, 2 weeks ago
On 03.06.2024 13:18, Sergiy Kibrik wrote:
> Use using_{svm,vmx} instead of cpu_has_{svm,vmx} that not only checks if CPU
> supports corresponding virtialization technology, but also if it is
> supported by build configuration.
> 
> This fixes build when VMX=n or SVM=n, because then start_nested_{svm,vmx}
> routine(s) not available.
> 
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
preferably, as said there, with the introduction of those macros
moved here, and title/description adjusted accordingly.

Jan