[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 18/39] xen/riscv: introduce cmpxchg.h



On Tue, 2023-12-12 at 17:51 +0100, Jan Beulich wrote:
> On 24.11.2023 11:30, Oleksii Kurochko wrote:
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> > ---
> > Changes in V2:
> >     - update the comment at the top of the header.
> >     - change xen/lib.h to xen/bug.h.
> >     - sort inclusion of headers properly.
> > ---
> >  xen/arch/riscv/include/asm/cmpxchg.h | 379
> > +++++++++++++++++++++++++++
> >  1 file changed, 379 insertions(+)
> >  create mode 100644 xen/arch/riscv/include/asm/cmpxchg.h
> > 
> > diff --git a/xen/arch/riscv/include/asm/cmpxchg.h
> > b/xen/arch/riscv/include/asm/cmpxchg.h
> > new file mode 100644
> > index 0000000000..c535bc9660
> > --- /dev/null
> > +++ b/xen/arch/riscv/include/asm/cmpxchg.h
> > @@ -0,0 +1,379 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + *  Taken and modified from Linux.
> 
> Depending on how heavily this file was modified, further adjustments
> may or
> may not be advisable. Can the description here please be non-empty to
> cover
> how close to the original the result is, plus also what version or
> commit
> you started from?
Sure. I'll add but it was only minor changes:

This header isn't changed to much in Linux kernel so this one version
can be used as a base:
https://elixir.bootlin.com/linux/latest/source/arch/riscv/include/asm/cmpxchg.h#L310

The following was changed:
1.      default: \
                BUILD_BUG();
  BUILD_BUG -> ASSERT_UNREACHABLE
2. Remove prefixes arch_ before some macros.

But it will be changed more as Xen uses xchg and cmpxchg with 1 and 2
bytes types, so it should be handled...

Anyway, I'll be happy with your comments, and I'll apply them in the
next patch version.

~ Oleksii





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.