All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: qemu-devel@nongnu.org, laurent@vivier.eu, bruno@clisp.org,
	glaubitz@debian.org
Subject: Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics
Date: Sun, 16 Jul 2017 09:35:05 -1000	[thread overview]
Message-ID: <e19112df-a491-2e34-61a7-3a514622df3e@twiddle.net> (raw)
In-Reply-To: <20170716151802.cmaz3zhucqlgaq5r@aurel32.net>

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 exclusive lock). The helper
> should directly have access to the r0 value, can decode the atomic
> sequence and translate it into a call to the corresponding atomic
> helpers. In the best case that means the sequence can be done in the
> same TB. In the worst case, where the gUSA sequence is not recognized
> it means two TB.

I did not consider decoding the sequence in a helper.

I do want to cache the result in a TB, so that when we execute the atomic 
sequence for a second time we do not have to re-interpret it.  And I don't see 
how to do that with a helper.

I *could* remember a mova into R0 earlier within the same block that performs 
the mov #imm,r15.  It's not guaranteed to be in the same TB, but looking 
through dumps from debian unstable it's highly likely.

That could end up with the atomic sequence in the same TB that set SP, or with 
the EXCP_ATOMIC exception in the same TB.

If it's ok with you, I'd prefer to handle that as a follow up.  We would still 
have to have the current setup as a backup just in case the mova isn't visible.


r~

  reply	other threads:[~2017-07-16 19:35 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07  2:20 [Qemu-devel] [PATCH v2 00/27] target/sh4 improvements Richard Henderson
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 01/27] target/sh4: Use cmpxchg for movco Richard Henderson
2017-07-15 23:22   ` Aurelien Jarno
2017-07-16 21:55     ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 02/27] target/sh4: Consolidate end-of-TB tests Richard Henderson
2017-07-07 21:42   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 03/27] target/sh4: Introduce TB_FLAG_ENVFLAGS_MASK Richard Henderson
2017-07-07 21:42   ` Aurelien Jarno
2017-07-08 16:29   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 04/27] target/sh4: Keep env->flags clean Richard Henderson
2017-07-07 21:42   ` Aurelien Jarno
2017-07-08 16:31   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 05/27] target/sh4: Adjust TB_FLAG_PENDING_MOVCA Richard Henderson
2017-07-07 21:42   ` Aurelien Jarno
2017-07-08 16:31   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics Richard Henderson
2017-07-15 22:14   ` Aurelien Jarno
2017-07-15 22:16     ` John Paul Adrian Glaubitz
2017-07-16  2:30     ` Richard Henderson
2017-07-16 15:18       ` Aurelien Jarno
2017-07-16 19:35         ` Richard Henderson [this message]
2017-07-16 21:43           ` Aurelien Jarno
2017-07-16 21:59             ` Richard Henderson
2017-07-16 22:16               ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 07/27] target/sh4: Recognize common gUSA sequences Richard Henderson
2017-07-17 14:10   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 08/27] linux-user/sh4: Notice gUSA regions during signal delivery Richard Henderson
2017-07-07  7:25   ` John Paul Adrian Glaubitz
2017-07-07  8:20     ` Richard Henderson
2017-07-07  8:30       ` John Paul Adrian Glaubitz
2017-07-07  8:35         ` John Paul Adrian Glaubitz
2017-07-07 16:22           ` Richard Henderson
2017-07-13  9:09             ` John Paul Adrian Glaubitz
2017-07-13 10:56               ` John Paul Adrian Glaubitz
2017-07-13 21:37                 ` Richard Henderson
2017-07-13 21:42                   ` John Paul Adrian Glaubitz
     [not found]           ` <20170707163826.22631-1-rth@twiddle.net>
2017-07-07 17:57             ` [Qemu-devel] Fwd: [PATCH v2.5] fixup! " Richard Henderson
2017-07-07 19:00               ` Richard Henderson
2017-07-17 14:15                 ` Aurelien Jarno
2017-07-07  9:05   ` [Qemu-devel] [PATCH v2 08/27] " Laurent Vivier
2017-07-07  9:09     ` Laurent Vivier
2017-07-07  9:13     ` John Paul Adrian Glaubitz
2017-07-15 22:52   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 09/27] linux-user/sh4: Clean env->flags on signal boundaries Richard Henderson
2017-07-15 22:59   ` Aurelien Jarno
2017-07-16  2:33     ` Richard Henderson
2017-07-16 15:18       ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 10/27] target/sh4: Hoist register bank selection Richard Henderson
2017-07-07 21:48   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 11/27] target/sh4: Unify cpu_fregs into FREG Richard Henderson
2017-07-07 21:54   ` Aurelien Jarno
2017-07-08 16:54   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 12/27] target/sh4: Pass DisasContext to fpr64 routines Richard Henderson
2017-07-07 21:55   ` Aurelien Jarno
2017-07-08 16:56   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 13/27] target/sh4: Hoist fp register bank selection Richard Henderson
2017-07-07 21:57   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 14/27] target/sh4: Eliminate unused XREG macro Richard Henderson
2017-07-07 21:59   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 15/27] target/sh4: Merge DREG into fpr64 routines Richard Henderson
2017-07-07 22:06   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 16/27] target/sh4: Load/store Dr as 64-bit quantities Richard Henderson
2017-07-07 22:14   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 17/27] target/sh4: Simplify 64-bit fp reg-reg move Richard Henderson
2017-07-07 22:15   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 18/27] target/sh4: Unify code for CHECK_NOT_DELAY_SLOT Richard Henderson
2017-07-07 22:17   ` Aurelien Jarno
2017-07-08 16:59   ` Philippe Mathieu-Daudé
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 19/27] target/sh4: Unify code for CHECK_PRIVILEGED Richard Henderson
2017-07-07 22:17   ` Aurelien Jarno
2017-07-08 17:00   ` Philippe Mathieu-Daudé
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 20/27] target/sh4: Unify code for CHECK_FPU_ENABLED Richard Henderson
2017-07-07 22:18   ` Aurelien Jarno
2017-07-08 17:01   ` Philippe Mathieu-Daudé
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 21/27] target/sh4: Tidy misc illegal insn checks Richard Henderson
2017-07-07 22:18   ` Aurelien Jarno
2017-07-08 17:02   ` Philippe Mathieu-Daudé
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 22/27] target/sh4: Introduce CHECK_FPSCR_PR_* Richard Henderson
2017-07-07 22:20   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 23/27] target/sh4: Introduce CHECK_SH4A Richard Henderson
2017-07-07 22:21   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 24/27] target/sh4: Implement fpchg Richard Henderson
2017-07-07 22:23   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 25/27] target/sh4: Add missing FPSCR.PR == 0 checks Richard Henderson
2017-07-07 22:24   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 26/27] target/sh4: Implement fsrra Richard Henderson
2017-07-07 22:27   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 27/27] target/sh4: Use tcg_gen_lookup_and_goto_ptr Richard Henderson
2017-07-18  7:51 ` [Qemu-devel] [PATCH v2 00/27] target/sh4 improvements Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e19112df-a491-2e34-61a7-3a514622df3e@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=bruno@clisp.org \
    --cc=glaubitz@debian.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.