diff mbox series

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

Message ID 68be3d368bf6ed96b0bb53b51a2fd07696cb338d.1700761381.git.oleksii.kurochko@gmail.com (mailing list archive)
State Superseded
Headers show
Series Enable build of full Xen for RISC-V | expand

Commit Message

Oleksii K. Nov. 24, 2023, 10:30 a.m. UTC
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

Comments

Jan Beulich Dec. 7, 2023, 2:22 p.m. UTC | #1
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
Oleksii K. Dec. 8, 2023, 9:29 a.m. UTC | #2
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
Jan Beulich Dec. 8, 2023, 10:21 a.m. UTC | #3
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
diff mbox series

Patch

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__ */