All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH v1 02/15] x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers
@ 2024-04-16  6:22 Sergiy Kibrik
  2024-04-18 11:18 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Sergiy Kibrik @ 2024-04-16  6:22 UTC (permalink / raw)
  To: xen-devel
  Cc: Xenia Ragiadakou, Jan Beulich, Andrew Cooper,
	Roger Pau Monné,
	Xenia Ragiadakou, Stefano Stabellini, Sergiy Kibrik

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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [XEN PATCH v1 02/15] x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers
  2024-04-16  6:22 [XEN PATCH v1 02/15] x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers Sergiy Kibrik
@ 2024-04-18 11:18 ` Jan Beulich
  2024-04-19  8:19   ` Sergiy Kibrik
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2024-04-18 11:18 UTC (permalink / raw)
  To: Sergiy Kibrik
  Cc: Xenia Ragiadakou, Andrew Cooper, Roger Pau Monné,
	Xenia Ragiadakou, Stefano Stabellini, xen-devel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [XEN PATCH v1 02/15] x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers
  2024-04-18 11:18 ` Jan Beulich
@ 2024-04-19  8:19   ` Sergiy Kibrik
  0 siblings, 0 replies; 3+ messages in thread
From: Sergiy Kibrik @ 2024-04-19  8:19 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Andrew Cooper, Roger Pau Monné,
	Xenia Ragiadakou, Stefano Stabellini, xen-devel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-19  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16  6:22 [XEN PATCH v1 02/15] x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers Sergiy Kibrik
2024-04-18 11:18 ` Jan Beulich
2024-04-19  8:19   ` Sergiy Kibrik

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.