From: Philippe Mathieu-Daudé Date: Wed, 7 Jan 2026 09:19:33 +0000 (+0100) Subject: target/s390x: Use address_space_ldq_be() in read_table_entry() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d784c9120fb27efc2adb5fac1e93aa26b2f07a8;p=thirdparty%2Fqemu.git target/s390x: Use address_space_ldq_be() in read_table_entry() address_space_read/write() is meant for accessing random amount of memory blobs. When the access size is known, use the address_space_ld/st() API which can directly swap endianness. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Farman Message-Id: <20260206181953.18683-2-philmd@linaro.org> --- diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index 026502a3e4..30f09ec3de 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -108,6 +108,7 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr, uint64_t *entry) { CPUState *cs = env_cpu(env); + MemTxResult ret; /* * According to the PoP, these table addresses are "unpredictably real @@ -116,13 +117,9 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr, * * We treat them as absolute addresses and don't wrap them. */ - if (unlikely(address_space_read(cs->as, gaddr, MEMTXATTRS_UNSPECIFIED, - entry, sizeof(*entry)) != - MEMTX_OK)) { - return false; - } - *entry = be64_to_cpu(*entry); - return true; + *entry = address_space_ldq_be(cs->as, gaddr, MEMTXATTRS_UNSPECIFIED, &ret); + + return ret == MEMTX_OK; } static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,