[PATCH v2 10/39] xen/riscv: introduce asm/iommu.h

Oleksii Kurochko posted 39 patches 2 years ago
There is a newer version of this series
[PATCH v2 10/39] xen/riscv: introduce asm/iommu.h
Posted by Oleksii Kurochko 2 years ago
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V2:
 - Nothing changed. Only rebase.
---
 xen/arch/riscv/include/asm/iommu.h | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 xen/arch/riscv/include/asm/iommu.h

diff --git a/xen/arch/riscv/include/asm/iommu.h b/xen/arch/riscv/include/asm/iommu.h
new file mode 100644
index 0000000000..648b6fb922
--- /dev/null
+++ b/xen/arch/riscv/include/asm/iommu.h
@@ -0,0 +1,7 @@
+#ifndef __ASM_RISCV_IOMMU_H__
+#define __ASM_RISCV_IOMMU_H__
+
+struct arch_iommu {
+};
+
+#endif /* __ASM_IOMMU_H__ */
-- 
2.42.0
Re: [PATCH v2 10/39] xen/riscv: introduce asm/iommu.h
Posted by Jan Beulich 2 years ago
On 24.11.2023 11:30, Oleksii Kurochko wrote:
> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/iommu.h
> @@ -0,0 +1,7 @@
> +#ifndef __ASM_RISCV_IOMMU_H__
> +#define __ASM_RISCV_IOMMU_H__
> +
> +struct arch_iommu {
> +};
> +
> +#endif /* __ASM_IOMMU_H__ */

Instead of adding this header, didn't we discuss to make the #include in
xen/iommu.h depend on CONFIG_HAS_PASSTHROUGH? Also - no SPDX or footer
here?

Jan
Re: [PATCH v2 10/39] xen/riscv: introduce asm/iommu.h
Posted by Oleksii 2 years ago
On Thu, 2023-12-07 at 15:22 +0100, Jan Beulich wrote:
> On 24.11.2023 11:30, Oleksii Kurochko wrote:
> > --- /dev/null
> > +++ b/xen/arch/riscv/include/asm/iommu.h
> > @@ -0,0 +1,7 @@
> > +#ifndef __ASM_RISCV_IOMMU_H__
> > +#define __ASM_RISCV_IOMMU_H__
> > +
> > +struct arch_iommu {
> > +};
> > +
> > +#endif /* __ASM_IOMMU_H__ */
> 
> Instead of adding this header, didn't we discuss to make the #include
> in
> xen/iommu.h depend on CONFIG_HAS_PASSTHROUGH? Also - no SPDX or
> footer
> here?
We had discussion about some stuff in device.h, but we can apply it
here too. Only to place will be needed to update:


+ #ifdef CONFIG_HAS_PASSTHROUGH
#include <asm/iommu.h>
+ #endif

#ifndef iommu_call
# define iommu_call(ops, fn, args...) ((ops)->fn(args))
# define iommu_vcall iommu_call
#endif

struct domain_iommu {
+ #ifdef CONFIG_HAS_PASSTHROUGH
    struct arch_iommu arch;
+ #endif
...

I'll do that in the next iteration of this patch series.

Thanks.

~ Oleksii
Re: [PATCH v2 10/39] xen/riscv: introduce asm/iommu.h
Posted by Jan Beulich 2 years ago
On 08.12.2023 10:29, Oleksii wrote:
> On Thu, 2023-12-07 at 15:22 +0100, Jan Beulich wrote:
>> On 24.11.2023 11:30, Oleksii Kurochko wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/riscv/include/asm/iommu.h
>>> @@ -0,0 +1,7 @@
>>> +#ifndef __ASM_RISCV_IOMMU_H__
>>> +#define __ASM_RISCV_IOMMU_H__
>>> +
>>> +struct arch_iommu {
>>> +};
>>> +
>>> +#endif /* __ASM_IOMMU_H__ */
>>
>> Instead of adding this header, didn't we discuss to make the #include
>> in
>> xen/iommu.h depend on CONFIG_HAS_PASSTHROUGH? Also - no SPDX or
>> footer
>> here?
> We had discussion about some stuff in device.h, but we can apply it
> here too. Only to place will be needed to update:
> 
> 
> + #ifdef CONFIG_HAS_PASSTHROUGH
> #include <asm/iommu.h>
> + #endif
> 
> #ifndef iommu_call
> # define iommu_call(ops, fn, args...) ((ops)->fn(args))
> # define iommu_vcall iommu_call
> #endif
> 
> struct domain_iommu {
> + #ifdef CONFIG_HAS_PASSTHROUGH
>     struct arch_iommu arch;
> + #endif
> ...
> 
> I'll do that in the next iteration of this patch series.

What you suggest is to eliminate the need for an asm/ header. I asked
about an asm-generic/ one, though. (But I'd be okay either way, as long
as the redundancy is avoided.)

Jan