mbox series

[00/14] target/i386: Use atomic operations for pte updates

Message ID 20220822235803.1729290-1-richard.henderson@linaro.org
Headers show
Series target/i386: Use atomic operations for pte updates | expand

Message

Richard Henderson Aug. 22, 2022, 11:57 p.m. UTC
This patch set does two things:

(1) Remove assert(!probe) from the x86 tlb_fill

    It turns out that this is a prerequisite for
    [PATCH v6 00/21] linux-user: Fix siginfo_t contents when jumping
    to non-readable pages

    because of a new use of probe_access(..., nonfault)
    when comparing TBs that cross a page boundary.

    Patches 7-10 are sufficient to fix this.

    After auditing all of the targets, Sparc has a similar assert,
    and AVR simply doesn't check probe at all.  Both will need fixing.

(2) Use atomic operations for pte updates, which is a long-standing
    bug since our conversion to MTTCG.

For simplicity, patches 1-6 are from the middle of 
("[PATCH v2 00/66] target/arm: Implement FEAT_HAFDBS")


r~


Richard Henderson (14):
  accel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull
  accel/tcg: Drop addr member from SavedIOTLB
  accel/tcg: Suppress auto-invalidate in probe_access_internal
  accel/tcg: Introduce probe_access_full
  accel/tcg: Introduce tlb_set_page_full
  include/exec: Introduce TARGET_PAGE_ENTRY_EXTRA
  target/i386: Use MMUAccessType across excp_helper.c
  target/i386: Direct call get_hphys from mmu_translate
  target/i386: Introduce structures for mmu_translate
  target/i386: Reorg GET_HPHYS
  target/i386: Add MMU_PHYS_IDX and MMU_NESTED_IDX
  target/i386: Use MMU_NESTED_IDX for vmload/vmsave
  target/i386: Combine 5 sets of variables in mmu_translate
  target/i386: Use atomic operations for pte updates

 include/exec/cpu-defs.h              |  45 +-
 include/exec/exec-all.h              |  33 ++
 include/hw/core/cpu.h                |   1 -
 target/i386/cpu-param.h              |   2 +-
 target/i386/cpu.h                    |   5 +-
 accel/tcg/cputlb.c                   | 215 +++++----
 target/arm/mte_helper.c              |  14 +-
 target/arm/sve_helper.c              |   4 +-
 target/arm/translate-a64.c           |   2 +-
 target/i386/tcg/sysemu/excp_helper.c | 692 +++++++++++++++++----------
 target/i386/tcg/sysemu/svm_helper.c  | 234 +++++----
 target/s390x/tcg/mem_helper.c        |   4 -
 12 files changed, 772 insertions(+), 479 deletions(-)

Comments

Richard Henderson Aug. 23, 2022, 2:05 a.m. UTC | #1
On 8/22/22 16:57, Richard Henderson wrote:
> This patch set does two things:
> 
> (1) Remove assert(!probe) from the x86 tlb_fill
> 
>      It turns out that this is a prerequisite for
>      [PATCH v6 00/21] linux-user: Fix siginfo_t contents when jumping
>      to non-readable pages
> 
>      because of a new use of probe_access(..., nonfault)
>      when comparing TBs that cross a page boundary.

Turns out this was a bug in the v6 patch set. We don't require nonfault probes on 
PROT_EXEC at all; v7 will fix this.

But it's still nice that non-faulting probes now work...


r~