diff mbox series

[v1,01/29] xen/asm-generic: introduce stub header spinlock.h

Message ID 30743e7391ad474724258441b7ec83affcf6b230.1694702259.git.oleksii.kurochko@gmail.com (mailing list archive)
State New, archived
Headers show
Series Introduce stub headers necessary for full Xen build | expand

Commit Message

Oleksii K. Sept. 14, 2023, 2:56 p.m. UTC
The patch introduces stub header needed for full Xen build.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/include/asm-generic/spinlock.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 xen/include/asm-generic/spinlock.h

Comments

Jan Beulich Sept. 14, 2023, 3:35 p.m. UTC | #1
On 14.09.2023 16:56, Oleksii Kurochko wrote:
> The patch introduces stub header needed for full Xen build.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Hmm, looking here I think I need to take back what I said in reply
to the cover letter, taking this as an example.

> --- /dev/null
> +++ b/xen/include/asm-generic/spinlock.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __ASM_GENERIC_SPINLOCK_H__
> +#define __ASM_GENERIC_SPINLOCK_H__
> +
> +#define arch_lock_acquire_barrier() smp_mb()
> +#define arch_lock_release_barrier() smp_mb()
> +
> +#define arch_lock_relax() cpu_relax()
> +#define arch_lock_signal() do { \
> +} while(0)

Slightly easier (and without style violation) as ((void)0)?

> +#define arch_lock_signal_wmb() arch_lock_signal()

How's the WMB aspect represented in here? I think you need the x86
variant as the generic fallback.
Oleksii K. Sept. 18, 2023, 8:43 a.m. UTC | #2
On Thu, 2023-09-14 at 17:35 +0200, Jan Beulich wrote:
> On 14.09.2023 16:56, Oleksii Kurochko wrote:
> > The patch introduces stub header needed for full Xen build.
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> Hmm, looking here I think I need to take back what I said in reply
> to the cover letter, taking this as an example.
> 
> > --- /dev/null
> > +++ b/xen/include/asm-generic/spinlock.h
> > @@ -0,0 +1,23 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef __ASM_GENERIC_SPINLOCK_H__
> > +#define __ASM_GENERIC_SPINLOCK_H__
> > +
> > +#define arch_lock_acquire_barrier() smp_mb()
> > +#define arch_lock_release_barrier() smp_mb()
> > +
> > +#define arch_lock_relax() cpu_relax()
> > +#define arch_lock_signal() do { \
> > +} while(0)
> 
> Slightly easier (and without style violation) as ((void)0)?
Thanks. It is much easier.

> 
> > +#define arch_lock_signal_wmb() arch_lock_signal()
> 
> How's the WMB aspect represented in here? I think you need the x86
> variant as the generic fallback.

Agree. I'll take x86 version in the next patch series.

~ Oleksii
diff mbox series

Patch

diff --git a/xen/include/asm-generic/spinlock.h b/xen/include/asm-generic/spinlock.h
new file mode 100644
index 0000000000..22a9ec5222
--- /dev/null
+++ b/xen/include/asm-generic/spinlock.h
@@ -0,0 +1,23 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_SPINLOCK_H__
+#define __ASM_GENERIC_SPINLOCK_H__
+
+#define arch_lock_acquire_barrier() smp_mb()
+#define arch_lock_release_barrier() smp_mb()
+
+#define arch_lock_relax() cpu_relax()
+#define arch_lock_signal() do { \
+} while(0)
+
+#define arch_lock_signal_wmb() arch_lock_signal()
+
+#endif /* __ASM_GENERIC_SPINLOCK_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */