Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-20 Thread Julien Grall
On 20/08/2020 10:25, Jan Beulich wrote: On 20.08.2020 11:14, Julien Grall wrote: On 19/08/2020 10:22, Jan Beulich wrote: On 17.08.2020 15:03, Julien Grall wrote: On 17/08/2020 12:50, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: The only way I coul

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-20 Thread Jan Beulich
On 20.08.2020 11:14, Julien Grall wrote: > > > On 19/08/2020 10:22, Jan Beulich wrote: >> On 17.08.2020 15:03, Julien Grall wrote: >>> On 17/08/2020 12:50, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: > The only way I could see to make it work woul

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-20 Thread Julien Grall
On 19/08/2020 10:22, Jan Beulich wrote: On 17.08.2020 15:03, Julien Grall wrote: On 17/08/2020 12:50, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: The only way I could see to make it work would be to use the same trick as we do for {read, write}_atomi

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-19 Thread Jan Beulich
On 17.08.2020 15:03, Julien Grall wrote: > On 17/08/2020 12:50, Roger Pau Monné wrote: >> On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: >>> The only way I could see to make it work would be to use the same trick as >>> we do for {read, write}_atomic() (see asm-arm/atomic.h). We are

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-19 Thread Jan Beulich
On 17.08.2020 13:50, Roger Pau Monné wrote: > FWIW x86 already has a specific handler for 128bit values: cmpxchg16b. > Maybe it would be better to name this cmpxchg8b? Or rename the > existing one to cmpxchg128 for coherence. cmpxchg16b() is named after the underlying insn. If we gain cmpxchg64(),

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-18 Thread Julien Grall
Hi Stefano, On 17/08/2020 23:56, Stefano Stabellini wrote: On Sat, 15 Aug 2020, Julien Grall wrote: From: Julien Grall The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this is x86 code, but there is plan to make it common. To cater 32-bit arch, introduce two new helpers to

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-17 Thread Stefano Stabellini
On Sat, 15 Aug 2020, Julien Grall wrote: > From: Julien Grall > > The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this > is x86 code, but there is plan to make it common. > > To cater 32-bit arch, introduce two new helpers to deal with 64-bit > cmpxchg. > > The Arm 32-bit im

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 02:03:23PM +0100, Julien Grall wrote: > > > On 17/08/2020 12:50, Roger Pau Monné wrote: > > On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: > > > Hi, > > > > > > On 17/08/2020 11:33, Roger Pau Monné wrote: > > > > On Mon, Aug 17, 2020 at 10:42:54AM +0100, Ju

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: > Hi, > > On 17/08/2020 11:33, Roger Pau Monné wrote: > > On Mon, Aug 17, 2020 at 10:42:54AM +0100, Julien Grall wrote: > > > Hi, > > > > > > On 17/08/2020 10:24, Roger Pau Monné wrote: > > > > On Sat, Aug 15, 2020 at 06:21:43PM +0100,

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-17 Thread Roger Pau Monné
On Mon, Aug 17, 2020 at 10:42:54AM +0100, Julien Grall wrote: > Hi, > > On 17/08/2020 10:24, Roger Pau Monné wrote: > > On Sat, Aug 15, 2020 at 06:21:43PM +0100, Julien Grall wrote: > > > From: Julien Grall > > > > > > The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this > >

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-17 Thread Roger Pau Monné
On Sat, Aug 15, 2020 at 06:21:43PM +0100, Julien Grall wrote: > From: Julien Grall > > The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this > is x86 code, but there is plan to make it common. > > To cater 32-bit arch, introduce two new helpers to deal with 64-bit > cmpxchg. >

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-17 Thread Julien Grall
On 17/08/2020 12:50, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote: Hi, On 17/08/2020 11:33, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 10:42:54AM +0100, Julien Grall wrote: Hi, On 17/08/2020 10:24, Roger Pau Monné wrote: On Sat, Aug 15, 2020 at

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-17 Thread Julien Grall
Hi, On 17/08/2020 11:33, Roger Pau Monné wrote: On Mon, Aug 17, 2020 at 10:42:54AM +0100, Julien Grall wrote: Hi, On 17/08/2020 10:24, Roger Pau Monné wrote: On Sat, Aug 15, 2020 at 06:21:43PM +0100, Julien Grall wrote: From: Julien Grall The IOREQ code is using cmpxchg() with 64-bit value

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-17 Thread Julien Grall
Hi, On 17/08/2020 10:24, Roger Pau Monné wrote: On Sat, Aug 15, 2020 at 06:21:43PM +0100, Julien Grall wrote: From: Julien Grall The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this is x86 code, but there is plan to make it common. To cater 32-bit arch, introduce two new

Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-16 Thread Oleksandr
On 15.08.20 20:21, Julien Grall wrote: Hi Julien From: Julien Grall The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this is x86 code, but there is plan to make it common. To cater 32-bit arch, introduce two new helpers to deal with 64-bit cmpxchg. The Arm 32-bit implem

[PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()

2020-08-15 Thread Julien Grall
From: Julien Grall The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this is x86 code, but there is plan to make it common. To cater 32-bit arch, introduce two new helpers to deal with 64-bit cmpxchg. The Arm 32-bit implementation of cmpxchg64() is based on the __cmpxchg64 in