Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex

2016-08-24 Thread Emilio G. Cota
On Thu, Aug 18, 2016 at 08:38:47 -0700, Richard Henderson wrote: > A couple of other notes, as I've thought about this some more. Thanks for spending time on this. I have a new patchset (will send as a reply to this e-mail in a few minutes) that has good performance. Its main ideas: - Use transa

Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex

2016-08-18 Thread Richard Henderson
On 08/17/2016 11:41 AM, Richard Henderson wrote: On 08/17/2016 10:58 AM, Emilio G. Cota wrote: (2) that we should start a new TB upon encountering a load-exclusive, so that we maximize the chance of the store-exclusive being a part of the same TB and thus have *nothing* extra between the beginni

Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex

2016-08-17 Thread Richard Henderson
On 08/17/2016 10:58 AM, Emilio G. Cota wrote: (2) that we should start a new TB upon encountering a load-exclusive, so that we maximize the chance of the store-exclusive being a part of the same TB and thus have *nothing* extra between the beginning and commit of the transaction. I don't know h

Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex

2016-08-17 Thread Emilio G. Cota
On Wed, Aug 17, 2016 at 13:58:00 -0400, Emilio G. Cota wrote: > due to my glaring lack of TCG competence. A related note that might be of interest. I benchmarked an alternative implementation that *does* instrument stores. I wrapped every tcg_gen_qemu_st_i64 (those are enough, right? tcg_gen_st_i

Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex

2016-08-17 Thread Emilio G. Cota
On Wed, Aug 17, 2016 at 10:22:05 -0700, Richard Henderson wrote: > On 08/15/2016 08:49 AM, Emilio G. Cota wrote: > >+void HELPER(xbegin)(CPUARMState *env) > >+{ > >+uintptr_t ra = GETPC(); > >+int status; > >+int retries = 100; > >+ > >+ retry: > >+status = _xbegin(); > >+if (st

Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex

2016-08-17 Thread Richard Henderson
On 08/15/2016 08:49 AM, Emilio G. Cota wrote: +void HELPER(xbegin)(CPUARMState *env) +{ +uintptr_t ra = GETPC(); +int status; +int retries = 100; + + retry: +status = _xbegin(); +if (status != _XBEGIN_STARTED) { +if (status && retries) { +retries--; +

[Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex

2016-08-15 Thread Emilio G. Cota
Configure with --extra-cflags="-mrtm" Signed-off-by: Emilio G. Cota --- linux-user/main.c | 5 +++-- target-arm/helper-a64.c| 42 ++ target-arm/helper-a64.h| 4 target-arm/translate-a64.c | 15 +-- 4 files changed, 58 in