[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 36/66] target/s390x: Use probe_access_flags in s390_probe_
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v6 36/66] target/s390x: Use probe_access_flags in s390_probe_access |
Date: |
Sun, 31 Oct 2021 11:20:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 10/30/21 19:16, Richard Henderson wrote:
> Not sure why the user-only code wasn't rewritten to use
> probe_access_flags at the same time that the sysemu code
> was converted. For the purpose of user-only, this is an
> exact replacement.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/s390x/tcg/mem_helper.c | 18 +++++-------------
> 1 file changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
> index 17e3f83641..362a30d99e 100644
> --- a/target/s390x/tcg/mem_helper.c
> +++ b/target/s390x/tcg/mem_helper.c
> @@ -141,20 +141,12 @@ static int s390_probe_access(CPUArchState *env,
> target_ulong addr, int size,
> MMUAccessType access_type, int mmu_idx,
> bool nonfault, void **phost, uintptr_t ra)
> {
> +#if defined(CONFIG_USER_ONLY)
> + return probe_access_flags(env, addr, access_type, mmu_idx,
> + nonfault, phost, ra);
> +#else
> int flags;
>
> -#if defined(CONFIG_USER_ONLY)
> - flags = page_get_flags(addr);
> - if (!(flags & (access_type == MMU_DATA_LOAD ? PAGE_READ :
> PAGE_WRITE_ORG))) {
> - env->__excp_addr = addr;
> - flags = (flags & PAGE_VALID) ? PGM_PROTECTION : PGM_ADDRESSING;
> - if (nonfault) {
> - return flags;
> - }
> - tcg_s390_program_interrupt(env, flags, ra);
> - }
> - *phost = g2h(env_cpu(env), addr);
> -#else
> /*
> * For !CONFIG_USER_ONLY, we cannot rely on TLB_INVALID_MASK or
> haddr==NULL
> * to detect if there was an exception during tlb_fill().
> @@ -173,8 +165,8 @@ static int s390_probe_access(CPUArchState *env,
> target_ulong addr, int size,
> (access_type == MMU_DATA_STORE
> ? BP_MEM_WRITE : BP_MEM_READ), ra);
> }
> -#endif
> return 0;
> +#endif
> }
>
> static int access_prepare_nf(S390Access *access, CPUS390XState *env,
>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
- [PATCH v6 19/66] hw/core: Add TCGCPUOps.record_sigsegv, (continued)
- [PATCH v6 19/66] hw/core: Add TCGCPUOps.record_sigsegv, Richard Henderson, 2021/10/30
- [PATCH v6 22/66] target/arm: Use cpu_loop_exit_sigsegv for mte tag lookup, Richard Henderson, 2021/10/30
- [PATCH v6 30/66] target/mips: Make mips_cpu_tlb_fill sysemu only, Richard Henderson, 2021/10/30
- [PATCH v6 32/66] linux-user/openrisc: Abort for EXCP_RANGE, EXCP_FPE, Richard Henderson, 2021/10/30
- [PATCH v6 20/66] linux-user: Add cpu_loop_exit_sigsegv, Richard Henderson, 2021/10/30
- [PATCH v6 23/66] target/arm: Implement arm_cpu_record_sigsegv, Richard Henderson, 2021/10/30
- [PATCH v6 25/66] target/hexagon: Remove hexagon_cpu_tlb_fill, Richard Henderson, 2021/10/30
- [PATCH v6 33/66] target/openrisc: Make openrisc_cpu_tlb_fill sysemu only, Richard Henderson, 2021/10/30
- [PATCH v6 36/66] target/s390x: Use probe_access_flags in s390_probe_access, Richard Henderson, 2021/10/30
- Re: [PATCH v6 36/66] target/s390x: Use probe_access_flags in s390_probe_access,
Philippe Mathieu-Daudé <=
- [PATCH v6 41/66] accel/tcg: Restrict TCGCPUOps::tlb_fill() to sysemu, Richard Henderson, 2021/10/30
- [PATCH v6 45/66] target/arm: Implement arm_cpu_record_sigbus, Richard Henderson, 2021/10/30
- [PATCH v6 40/66] target/xtensa: Make xtensa_cpu_tlb_fill sysemu only, Richard Henderson, 2021/10/30
- [PATCH v6 52/66] target/s390x: Implement s390x_cpu_record_sigbus, Richard Henderson, 2021/10/30
- [PATCH v6 44/66] target/alpha: Implement alpha_cpu_record_sigbus, Richard Henderson, 2021/10/30
- [PATCH v6 46/66] linux-user/hppa: Remove EXCP_UNALIGN handling, Richard Henderson, 2021/10/30
- [PATCH v6 51/66] linux-user/ppc: Remove POWERPC_EXCP_ALIGN handling, Richard Henderson, 2021/10/30
- [PATCH v6 42/66] hw/core: Add TCGCPUOps.record_sigbus, Richard Henderson, 2021/10/30