All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable
@ 2024-04-16  6:50 Sergiy Kibrik
  2024-04-16  8:40 ` Teddy Astie
  2024-04-16  9:36 ` Andrew Cooper
  0 siblings, 2 replies; 5+ messages in thread
From: Sergiy Kibrik @ 2024-04-16  6:50 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>

Provide the user with configuration control over the cpu virtualization support
in Xen by making SVM and VMX options user selectable.

To preserve the current default behavior, both options depend on HVM and
default to Y.

To prevent users from unknowingly disabling virtualization support, make the
controls user selectable only if EXPERT is enabled.
Also make INTEL_IOMMU/AMD_IOMMU options dependant on VMX/SVM options.

No functional change intended.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
---
 xen/arch/x86/Kconfig            | 18 ++++++++++++++++--
 xen/drivers/passthrough/Kconfig |  4 ++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 6f06d3baa5..98a6f8d877 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -121,10 +121,24 @@ config HVM
 	  If unsure, say Y.
 
 config SVM
-	def_bool y if HVM
+	bool "AMD-V" if EXPERT
+	depends on HVM
+	default y
+	help
+	  Enables virtual machine extensions on platforms that implement the
+	  AMD Virtualization Technology (AMD-V).
+	  If your system includes a processor with AMD-V support, say Y.
+	  If in doubt, say Y.
 
 config VMX
-	def_bool y if HVM
+	bool "Intel VT-x" if EXPERT
+	depends on HVM
+	default y
+	help
+	  Enables virtual machine extensions on platforms that implement the
+	  Intel Virtualization Technology (Intel VT-x).
+	  If your system includes a processor with Intel VT-x support, say Y.
+	  If in doubt, say Y.
 
 config XEN_SHSTK
 	bool "Supervisor Shadow Stacks"
diff --git a/xen/drivers/passthrough/Kconfig b/xen/drivers/passthrough/Kconfig
index 864fcf3b0c..5f53639c2d 100644
--- a/xen/drivers/passthrough/Kconfig
+++ b/xen/drivers/passthrough/Kconfig
@@ -39,7 +39,7 @@ endif
 
 config AMD_IOMMU
 	bool "AMD IOMMU" if EXPERT
-	depends on X86
+	depends on X86 && SVM
 	default y
 	help
 	  Enables I/O virtualization on platforms that implement the
@@ -51,7 +51,7 @@ config AMD_IOMMU
 
 config INTEL_IOMMU
 	bool "Intel VT-d" if EXPERT
-	depends on X86
+	depends on X86 && VMX
 	default y
 	help
 	  Enables I/O virtualization on platforms that implement the
-- 
2.25.1



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

* Re: [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable
  2024-04-16  6:50 [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable Sergiy Kibrik
@ 2024-04-16  8:40 ` Teddy Astie
  2024-04-16 10:12   ` Sergiy Kibrik
  2024-04-16  9:36 ` Andrew Cooper
  1 sibling, 1 reply; 5+ messages in thread
From: Teddy Astie @ 2024-04-16  8:40 UTC (permalink / raw)
  To: Sergiy Kibrik, xen-devel
  Cc: Xenia Ragiadakou, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Stefano Stabellini

Hello Sergiy,

> Also make INTEL_IOMMU/AMD_IOMMU options dependant on VMX/SVM options.

The discussion in the RFC series stated the IOMMU may be used with PV 
guests, and doesn't rely on VMX/SVM support (in fact, it can be used 
without HVM support in Xen).

However, in the discussion, posted interrupts were supposed to be 
dependent on VMX/SVM instead. I suppose this is a leftover from the 
original RFC ?

> https://lore.kernel.org/xen-devel/e29e375f-3d30-0eb1-7e28-b93f2d831b43@suse.com/

Teddy

---


Teddy Astie | Vates XCP-ng Intern

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


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

* Re: [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable
  2024-04-16  6:50 [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable Sergiy Kibrik
  2024-04-16  8:40 ` Teddy Astie
@ 2024-04-16  9:36 ` Andrew Cooper
  2024-04-16 10:16   ` Sergiy Kibrik
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2024-04-16  9:36 UTC (permalink / raw)
  To: Sergiy Kibrik, xen-devel
  Cc: Xenia Ragiadakou, Jan Beulich, Roger Pau Monné,
	Xenia Ragiadakou, Stefano Stabellini

On 16/04/2024 7:50 am, Sergiy Kibrik wrote:
> From: Xenia Ragiadakou <burzalodowa@gmail.com>
>
> Provide the user with configuration control over the cpu virtualization support
> in Xen by making SVM and VMX options user selectable.
>
> To preserve the current default behavior, both options depend on HVM and
> default to Y.
>
> To prevent users from unknowingly disabling virtualization support, make the
> controls user selectable only if EXPERT is enabled.
> Also make INTEL_IOMMU/AMD_IOMMU options dependant on VMX/SVM options.

Everything else seems ok, but there's no inherent dependency between
VMX/SVM and IOMMUs.  There are certain features (HAP/IOMMU pagetable
sharing, posted interrupts) which do depend on both, but the vast
majority of functionality is independent.

It would be a legitimate config (although getting less plausible, these
days) to have PV && IOMMU && !HVM.

Furthermore, randconfig will do a better job without such restrictions
in place.

~Andrew


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

* Re: [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable
  2024-04-16  8:40 ` Teddy Astie
@ 2024-04-16 10:12   ` Sergiy Kibrik
  0 siblings, 0 replies; 5+ messages in thread
From: Sergiy Kibrik @ 2024-04-16 10:12 UTC (permalink / raw)
  To: Teddy Astie, xen-devel
  Cc: Xenia Ragiadakou, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Stefano Stabellini

hi Teddy,

16.04.24 11:40, Teddy Astie:
> Hello Sergiy,
> 
>> Also make INTEL_IOMMU/AMD_IOMMU options dependant on VMX/SVM options.
> 
> The discussion in the RFC series stated the IOMMU may be used with PV
> guests, and doesn't rely on VMX/SVM support (in fact, it can be used
> without HVM support in Xen).
> 
> However, in the discussion, posted interrupts were supposed to be
> dependent on VMX/SVM instead. I suppose this is a leftover from the
> original RFC ?
> 

oh, yes, this bit remained from original patch, and indeed shouldn't be 
here.
I shall drop it in v2.

  -Sergiy


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

* Re: [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable
  2024-04-16  9:36 ` Andrew Cooper
@ 2024-04-16 10:16   ` Sergiy Kibrik
  0 siblings, 0 replies; 5+ messages in thread
From: Sergiy Kibrik @ 2024-04-16 10:16 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel
  Cc: Jan Beulich, Roger Pau Monné, Xenia Ragiadakou,
	Stefano Stabellini

16.04.24 12:36, Andrew Cooper:
> 
> Everything else seems ok, but there's no inherent dependency between
> VMX/SVM and IOMMUs.  There are certain features (HAP/IOMMU pagetable
> sharing, posted interrupts) which do depend on both, but the vast
> majority of functionality is independent.
> 
> It would be a legitimate config (although getting less plausible, these
> days) to have PV && IOMMU && !HVM.
> 
> Furthermore, randconfig will do a better job without such restrictions
> in place.

understood. I'll make a patch instead to guard posted interrupts calls 
from iommu driver.

   -Sergiy


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

end of thread, other threads:[~2024-04-16 10:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-16  6:50 [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable Sergiy Kibrik
2024-04-16  8:40 ` Teddy Astie
2024-04-16 10:12   ` Sergiy Kibrik
2024-04-16  9:36 ` Andrew Cooper
2024-04-16 10:16   ` 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.