Skip to content

Commit

Permalink
s390x/tcg: Use guest_addr_valid() instead of h2g_valid() in probe_wri…
Browse files Browse the repository at this point in the history
…te_access()

If I'm not completely wrong, we are dealing with guest addresses here
and not with host addresses. Use the right check.

Fixes: c5a7392 ("s390x/tcg: Provide probe_write_access helper")
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20190826075112.25637-2-david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
davidhildenbrand authored and rth7680 committed Sep 3, 2019
1 parent 03a9818 commit 9e5bef4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/s390x/mem_helper.c
Expand Up @@ -2616,7 +2616,7 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len,
uintptr_t ra)
{
#ifdef CONFIG_USER_ONLY
if (!h2g_valid(addr) || !h2g_valid(addr + len - 1) ||
if (!guest_addr_valid(addr) || !guest_addr_valid(addr + len - 1) ||
page_check_range(addr, len, PAGE_WRITE) < 0) {
s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra);
}
Expand Down

0 comments on commit 9e5bef4

Please sign in to comment.