Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-30 Thread Oleksii
On Tue, 2024-01-30 at 16:05 +0100, Jan Beulich wrote: > On 30.01.2024 15:57, Oleksii wrote: > > On Mon, 2024-01-22 at 17:27 +0100, Jan Beulich wrote: > > > > +#define __xchg_acquire(ptr, new, size) \ > > > > +({ \ > > > > +    __typeof__(ptr) ptr__ = (ptr); \ > > > > +    __typeof__(new) new__ =

Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-30 Thread Jan Beulich
On 30.01.2024 15:57, Oleksii wrote: > On Mon, 2024-01-22 at 17:27 +0100, Jan Beulich wrote: >>> +#define __xchg_acquire(ptr, new, size) \ >>> +({ \ >>> +    __typeof__(ptr) ptr__ = (ptr); \ >>> +    __typeof__(new) new__ = (new); \ >>> +    __typeof__(*(ptr)) ret__; \ >>> +    switch (size) \ >>>

Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-30 Thread Oleksii
On Mon, 2024-01-22 at 17:27 +0100, Jan Beulich wrote: > > +#define __xchg_acquire(ptr, new, size) \ > > +({ \ > > +    __typeof__(ptr) ptr__ = (ptr); \ > > +    __typeof__(new) new__ = (new); \ > > +    __typeof__(*(ptr)) ret__; \ > > +    switch (size) \ > > + { \ > > +    case 4: \ > > +   

Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-24 Thread Oleksii
On Tue, 2024-01-23 at 14:27 +0100, Jan Beulich wrote: > On 23.01.2024 13:18, Oleksii wrote: > > On Tue, 2024-01-23 at 11:28 +0100, Jan Beulich wrote: > > > On 23.01.2024 11:15, Oleksii wrote: > > > > On Mon, 2024-01-22 at 17:27 +0100, Jan Beulich wrote: > > > > > On 22.12.2023 16:12, Oleksii

Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-23 Thread Jan Beulich
On 23.01.2024 13:18, Oleksii wrote: > On Tue, 2024-01-23 at 11:28 +0100, Jan Beulich wrote: >> On 23.01.2024 11:15, Oleksii wrote: >>> On Mon, 2024-01-22 at 17:27 +0100, Jan Beulich wrote: On 22.12.2023 16:12, Oleksii Kurochko wrote: > +static inline unsigned long __xchg(volatile void

Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-23 Thread Oleksii
On Tue, 2024-01-23 at 11:28 +0100, Jan Beulich wrote: > On 23.01.2024 11:15, Oleksii wrote: > > On Mon, 2024-01-22 at 17:27 +0100, Jan Beulich wrote: > > > On 22.12.2023 16:12, Oleksii Kurochko wrote: > > > > +    : "=r" (ret__), "+A" (*ptr__) \ > > > > +    : "r" (new__) \ > > > >

Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-23 Thread Jan Beulich
On 23.01.2024 11:15, Oleksii wrote: > On Mon, 2024-01-22 at 17:27 +0100, Jan Beulich wrote: >> On 22.12.2023 16:12, Oleksii Kurochko wrote: >>> +    : "=r" (ret__), "+A" (*ptr__) \ >>> +    : "r" (new__) \ >>> +    : "memory" ); \ >>> +    break; \ >>> +    case 8: \

Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-23 Thread Oleksii
On Mon, 2024-01-22 at 17:27 +0100, Jan Beulich wrote: > On 22.12.2023 16:12, Oleksii Kurochko wrote: > > --- /dev/null > > +++ b/xen/arch/riscv/include/asm/cmpxchg.h > > @@ -0,0 +1,496 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +/* Copyright (C) 2014 Regents of the University of

Re: [PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2024-01-22 Thread Jan Beulich
On 22.12.2023 16:12, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/arch/riscv/include/asm/cmpxchg.h > @@ -0,0 +1,496 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* Copyright (C) 2014 Regents of the University of California */ > + > +#ifndef _ASM_RISCV_CMPXCHG_H > +#define

[PATCH v3 13/34] xen/riscv: introduce cmpxchg.h

2023-12-22 Thread Oleksii Kurochko
The header was taken from Linux kernl 6.4.0-rc1. Addionally, were updated: * add emulation of {cmp}xchg for 1/2 byte types * replace tabs with spaces * replace __* varialbed with *__ Signed-off-by: Oleksii Kurochko --- Changes in V3: - update the commit message - add emulation of