s390x/tcg: Provide probe_write_access helper
commitc5a7392cfb965f70cff72155945a81ad62dd20a5
authorDavid Hildenbrand <david@redhat.com>
Thu, 7 Mar 2019 12:15:34 +0000 (7 13:15 +0100)
committerCornelia Huck <cohuck@redhat.com>
Mon, 11 Mar 2019 08:31:01 +0000 (11 09:31 +0100)
treebe7196789327ad812cd4458cdd7b15e49a4487a5
parenta2338cfb07536c1d3c19ab9b698cb9c3e2a58ea2
s390x/tcg: Provide probe_write_access helper

Instead of checking e.g. the first access on every touched page, we should
check the actual access, otherwise we might get false positives when Low
Address Protection (LAP) is active. As probe_write() can only deal with
accesses to one page, we have to loop.

Use i64 for the length, although not needed - easier to reuse
TCG temps we already have in the translation functions where this will
be used. Also allow it to be used from other helpers.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190307121539.12842-28-david@redhat.com>
[CH: add missing page_check_range()]
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
target/s390x/helper.h
target/s390x/internal.h
target/s390x/mem_helper.c