Message ID | 20220823213805.1970804-3-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show |
Series | target/s390x: s390_probe_access fixes | expand |
On 23.08.22 23:38, Richard Henderson wrote: > Per the comment in s390_cpu_record_sigsegv, the saved address > is always page aligned. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > target/s390x/tcg/mem_helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c > index 4c0f8baa39..19ea7d2f8d 100644 > --- a/target/s390x/tcg/mem_helper.c > +++ b/target/s390x/tcg/mem_helper.c > @@ -147,7 +147,7 @@ static int s390_probe_access(CPUArchState *env, target_ulong addr, int size, > #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; > + env->__excp_addr = addr & TARGET_PAGE_MASK; > flags = (flags & PAGE_VALID) ? PGM_PROTECTION : PGM_ADDRESSING; > if (nonfault) { > return flags; Reviewed-by: David Hildenbrand <david@redhat.com>
diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 4c0f8baa39..19ea7d2f8d 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -147,7 +147,7 @@ static int s390_probe_access(CPUArchState *env, target_ulong addr, int size, #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; + env->__excp_addr = addr & TARGET_PAGE_MASK; flags = (flags & PAGE_VALID) ? PGM_PROTECTION : PGM_ADDRESSING; if (nonfault) { return flags;
Per the comment in s390_cpu_record_sigsegv, the saved address is always page aligned. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/s390x/tcg/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)