Re: [PATCH v6 08/20] xen/riscv: introduce cmpxchg.h

2024-04-02 Thread Oleksii
On Tue, 2024-04-02 at 14:54 +0200, Jan Beulich wrote: > On 02.04.2024 13:43, Oleksii wrote: > > On Thu, 2024-03-21 at 13:07 +0100, Jan Beulich wrote: > > > > + * If resulting 4-byte access is still misalgined, it will > > > > fault > > > > just as > > > > + * non-emulated 4-byte access would. > >

Re: [PATCH v6 08/20] xen/riscv: introduce cmpxchg.h

2024-04-02 Thread Jan Beulich
On 02.04.2024 13:43, Oleksii wrote: > On Thu, 2024-03-21 at 13:07 +0100, Jan Beulich wrote: >>> + * If resulting 4-byte access is still misalgined, it will fault >>> just as >>> + * non-emulated 4-byte access would. >>> + */ >>> +#define emulate_xchg_1_2(ptr, new, lr_sfx, sc_sfx) \ >>> +({ \ >>> + 

Re: [PATCH v6 08/20] xen/riscv: introduce cmpxchg.h

2024-04-02 Thread Oleksii
On Thu, 2024-03-21 at 13:07 +0100, Jan Beulich wrote: > > + * If resulting 4-byte access is still misalgined, it will fault > > just as > > + * non-emulated 4-byte access would. > > + */ > > +#define emulate_xchg_1_2(ptr, new, lr_sfx, sc_sfx) \ > > +({ \ > > +    uint32_t *aligned_ptr = (uint32_t

Re: [PATCH v6 08/20] xen/riscv: introduce cmpxchg.h

2024-03-22 Thread Oleksii
On Fri, 2024-03-22 at 11:42 +0100, Jan Beulich wrote: > On 22.03.2024 11:32, Oleksii wrote: > > On Thu, 2024-03-21 at 13:07 +0100, Jan Beulich wrote: > > > On 15.03.2024 19:06, Oleksii Kurochko wrote: > > > > The header was taken from Linux kernl 6.4.0-rc1. > > > > > > > > Addionally, were

Re: [PATCH v6 08/20] xen/riscv: introduce cmpxchg.h

2024-03-22 Thread Jan Beulich
On 22.03.2024 11:32, Oleksii wrote: > On Thu, 2024-03-21 at 13:07 +0100, Jan Beulich wrote: >> On 15.03.2024 19:06, Oleksii Kurochko wrote: >>> The header was taken from Linux kernl 6.4.0-rc1. >>> >>> Addionally, were updated: >>> * add emulation of {cmp}xchg for 1/2 byte types using 32-bit atomic

Re: [PATCH v6 08/20] xen/riscv: introduce cmpxchg.h

2024-03-22 Thread Oleksii
On Thu, 2024-03-21 at 13:07 +0100, Jan Beulich wrote: > On 15.03.2024 19:06, Oleksii Kurochko wrote: > > The header was taken from Linux kernl 6.4.0-rc1. > > > > Addionally, were updated: > > * add emulation of {cmp}xchg for 1/2 byte types using 32-bit atomic > >   access. > > * replace tabs with

Re: [PATCH v6 08/20] xen/riscv: introduce cmpxchg.h

2024-03-21 Thread Jan Beulich
On 15.03.2024 19:06, Oleksii Kurochko wrote: > The header was taken from Linux kernl 6.4.0-rc1. > > Addionally, were updated: > * add emulation of {cmp}xchg for 1/2 byte types using 32-bit atomic > access. > * replace tabs with spaces > * replace __* variale with *__ > * introduce generic

[PATCH v6 08/20] xen/riscv: introduce cmpxchg.h

2024-03-15 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 using 32-bit atomic access. * replace tabs with spaces * replace __* variale with *__ * introduce generic version of xchg_* and cmpxchg_*. * drop