diff mbox series

[v2,05/15] xen/asm-generic: introduce generic header iocap.h

Message ID 6ea2fc1c12fa08e7cc6a47735c4fcd49c48ac4d3.1699633310.git.oleksii.kurochko@gmail.com (mailing list archive)
State Superseded
Headers show
Series Introduce generic headers | expand

Commit Message

Oleksii Kurochko Nov. 10, 2023, 4:30 p.m. UTC
iocap.h is common for Arm, PPC and RISC-V architectures thereby
it was moved to asm-generic.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
The same question as with device.h. Should it be in asm-generic?

Changes in V2:
 - update the commit message
---
 xen/include/asm-generic/iocap.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 xen/include/asm-generic/iocap.h

Comments

Jan Beulich Nov. 13, 2023, 4:48 p.m. UTC | #1
On 10.11.2023 17:30, Oleksii Kurochko wrote:
> iocap.h is common for Arm, PPC and RISC-V architectures thereby
> it was moved to asm-generic.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> The same question as with device.h. Should it be in asm-generic?

I think it's okay(ish) here, considering that ...

> --- /dev/null
> +++ b/xen/include/asm-generic/iocap.h
> @@ -0,0 +1,17 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __ASM_GENERIC_IOCAP_H__
> +#define __ASM_GENERIC_IOCAP_H__
> +
> +#define cache_flush_permitted(d)                        \
> +    (!rangeset_is_empty((d)->iomem_caps))

... the only thing referenced (iomem_caps) is a common entity. And
again Arm demonstrates that an arch can get away with just this.

Jan
Oleksii Kurochko Nov. 14, 2023, 10:14 a.m. UTC | #2
On Mon, 2023-11-13 at 17:48 +0100, Jan Beulich wrote:
> On 10.11.2023 17:30, Oleksii Kurochko wrote:
> > iocap.h is common for Arm, PPC and RISC-V architectures thereby
> > it was moved to asm-generic.
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> > The same question as with device.h. Should it be in asm-generic?
> 
> I think it's okay(ish) here, considering that ...
> 
> > --- /dev/null
> > +++ b/xen/include/asm-generic/iocap.h
> > @@ -0,0 +1,17 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef __ASM_GENERIC_IOCAP_H__
> > +#define __ASM_GENERIC_IOCAP_H__
> > +
> > +#define cache_flush_permitted(d)                        \
> > +    (!rangeset_is_empty((d)->iomem_caps))
> 
> ... the only thing referenced (iomem_caps) is a common entity. And
> again Arm demonstrates that an arch can get away with just this.
Thanks.

Then I remove redundant headers from Arm and PPC and send new patch
serires.

~ Oleksii
diff mbox series

Patch

diff --git a/xen/include/asm-generic/iocap.h b/xen/include/asm-generic/iocap.h
new file mode 100644
index 0000000000..dd7cb45488
--- /dev/null
+++ b/xen/include/asm-generic/iocap.h
@@ -0,0 +1,17 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_IOCAP_H__
+#define __ASM_GENERIC_IOCAP_H__
+
+#define cache_flush_permitted(d)                        \
+    (!rangeset_is_empty((d)->iomem_caps))
+
+#endif /* __ASM_GENERIC_IOCAP_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */