From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, cota@braap.org, alex.bennee@linaro.org
Subject: [Qemu-devel] [PATCH v8 34/37] linux-user: remove handling of aarch64's EXCP_STREX
Date: Mon, 24 Oct 2016 10:39:45 -0700 [thread overview]
Message-ID: <1477330788-14996-35-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1477330788-14996-1-git-send-email-rth@twiddle.net>
From: "Emilio G. Cota" <cota@braap.org>
The exception is not emitted anymore.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-Id: <1467054136-10430-30-git-send-email-cota@braap.org>
---
linux-user/main.c | 125 ------------------------------------------------------
1 file changed, 125 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 4b7072f..ba3cc4b 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -772,124 +772,6 @@ void cpu_loop(CPUARMState *env)
#else
-/*
- * Handle AArch64 store-release exclusive
- *
- * rs = gets the status result of store exclusive
- * rt = is the register that is stored
- * rt2 = is the second register store (in STP)
- *
- */
-static int do_strex_a64(CPUARMState *env)
-{
- uint64_t val;
- int size;
- bool is_pair;
- int rc = 1;
- int segv = 0;
- uint64_t addr;
- int rs, rt, rt2;
-
- start_exclusive();
- /* size | is_pair << 2 | (rs << 4) | (rt << 9) | (rt2 << 14)); */
- size = extract32(env->exclusive_info, 0, 2);
- is_pair = extract32(env->exclusive_info, 2, 1);
- rs = extract32(env->exclusive_info, 4, 5);
- rt = extract32(env->exclusive_info, 9, 5);
- rt2 = extract32(env->exclusive_info, 14, 5);
-
- addr = env->exclusive_addr;
-
- if (addr != env->exclusive_test) {
- goto finish;
- }
-
- switch (size) {
- case 0:
- segv = get_user_u8(val, addr);
- break;
- case 1:
- segv = get_user_u16(val, addr);
- break;
- case 2:
- segv = get_user_u32(val, addr);
- break;
- case 3:
- segv = get_user_u64(val, addr);
- break;
- default:
- abort();
- }
- if (segv) {
- env->exception.vaddress = addr;
- goto error;
- }
- if (val != env->exclusive_val) {
- goto finish;
- }
- if (is_pair) {
- if (size == 2) {
- segv = get_user_u32(val, addr + 4);
- } else {
- segv = get_user_u64(val, addr + 8);
- }
- if (segv) {
- env->exception.vaddress = addr + (size == 2 ? 4 : 8);
- goto error;
- }
- if (val != env->exclusive_high) {
- goto finish;
- }
- }
- /* handle the zero register */
- val = rt == 31 ? 0 : env->xregs[rt];
- switch (size) {
- case 0:
- segv = put_user_u8(val, addr);
- break;
- case 1:
- segv = put_user_u16(val, addr);
- break;
- case 2:
- segv = put_user_u32(val, addr);
- break;
- case 3:
- segv = put_user_u64(val, addr);
- break;
- }
- if (segv) {
- goto error;
- }
- if (is_pair) {
- /* handle the zero register */
- val = rt2 == 31 ? 0 : env->xregs[rt2];
- if (size == 2) {
- segv = put_user_u32(val, addr + 4);
- } else {
- segv = put_user_u64(val, addr + 8);
- }
- if (segv) {
- env->exception.vaddress = addr + (size == 2 ? 4 : 8);
- goto error;
- }
- }
- rc = 0;
-finish:
- env->pc += 4;
- /* rs == 31 encodes a write to the ZR, thus throwing away
- * the status return. This is rather silly but valid.
- */
- if (rs < 31) {
- env->xregs[rs] = rc;
- }
-error:
- /* instruction faulted, PC does not advance */
- /* either way a strex releases any exclusive lock we have */
- env->exclusive_addr = -1;
- end_exclusive();
- return segv;
-}
-
/* AArch64 main loop */
void cpu_loop(CPUARMState *env)
{
@@ -931,11 +813,6 @@ void cpu_loop(CPUARMState *env)
info._sifields._sigfault._addr = env->pc;
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
break;
- case EXCP_STREX:
- if (!do_strex_a64(env)) {
- break;
- }
- /* fall through for segv */
case EXCP_PREFETCH_ABORT:
case EXCP_DATA_ABORT:
info.si_signo = TARGET_SIGSEGV;
@@ -971,8 +848,6 @@ void cpu_loop(CPUARMState *env)
process_pending_signals(env);
/* Exception return on AArch64 always clears the exclusive monitor,
* so any return to running guest code implies this.
- * A strex (successful or otherwise) also clears the monitor, so
- * we don't need to specialcase EXCP_STREX.
*/
env->exclusive_addr = -1;
}
--
2.7.4
next prev parent reply other threads:[~2016-10-24 17:40 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 17:39 [Qemu-devel] [PATCH v8 00/37] cmpxchg atomic operations Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 01/37] atomics: Add parameters to macros Richard Henderson
2016-10-24 18:13 ` Emilio G. Cota
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 02/37] atomics: add atomic_xor Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 03/37] atomics: add atomic_op_fetch variants Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 04/37] atomics: Add __nocheck atomic operations Richard Henderson
2016-10-24 18:16 ` Emilio G. Cota
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 05/37] exec: Avoid direct references to Int128 parts Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 06/37] int128: Use __int128 if available Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 07/37] int128: Add int128_make128 Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 09/37] linux-user: enable parallel code generation on clone Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 10/37] cputlb: Replace SHIFT with DATA_SIZE Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 11/37] cputlb: Move probe_write out of softmmu_template.h Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 12/37] cputlb: Remove includes from softmmu_template.h Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 13/37] cputlb: Move most of iotlb code out of line Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 14/37] cputlb: Tidy some macros Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 15/37] tcg: Add atomic helpers Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 16/37] tcg: Add atomic128 helpers Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 17/37] tcg: Add CONFIG_ATOMIC64 Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 18/37] tcg: Emit barriers with parallel_cpus Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 19/37] target-i386: emulate LOCK'ed cmpxchg using cmpxchg helpers Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 20/37] target-i386: emulate LOCK'ed OP instructions using atomic helpers Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 21/37] target-i386: emulate LOCK'ed INC using atomic helper Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 22/37] target-i386: emulate LOCK'ed NOT " Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 23/37] target-i386: emulate LOCK'ed NEG using cmpxchg helper Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 24/37] target-i386: emulate LOCK'ed XADD using atomic helper Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 25/37] target-i386: emulate LOCK'ed BTX ops using atomic helpers Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 26/37] target-i386: emulate XCHG using atomic helper Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 27/37] target-i386: remove helper_lock() Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 28/37] tests: add atomic_add-bench Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 29/37] target-arm: Rearrange aa32 load and store functions Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 30/37] target-arm: emulate LL/SC using cmpxchg helpers Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 31/37] target-arm: emulate SWP with atomic_xchg helper Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 32/37] target-arm: emulate aarch64's LL/SC using cmpxchg helpers Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 33/37] linux-user: remove handling of ARM's EXCP_STREX Richard Henderson
2016-10-24 17:39 ` Richard Henderson [this message]
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 35/37] target-arm: remove EXCP_STREX + cpu_exclusive_{test, info} Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 36/37] target-alpha: Introduce MMU_PHYS_IDX Richard Henderson
2016-10-24 17:39 ` [Qemu-devel] [PATCH v8 37/37] target-alpha: Emulate LL/SC using cmpxchg helpers Richard Henderson
2016-10-24 18:27 ` [Qemu-devel] [PATCH v8 00/37] cmpxchg atomic operations Emilio G. Cota
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=1477330788-14996-35-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=alex.bennee@linaro.org \
--cc=cota@braap.org \
--cc=peter.maydell@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).