[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 00/13] Fixes for user-only munmap races
From: |
Richard Henderson |
Subject: |
[PATCH v2 00/13] Fixes for user-only munmap races |
Date: |
Tue, 9 Jul 2024 20:28:01 -0700 |
Supercedes: 20240702234155.2106399-1-richard.henderson@linaro.org
("[PATCH 0/2] target/arm: Fix unwind from dc zva and FEAT_MOPS")
Supercedes: 20240702234659.2106870-1-richard.henderson@linaro.org
("[PATCH 0/4] target/ppc: Cleanups for dcbz")
After looking at the first dc zva patch set again, I can see no
difference between the memset used by dc dva and the plain memory
accesses used by SVE and SME. In all cases it's a host memory
access that might fault even after probe_access, due to a race.
So I've dropped memset_ra and memmove_ra, and instead expose the
basic set/clear_helper_retaddr interface. This allows one set/clear
to cover entire loops, instead of trebling the overhead of each
individual access.
I've included the ppc dcbz cleanups, so that the final improvement
applies cleanly.
I've updated s390x, though it isn't as clean as I would like.
I've tidied the riscv use of tlb_vaddr_to_host, which Peter noticed.
The usage was incorrect in general. There is no race condition
here because it still uses cpu_ld*_data_ra in the end and not a
bare host memory access. But the ongoing work to improve riscv
vector memory instructions should take note.
r~
BALATON Zoltan (1):
target/ppc/mem_helper.c: Remove a conditional from dcbz_common()
Richard Henderson (12):
accel/tcg: Move {set,clear}_helper_retaddr to cpu_ldst.h
target/arm: Use cpu_env in cpu_untagged_addr
target/arm: Use set/clear_helper_retaddr in helper-a64.c
target/arm: Use set/clear_helper_retaddr in SVE and SME helpers
target/ppc: Hoist dcbz_size out of dcbz_common
target/ppc: Split out helper_dbczl for 970
target/ppc: Merge helper_{dcbz,dcbzep}
target/ppc: Improve helper_dcbz for user-only
target/s390x: Use user_or_likely in do_access_memset
target/s390x: Use user_or_likely in access_memmove
target/s390x: Use set/clear_helper_retaddr in mem_helper.c
target/riscv: Simplify probing in vext_ldff
accel/tcg/user-retaddr.h | 28 ---------
include/exec/cpu_ldst.h | 34 +++++++++++
target/arm/cpu.h | 4 +-
target/ppc/helper.h | 6 +-
accel/tcg/cpu-exec.c | 3 -
accel/tcg/user-exec.c | 1 -
target/arm/tcg/helper-a64.c | 14 ++++-
target/arm/tcg/sme_helper.c | 16 ++++++
target/arm/tcg/sve_helper.c | 26 +++++++++
target/ppc/mem_helper.c | 51 +++++++++--------
target/ppc/translate.c | 24 ++++----
target/riscv/vector_helper.c | 34 +++++------
target/s390x/tcg/mem_helper.c | 103 +++++++++++++++++++++-------------
13 files changed, 219 insertions(+), 125 deletions(-)
delete mode 100644 accel/tcg/user-retaddr.h
--
2.43.0
- [PATCH v2 00/13] Fixes for user-only munmap races,
Richard Henderson <=
- [PATCH v2 01/13] accel/tcg: Move {set, clear}_helper_retaddr to cpu_ldst.h, Richard Henderson, 2024/07/09
- [PATCH v2 02/13] target/arm: Use cpu_env in cpu_untagged_addr, Richard Henderson, 2024/07/09
- [PATCH v2 03/13] target/arm: Use set/clear_helper_retaddr in helper-a64.c, Richard Henderson, 2024/07/09
- [PATCH v2 04/13] target/arm: Use set/clear_helper_retaddr in SVE and SME helpers, Richard Henderson, 2024/07/09
- [PATCH v2 06/13] target/ppc: Hoist dcbz_size out of dcbz_common, Richard Henderson, 2024/07/09