Skip to contentSkip to conversation

x86: Fix AMD_SVM and INTEL_VMX dependency

PATCH Superseded Michal Orzel 2 participants 4 messages Sep 1, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Fix AMD_SVM and INTEL_VMX dependency

Commit e3ed540f2e9f was meant to make AMD_SVM dependent on AMD and INTEL_VMX on INTEL. Such dependency should be done using 'depends on' and not 'if' next to prompt that deals only with the visibility of the given Kconfig option. This makes it impossible to e.g. disable INTEL_VMX when INTEL is disabled (option is hidden).

Fixes e3ed540f2e9f ("x86/hvm: add HVM-specific Kconfig")
---
 xen/arch/x86/hvm/Kconfig | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
xen/arch/x86/hvm/Kconfig +4 -2
index b903764bda0d..c85889ea8642 100644
@@ -16,7 +16,8 @@ menuconfig HVM
 if HVM
 
 config AMD_SVM
-	bool "AMD-V" if AMD && EXPERT
+	bool "AMD-V" if EXPERT
+	depends on AMD
 	default y
 	help
 	  Enables virtual machine extensions on platforms that implement the
@@ -25,7 +26,8 @@ config AMD_SVM
 	  If in doubt, say Y.
 
 config INTEL_VMX
-	bool "Intel VT-x" if INTEL && EXPERT
+	bool "Intel VT-x" if EXPERT
+	depends on INTEL
 	default y
 	select ARCH_VCPU_IOREQ_COMPLETION
 	help
Signature · 1 line
2.43.0
#1 lore raw
Quoted 5 lines · Michal Orzel

Commit e3ed540f2e9f was meant to make AMD_SVM dependent on AMD and INTEL_VMX on INTEL. Such dependency should be done using 'depends on' and not 'if' next to prompt that deals only with the visibility of the given Kconfig option. This makes it impossible to e.g. disable INTEL_VMX when INTEL is disabled (option is hidden).

Hmm, yes, just that ...

Quoted 13 lines
xen/arch/x86/hvm/Kconfig +2 -1
@@ -16,7 +16,8 @@ menuconfig HVM
 if HVM
 
 config AMD_SVM
-	bool "AMD-V" if AMD && EXPERT
+	bool "AMD-V" if EXPERT
+	depends on AMD
 	default y
 	help
 	  Enables virtual machine extensions on platforms that implement the

xen/arch/x86/hvm/Kconfig config AMD_SVM · line 33

Quoted 9 lines
xen/arch/x86/hvm/Kconfig +2 -1
@@ -25,7 +26,8 @@ config AMD_SVM
 	  If in doubt, say Y.
 
 config INTEL_VMX
-	bool "Intel VT-x" if INTEL && EXPERT
+	bool "Intel VT-x" if EXPERT
+	depends on INTEL
 	default y
 	select ARCH_VCPU_IOREQ_COMPLETION
 	help

... now it becomes impossible to _enable_ INTEL_VMX when INTEL is disabled, yet which may be of interest if you target some other vendor's VMX implementation. Perhaps really we should have

config INTEL_VMX
bool "Intel VT-x" if EXPERT
default INTEL

?

Jan

#2 lore raw
Quoted 36 lines · Jan Beulich
Quoted 5 lines · Michal Orzel

Commit e3ed540f2e9f was meant to make AMD_SVM dependent on AMD and INTEL_VMX on INTEL. Such dependency should be done using 'depends on' and not 'if' next to prompt that deals only with the visibility of the given Kconfig option. This makes it impossible to e.g. disable INTEL_VMX when INTEL is disabled (option is hidden).

Hmm, yes, just that ...

Quoted 13 lines
xen/arch/x86/hvm/Kconfig +2 -1
@@ -16,7 +16,8 @@ menuconfig HVM
 if HVM
 
 config AMD_SVM
-	bool "AMD-V" if AMD && EXPERT
+	bool "AMD-V" if EXPERT
+	depends on AMD
 	default y
 	help
 	  Enables virtual machine extensions on platforms that implement the

xen/arch/x86/hvm/Kconfig config AMD_SVM · line 33

Quoted 9 lines
xen/arch/x86/hvm/Kconfig +2 -1
@@ -25,7 +26,8 @@ config AMD_SVM
 	  If in doubt, say Y.
 
 config INTEL_VMX
-	bool "Intel VT-x" if INTEL && EXPERT
+	bool "Intel VT-x" if EXPERT
+	depends on INTEL
 	default y
 	select ARCH_VCPU_IOREQ_COMPLETION
 	help

... now it becomes impossible to _enable_ INTEL_VMX when INTEL is disabled, yet which may be of interest if you target some other vendor's VMX implementation. Perhaps really we should have

Quoted 3 lines

config INTEL_VMX
bool "Intel VT-x" if EXPERT
default INTEL

I did not think such configuration makes sense (VMX without INTEL) which is in line with the last sentence from the mentioned commit. I'm ok either way.

~Michal

#3 lore raw
Quoted 39 lines · Michal
Quoted 36 lines · Jan Beulich
Quoted 5 lines · Michal Orzel

Commit e3ed540f2e9f was meant to make AMD_SVM dependent on AMD and INTEL_VMX on INTEL. Such dependency should be done using 'depends on' and not 'if' next to prompt that deals only with the visibility of the given Kconfig option. This makes it impossible to e.g. disable INTEL_VMX when INTEL is disabled (option is hidden).

Hmm, yes, just that ...

Quoted 13 lines
xen/arch/x86/hvm/Kconfig +2 -1
@@ -16,7 +16,8 @@ menuconfig HVM
 if HVM
 
 config AMD_SVM
-	bool "AMD-V" if AMD && EXPERT
+	bool "AMD-V" if EXPERT
+	depends on AMD
 	default y
 	help
 	  Enables virtual machine extensions on platforms that implement the

xen/arch/x86/hvm/Kconfig config AMD_SVM · line 33

Quoted 9 lines
xen/arch/x86/hvm/Kconfig +2 -1
@@ -25,7 +26,8 @@ config AMD_SVM
 	  If in doubt, say Y.
 
 config INTEL_VMX
-	bool "Intel VT-x" if INTEL && EXPERT
+	bool "Intel VT-x" if EXPERT
+	depends on INTEL
 	default y
 	select ARCH_VCPU_IOREQ_COMPLETION
 	help

... now it becomes impossible to _enable_ INTEL_VMX when INTEL is disabled, yet which may be of interest if you target some other vendor's VMX implementation. Perhaps really we should have

Quoted 5 lines
Quoted 3 lines

config INTEL_VMX
bool "Intel VT-x" if EXPERT
default INTEL

I did not think such configuration makes sense (VMX without INTEL) which is in line with the last sentence from the mentioned commit.

Just like Hygon CPUs support AMD's SVM (which we cover), VIA's and Shanghai iirc support VMX (which we don't cover very well, but which we also shouldn't break knowingly).

Jan