Message ID | 20221219063456.2017996-2-burzalodowa@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Proposal to make x86 IOMMU driver support configurable | expand |
On 19/12/2022 6:34 am, Xenia Ragiadakou wrote: > diff --git a/xen/drivers/passthrough/Kconfig b/xen/drivers/passthrough/Kconfig > index 479d7de57a..82465aa627 100644 > --- a/xen/drivers/passthrough/Kconfig > +++ b/xen/drivers/passthrough/Kconfig > @@ -37,6 +37,22 @@ config IPMMU_VMSA > > endif > > +config AMD_IOMMU > + bool "AMD IOMMU" > + depends on X86 > + default y > + ---help--- We're trying to phase out ---help---, so please just use help. ~Andrew
On 19.12.2022 07:34, Xenia Ragiadakou wrote: > Currently, for x86 platforms, Xen does not provide to the users any > configuration control over the IOMMU support and can only be built with > both AMD and Intel IOMMU drivers enabled. > However, there are use cases, e.g in safety-critical systems, that require > Xen to be able to be configured to exclude unused code. A smaller tailored > configuration would help Xen to meet faster certification requirements for > individual platforms. > > Introduce two new Kconfig options, AMD_IOMMU and INTEL_VTD, to allow code > specific to each IOMMU technology to be separated and, when not required, > stripped. AMD_IOMMU enables IOMMU support for platforms that implement the > AMD I/O Virtualization Technology. INTEL_VTD enables IOMMU support for > platforms that implement the Intel Virtualization Technology for Directed I/O. > > Since no functional change is intended regarding the default configuration > of an x86 system, both options depend on x86 and default to 'y'. But do things also build successfully when one or both options are disabled? I have to say that I would be quite surprised if that worked without further adjustments. In which case initially these options want to be prompt-less, with the prompts only added once 'n' also works. Jan
On 12/20/22 12:26, Andrew Cooper wrote: > On 19/12/2022 6:34 am, Xenia Ragiadakou wrote: >> diff --git a/xen/drivers/passthrough/Kconfig b/xen/drivers/passthrough/Kconfig >> index 479d7de57a..82465aa627 100644 >> --- a/xen/drivers/passthrough/Kconfig >> +++ b/xen/drivers/passthrough/Kconfig >> @@ -37,6 +37,22 @@ config IPMMU_VMSA >> >> endif >> >> +config AMD_IOMMU >> + bool "AMD IOMMU" >> + depends on X86 >> + default y >> + ---help--- > > We're trying to phase out ---help---, so please just use help. Ok. > > ~Andrew
On 12/20/22 19:01, Jan Beulich wrote: > On 19.12.2022 07:34, Xenia Ragiadakou wrote: >> Currently, for x86 platforms, Xen does not provide to the users any >> configuration control over the IOMMU support and can only be built with >> both AMD and Intel IOMMU drivers enabled. >> However, there are use cases, e.g in safety-critical systems, that require >> Xen to be able to be configured to exclude unused code. A smaller tailored >> configuration would help Xen to meet faster certification requirements for >> individual platforms. >> >> Introduce two new Kconfig options, AMD_IOMMU and INTEL_VTD, to allow code >> specific to each IOMMU technology to be separated and, when not required, >> stripped. AMD_IOMMU enables IOMMU support for platforms that implement the >> AMD I/O Virtualization Technology. INTEL_VTD enables IOMMU support for >> platforms that implement the Intel Virtualization Technology for Directed I/O. >> >> Since no functional change is intended regarding the default configuration >> of an x86 system, both options depend on x86 and default to 'y'. > > But do things also build successfully when one or both options are disabled? > I have to say that I would be quite surprised if that worked without further > adjustments. In which case initially these options want to be prompt-less, > with the prompts only added once 'n' also works. Without applying the whole series, disabling any of them or both won't work. Ok. > > Jan
On 20/12/2022 8:57 pm, Xenia Ragiadakou wrote: > > On 12/20/22 19:01, Jan Beulich wrote: >> On 19.12.2022 07:34, Xenia Ragiadakou wrote: >>> Currently, for x86 platforms, Xen does not provide to the users any >>> configuration control over the IOMMU support and can only be built with >>> both AMD and Intel IOMMU drivers enabled. >>> However, there are use cases, e.g in safety-critical systems, that >>> require >>> Xen to be able to be configured to exclude unused code. A smaller >>> tailored >>> configuration would help Xen to meet faster certification >>> requirements for >>> individual platforms. >>> >>> Introduce two new Kconfig options, AMD_IOMMU and INTEL_VTD, to allow >>> code >>> specific to each IOMMU technology to be separated and, when not >>> required, >>> stripped. AMD_IOMMU enables IOMMU support for platforms that >>> implement the >>> AMD I/O Virtualization Technology. INTEL_VTD enables IOMMU support for >>> platforms that implement the Intel Virtualization Technology for >>> Directed I/O. >>> >>> Since no functional change is intended regarding the default >>> configuration >>> of an x86 system, both options depend on x86 and default to 'y'. >> >> But do things also build successfully when one or both options are >> disabled? >> I have to say that I would be quite surprised if that worked without >> further >> adjustments. In which case initially these options want to be >> prompt-less, >> with the prompts only added once 'n' also works. > > Without applying the whole series, disabling any of them or both won't > work. Ok. To do a multi-step implementation, you start with config FOO bool y then rearrange them main code to use CONFIG_FOO as appropriate, then have a final patch that adds a Kconfig name, help text, etc which is what makes the config option user selectable and able to be turned off. ~Andrew
On 12/20/22 23:00, Andrew Cooper wrote: > On 20/12/2022 8:57 pm, Xenia Ragiadakou wrote: >> >> On 12/20/22 19:01, Jan Beulich wrote: >>> On 19.12.2022 07:34, Xenia Ragiadakou wrote: >>>> Currently, for x86 platforms, Xen does not provide to the users any >>>> configuration control over the IOMMU support and can only be built with >>>> both AMD and Intel IOMMU drivers enabled. >>>> However, there are use cases, e.g in safety-critical systems, that >>>> require >>>> Xen to be able to be configured to exclude unused code. A smaller >>>> tailored >>>> configuration would help Xen to meet faster certification >>>> requirements for >>>> individual platforms. >>>> >>>> Introduce two new Kconfig options, AMD_IOMMU and INTEL_VTD, to allow >>>> code >>>> specific to each IOMMU technology to be separated and, when not >>>> required, >>>> stripped. AMD_IOMMU enables IOMMU support for platforms that >>>> implement the >>>> AMD I/O Virtualization Technology. INTEL_VTD enables IOMMU support for >>>> platforms that implement the Intel Virtualization Technology for >>>> Directed I/O. >>>> >>>> Since no functional change is intended regarding the default >>>> configuration >>>> of an x86 system, both options depend on x86 and default to 'y'. >>> >>> But do things also build successfully when one or both options are >>> disabled? >>> I have to say that I would be quite surprised if that worked without >>> further >>> adjustments. In which case initially these options want to be >>> prompt-less, >>> with the prompts only added once 'n' also works. >> >> Without applying the whole series, disabling any of them or both won't >> work. Ok. > > To do a multi-step implementation, you start with > > config FOO > bool y Here, I think you mean def_bool y > > then rearrange them main code to use CONFIG_FOO as appropriate, then > have a final patch that adds a Kconfig name, help text, etc which is > what makes the config option user selectable and able to be turned off. Thank you both, for pointing that out. I will fix it. > > ~Andrew
On 19.12.2022 07:34, Xenia Ragiadakou wrote: > --- a/xen/drivers/passthrough/Kconfig > +++ b/xen/drivers/passthrough/Kconfig > @@ -37,6 +37,22 @@ config IPMMU_VMSA > > endif > > +config AMD_IOMMU > + bool "AMD IOMMU" > + depends on X86 > + default y > + ---help--- > + Enables I/O virtualization on platforms that implement the > + AMD I/O Virtualization Technology (IOMMU). > + > +config INTEL_VTD > + bool "Intel VT-d" > + depends on X86 > + default y > + ---help--- > + Enables I/O virtualization on platforms that implement the > + Intel Virtualization Technology for Directed I/O (Intel VT-d). One more thing Andrew and I have been talking about: As he has mentioned elsewhere, IOMMU support is needed to boot systems with more than 254 CPUs (depending on APIC ID layout the boundary may actually be lower). Hence it needs to at least be considered to make the prompts here (to be precise: in the much later patch adding the prompts) dependent on EXPERT, to prevent people from unknowingly building a non-functioning (on some systems) hypervisor. Jan
On 12/21/22 09:51, Jan Beulich wrote: > On 19.12.2022 07:34, Xenia Ragiadakou wrote: >> --- a/xen/drivers/passthrough/Kconfig >> +++ b/xen/drivers/passthrough/Kconfig >> @@ -37,6 +37,22 @@ config IPMMU_VMSA >> >> endif >> >> +config AMD_IOMMU >> + bool "AMD IOMMU" >> + depends on X86 >> + default y >> + ---help--- >> + Enables I/O virtualization on platforms that implement the >> + AMD I/O Virtualization Technology (IOMMU). >> + >> +config INTEL_VTD >> + bool "Intel VT-d" >> + depends on X86 >> + default y >> + ---help--- >> + Enables I/O virtualization on platforms that implement the >> + Intel Virtualization Technology for Directed I/O (Intel VT-d). > > One more thing Andrew and I have been talking about: As he has mentioned > elsewhere, IOMMU support is needed to boot systems with more than 254 > CPUs (depending on APIC ID layout the boundary may actually be lower). > Hence it needs to at least be considered to make the prompts here (to > be precise: in the much later patch adding the prompts) dependent on > EXPERT, to prevent people from unknowingly building a non-functioning > (on some systems) hypervisor. I will mention it in help as Andrew suggested and I will make it visible only if EXPERT. > > Jan
diff --git a/xen/drivers/passthrough/Kconfig b/xen/drivers/passthrough/Kconfig index 479d7de57a..82465aa627 100644 --- a/xen/drivers/passthrough/Kconfig +++ b/xen/drivers/passthrough/Kconfig @@ -37,6 +37,22 @@ config IPMMU_VMSA endif +config AMD_IOMMU + bool "AMD IOMMU" + depends on X86 + default y + ---help--- + Enables I/O virtualization on platforms that implement the + AMD I/O Virtualization Technology (IOMMU). + +config INTEL_VTD + bool "Intel VT-d" + depends on X86 + default y + ---help--- + Enables I/O virtualization on platforms that implement the + Intel Virtualization Technology for Directed I/O (Intel VT-d). + config IOMMU_FORCE_PT_SHARE bool diff --git a/xen/drivers/passthrough/Makefile b/xen/drivers/passthrough/Makefile index a5efa22714..d4fc7a3ddc 100644 --- a/xen/drivers/passthrough/Makefile +++ b/xen/drivers/passthrough/Makefile @@ -1,5 +1,5 @@ -obj-$(CONFIG_X86) += vtd/ -obj-$(CONFIG_X86) += amd/ +obj-$(CONFIG_INTEL_VTD) += vtd/ +obj-$(CONFIG_AMD_IOMMU) += amd/ obj-$(CONFIG_X86) += x86/ obj-$(CONFIG_ARM) += arm/
Currently, for x86 platforms, Xen does not provide to the users any configuration control over the IOMMU support and can only be built with both AMD and Intel IOMMU drivers enabled. However, there are use cases, e.g in safety-critical systems, that require Xen to be able to be configured to exclude unused code. A smaller tailored configuration would help Xen to meet faster certification requirements for individual platforms. Introduce two new Kconfig options, AMD_IOMMU and INTEL_VTD, to allow code specific to each IOMMU technology to be separated and, when not required, stripped. AMD_IOMMU enables IOMMU support for platforms that implement the AMD I/O Virtualization Technology. INTEL_VTD enables IOMMU support for platforms that implement the Intel Virtualization Technology for Directed I/O. Since no functional change is intended regarding the default configuration of an x86 system, both options depend on x86 and default to 'y'. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> --- xen/drivers/passthrough/Kconfig | 16 ++++++++++++++++ xen/drivers/passthrough/Makefile | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-)