Message ID | 20240416062258.3468774-1-Sergiy_Kibrik@epam.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | x86: make cpu virtualization support configurable | expand |
On 16.04.2024 08:22, Sergiy Kibrik wrote: > --- 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(); Do we have or do we foresee any uses of cpu_has_{vmx,svm} that are relevant when CONFIG_{VMX,SVM}=n respectively? If not, I'd prefer if the IS_ENABLED() would be folded right into the definitions of cpu_has_{vmx,svm}, as is already done for a few other CONFIG_*. Jan
18.04.24 14:18, Jan Beulich: > On 16.04.2024 08:22, Sergiy Kibrik wrote: >> --- 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(); > > Do we have or do we foresee any uses of cpu_has_{vmx,svm} that are relevant > when CONFIG_{VMX,SVM}=n respectively? If not, I'd prefer if the IS_ENABLED() > would be folded right into the definitions of cpu_has_{vmx,svm}, as is > already done for a few other CONFIG_*. > > Jan looks nice, will do it -Sergiy
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 )