xemu/target/s390x/tcg
Daniel Henrique Barboza 1770b2f2d3 accel/tcg: Add 'size' param to probe_access_flags()
probe_access_flags() as it is today uses probe_access_full(), which in
turn uses probe_access_internal() with size = 0. probe_access_internal()
then uses the size to call the tlb_fill() callback for the given CPU.
This size param ('fault_size' as probe_access_internal() calls it) is
ignored by most existing .tlb_fill callback implementations, e.g.
arm_cpu_tlb_fill(), ppc_cpu_tlb_fill(), x86_cpu_tlb_fill() and
mips_cpu_tlb_fill() to name a few.

But RISC-V riscv_cpu_tlb_fill() actually uses it. The 'size' parameter
is used to check for PMP (Physical Memory Protection) access. This is
necessary because PMP does not make any guarantees about all the bytes
of the same page having the same permissions, i.e. the same page can
have different PMP properties, so we're forced to make sub-page range
checks. To allow RISC-V emulation to do a probe_acess_flags() that
covers PMP, we need to either add a 'size' param to the existing
probe_acess_flags() or create a new interface (e.g.
probe_access_range_flags).

There are quite a few probe_* APIs already, so let's add a 'size' param
to probe_access_flags() and re-use this API. This is done by open coding
what probe_access_full() does inside probe_acess_flags() and passing the
'size' param to probe_acess_internal(). Existing probe_access_flags()
callers use size = 0 to not change their current API usage. 'size' is
asserted to enforce single page access like probe_access() already does.

No behavioral changes intended.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-Id: <20230223234427.521114-2-dbarboza@ventanamicro.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2023-02-28 10:32:31 -10:00
..
cc_helper.c target/s390x/tcg: Fix and improve the SACF instruction 2022-12-03 22:04:40 +01:00
crypto_helper.c target/s390x: support PRNO_TRNG instruction 2022-09-26 17:23:11 +02:00
excp_helper.c target/s390x/tcg/excp_helper: Restrict system headers to sysemu 2023-01-09 13:50:13 +01:00
fpu_helper.c target/s390x: Use Int128 for passing float128 2023-02-04 06:19:43 -10:00
insn-data.h.inc target/s390x: Use tcg_gen_atomic_cmpxchg_i128 for CDSG 2023-02-04 06:19:43 -10:00
insn-format.h.inc target/s390x: Rename insn-data/format.def -> insn-data/format.h.inc 2022-11-05 20:35:45 +01:00
int_helper.c target/s390x: Use a single return for helper_divs64/u64 2023-02-04 06:19:42 -10:00
mem_helper.c accel/tcg: Add 'size' param to probe_access_flags() 2023-02-28 10:32:31 -10:00
meson.build target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
misc_helper.c target/s390x/tcg/misc_helper: Remove unused "memory.h" include 2023-01-09 13:50:13 +01:00
s390-tod.h target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
tcg_s390x.h compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
translate.c target/s390x: Use tcg_constant_i32 for fpinst_extract_m34 2023-02-27 09:15:39 +01:00
translate_vx.c.inc target/s390x: Use tcg_constant_* in translate_vx.c.inc 2023-02-27 09:15:39 +01:00
vec.h Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
vec_fpu_helper.c target/s390x: fix handling of zeroes in vfmin/vfmax 2022-07-19 12:49:56 +02:00
vec_helper.c target/s390x: Fix writeback to v1 in helper_vstl 2022-05-04 08:47:19 +02:00
vec_int_helper.c target/s390x: vxeh2: Update for changes to vector shifts 2022-05-04 08:47:19 +02:00
vec_string_helper.c target/s390x: vxeh2: vector string search 2022-05-04 08:47:19 +02:00