Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-16 Thread Aurelien Jarno
On 2017-07-16 11:59, Richard Henderson wrote: > On 07/16/2017 11:43 AM, Aurelien Jarno wrote: > > Indeed, if the same atomic code is used often it might be better to have > > it cached. That said it's only true for TB that are recognized, as IIRC > > TB with the exclusive lock are not cached. > >

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-16 Thread Richard Henderson
On 07/16/2017 11:43 AM, Aurelien Jarno wrote: Indeed, if the same atomic code is used often it might be better to have it cached. That said it's only true for TB that are recognized, as IIRC TB with the exclusive lock are not cached. At the moment they are not. But in Emilio's multi-threaded

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-16 Thread Aurelien Jarno
On 2017-07-16 09:35, Richard Henderson wrote: > On 07/16/2017 05:18 AM, Aurelien Jarno wrote: > > That said for further improvements did you consider decoding the gUSA > > section in a helper. It might avoid having to emulate the atomic > > sequence with 3 TBs in the worst case (the original one,

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-16 Thread Richard Henderson
On 07/16/2017 05:18 AM, Aurelien Jarno wrote: That said for further improvements did you consider decoding the gUSA section in a helper. It might avoid having to emulate the atomic sequence with 3 TBs in the worst case (the original one, the one to decode the sequence and the one holding the

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-16 Thread Aurelien Jarno
On 2017-07-15 16:30, Richard Henderson wrote: > On 07/15/2017 12:14 PM, Aurelien Jarno wrote: > > On 2017-07-06 16:20, Richard Henderson wrote: > > > For uniprocessors, SH4 uses optimistic restartable atomic sequences. > > > Upon an interrupt, a real kernel would simply notice magic values in > >

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-15 Thread Richard Henderson
On 07/15/2017 12:14 PM, Aurelien Jarno wrote: On 2017-07-06 16:20, Richard Henderson wrote: For uniprocessors, SH4 uses optimistic restartable atomic sequences. Upon an interrupt, a real kernel would simply notice magic values in the registers and reset the PC to the start of the sequence. For

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-15 Thread John Paul Adrian Glaubitz
On 07/16/2017 12:14 AM, Aurelien Jarno wrote: > Do you have actually have a good documentation about gUSA? I have found > a few documents (some of them in Japanese), the most complete one being > the LinuxTag paper. The ABI is also described in the kernel and the > glibc. That said I am missing

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-15 Thread Aurelien Jarno
On 2017-07-06 16:20, Richard Henderson wrote: > For uniprocessors, SH4 uses optimistic restartable atomic sequences. > Upon an interrupt, a real kernel would simply notice magic values in > the registers and reset the PC to the start of the sequence. > > For QEMU, we cannot do this in quite the

[Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-06 Thread Richard Henderson
For uniprocessors, SH4 uses optimistic restartable atomic sequences. Upon an interrupt, a real kernel would simply notice magic values in the registers and reset the PC to the start of the sequence. For QEMU, we cannot do this in quite the same way. Instead, we notice the normal start of such a