Skip to content

Commit

Permalink
accel/tcg: Adjust probe_access call to page_check_range
Browse files Browse the repository at this point in the history
We have validated that addr+size does not cross a page boundary.
Therefore we need to validate exactly one page.  We can achieve
that passing any value 1 <= x <= size to page_check_range.

Passing 1 will simplify the next patch.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200508154359.7494-5-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
rth7680 authored and pm215 committed May 11, 2020
1 parent 857129b commit 7a1bfee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accel/tcg/user-exec.c
Expand Up @@ -211,7 +211,7 @@ void *probe_access(CPUArchState *env, target_ulong addr, int size,
g_assert_not_reached();
}

if (!guest_addr_valid(addr) || page_check_range(addr, size, flags) < 0) {
if (!guest_addr_valid(addr) || page_check_range(addr, 1, flags) < 0) {
CPUState *cpu = env_cpu(env);
CPUClass *cc = CPU_GET_CLASS(cpu);
cc->tlb_fill(cpu, addr, size, access_type, MMU_USER_IDX, false,
Expand Down

0 comments on commit 7a1bfee

Please sign in to comment.