From eaa0feea7532429c3a9bec357ec4f77cb156fab0 Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Fri, 3 Sep 2021 17:55:05 +0200 Subject: s390x/tcg: check for addressing exceptions for RRBE, SSKE and ISKE Let's replace the ram_size check by a proper physical address space check (for example, to prepare for memory hotplug), trigger addressing exceptions and trace the return value of the storage key getter/setter. Provide an helper mmu_absolute_addr_valid() to be used in other context soon. Always test for "read" instead of "write" as we are not actually modifying the page itself. Signed-off-by: David Hildenbrand Acked-by: Thomas Huth Message-Id: <20210903155514.44772-5-david@redhat.com> Signed-off-by: Thomas Huth --- target/s390x/mmu_helper.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'target/s390x/mmu_helper.c') diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index d779a9fc51..0620b1803e 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -94,6 +94,14 @@ target_ulong mmu_real2abs(CPUS390XState *env, target_ulong raddr) return raddr; } +bool mmu_absolute_addr_valid(target_ulong addr, bool is_write) +{ + return address_space_access_valid(&address_space_memory, + addr & TARGET_PAGE_MASK, + TARGET_PAGE_SIZE, is_write, + MEMTXATTRS_UNSPECIFIED); +} + static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr, uint64_t *entry) { -- cgit v1.2.3