Message ID | 8990c5c77c12333bfa7aba42b66bf7fffee5a096.1694702259.git.oleksii.kurochko@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Introduce stub headers necessary for full Xen build | expand |
On 14.09.2023 16:56, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/include/asm-generic/iommu.h > @@ -0,0 +1,17 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +#ifndef __ASM_GENERIC_IOMMU_H__ > +#define __ASM_GENERIC_IOMMU_H__ > + > +struct arch_iommu { > +}; > + > +#endif /* __ASM_IOMMU_H__ */ This one's perhaps slightly more "interesting": Yes, we have a HAS_PASSTHROUGH Kconfig option, which both Arm and x86 select. But it is in principle possible to support guests without any kind of IOMMU (permitting solely emulated and PV devices). In which case what's (imo) needed here in addition is #ifdef CONFIG_HAS_PASSTHROUGH # error #endif Jan
On Thu, 2023-10-19 at 11:44 +0200, Jan Beulich wrote: > On 14.09.2023 16:56, Oleksii Kurochko wrote: > > --- /dev/null > > +++ b/xen/include/asm-generic/iommu.h > > @@ -0,0 +1,17 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +#ifndef __ASM_GENERIC_IOMMU_H__ > > +#define __ASM_GENERIC_IOMMU_H__ > > + > > +struct arch_iommu { > > +}; > > + > > +#endif /* __ASM_IOMMU_H__ */ > This one's perhaps slightly more "interesting": Yes, we have a > HAS_PASSTHROUGH Kconfig option, which both Arm and x86 select. But it > is in principle possible to support guests without any kind of IOMMU > (permitting solely emulated and PV devices). In which case what's > (imo) needed here in addition is > > #ifdef CONFIG_HAS_PASSTHROUGH > # error > #endif I am not 100% sure but not all platform has support of IOMMU. And I thought that passthrough it is when a device is fully committed to a guest domain with all MMIO things. So it is a question of properly mapping MMIO to guest domain. Am I right? ~ Oleksii
On 23.10.2023 12:43, Oleksii wrote: > On Thu, 2023-10-19 at 11:44 +0200, Jan Beulich wrote: >> On 14.09.2023 16:56, Oleksii Kurochko wrote: >>> --- /dev/null >>> +++ b/xen/include/asm-generic/iommu.h >>> @@ -0,0 +1,17 @@ >>> +/* SPDX-License-Identifier: GPL-2.0-only */ >>> +#ifndef __ASM_GENERIC_IOMMU_H__ >>> +#define __ASM_GENERIC_IOMMU_H__ >>> + >>> +struct arch_iommu { >>> +}; >>> + >>> +#endif /* __ASM_IOMMU_H__ */ >> This one's perhaps slightly more "interesting": Yes, we have a >> HAS_PASSTHROUGH Kconfig option, which both Arm and x86 select. But it >> is in principle possible to support guests without any kind of IOMMU >> (permitting solely emulated and PV devices). In which case what's >> (imo) needed here in addition is >> >> #ifdef CONFIG_HAS_PASSTHROUGH >> # error >> #endif > I am not 100% sure but not all platform has support of IOMMU. > > And I thought that passthrough it is when a device is fully committed > to a guest domain with all MMIO things. So it is a question of > properly mapping MMIO to guest domain. Am I right? Yes. And do you expect you will get away with such a stub implementation when you actually start supporting pass-through on RISC-V? Jan
On Mon, 2023-10-23 at 12:47 +0200, Jan Beulich wrote: > On 23.10.2023 12:43, Oleksii wrote: > > On Thu, 2023-10-19 at 11:44 +0200, Jan Beulich wrote: > > > On 14.09.2023 16:56, Oleksii Kurochko wrote: > > > > --- /dev/null > > > > +++ b/xen/include/asm-generic/iommu.h > > > > @@ -0,0 +1,17 @@ > > > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > > > +#ifndef __ASM_GENERIC_IOMMU_H__ > > > > +#define __ASM_GENERIC_IOMMU_H__ > > > > + > > > > +struct arch_iommu { > > > > +}; > > > > + > > > > +#endif /* __ASM_IOMMU_H__ */ > > > This one's perhaps slightly more "interesting": Yes, we have a > > > HAS_PASSTHROUGH Kconfig option, which both Arm and x86 select. > > > But it > > > is in principle possible to support guests without any kind of > > > IOMMU > > > (permitting solely emulated and PV devices). In which case what's > > > (imo) needed here in addition is > > > > > > #ifdef CONFIG_HAS_PASSTHROUGH > > > # error > > > #endif > > I am not 100% sure but not all platform has support of IOMMU. > > > > And I thought that passthrough it is when a device is fully > > committed > > to a guest domain with all MMIO things. So it is a question of > > properly mapping MMIO to guest domain. Am I right? > > Yes. And do you expect you will get away with such a stub > implementation > when you actually start supporting pass-through on RISC-V? No, it will be changed. It was added to asm-generic because of the build purpose for the full Xen build ( the same header with the same content is used for PPC ). But yeah, taking into account about device.h header in this patch series looks like this patch will be arch-specific. ~ Oleksii
diff --git a/xen/include/asm-generic/iommu.h b/xen/include/asm-generic/iommu.h new file mode 100644 index 0000000000..b08550e6b3 --- /dev/null +++ b/xen/include/asm-generic/iommu.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_IOMMU_H__ +#define __ASM_GENERIC_IOMMU_H__ + +struct arch_iommu { +}; + +#endif /* __ASM_IOMMU_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */
The patch introduces stub header necessry for full Xen build. Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> --- xen/include/asm-generic/iommu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 xen/include/asm-generic/iommu.h