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

Richard Henderson posted 14 patches 1 year, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220822235803.1729290-1-richard.henderson@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Yanan Wang <wangyanan55@huawei.com>, Peter Maydell <peter.maydell@linaro.org>, David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>
There is a newer version of this series
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(-)
[PATCH 00/14] target/i386: Use atomic operations for pte updates
Posted by Richard Henderson 1 year, 8 months ago
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(-)

-- 
2.34.1
Re: [PATCH 00/14] target/i386: Use atomic operations for pte updates
Posted by Richard Henderson 1 year, 8 months ago
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~