From: Philippe Mathieu-Daudé Date: Wed, 24 Dec 2025 16:20:28 +0000 (+0100) Subject: hw/s390x: Use explicit big-endian LD/ST API X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb3d793d350722edee5bcd7c2f9f64d253432353;p=thirdparty%2Fqemu.git hw/s390x: Use explicit big-endian LD/ST API The S390x architecture uses big endianness. Directly use the big-endian LD/ST API. Mechanical change running: $ for a in uw w l q; do \ sed -i -e "s/ld${a}_p(/ld${a}_be_p(/" \ $(git grep -wlE '(ld|st)u?[wlq]_p' hw/s390x/); done Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Halil Pasic Reviewed-by: Eric Farman Reviewed-by: Richard Henderson Message-ID: <20251224162036.90404-2-philmd@linaro.org> Signed-off-by: Thomas Huth --- diff --git a/hw/s390x/css.c b/hw/s390x/css.c index ccc9c1c243..04ce3178a0 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -1583,27 +1583,25 @@ static void css_update_chnmon(SubchDev *sch) /* Format 1, per-subchannel area. */ uint32_t count; - count = address_space_ldl(&address_space_memory, - sch->curr_status.mba, - MEMTXATTRS_UNSPECIFIED, - NULL); + count = address_space_ldl_be(&address_space_memory, + sch->curr_status.mba, + MEMTXATTRS_UNSPECIFIED, NULL); count++; - address_space_stl(&address_space_memory, sch->curr_status.mba, count, - MEMTXATTRS_UNSPECIFIED, NULL); + address_space_stl_be(&address_space_memory, sch->curr_status.mba, count, + MEMTXATTRS_UNSPECIFIED, NULL); } else { /* Format 0, global area. */ uint32_t offset; uint16_t count; offset = sch->curr_status.pmcw.mbi << 5; - count = address_space_lduw(&address_space_memory, - channel_subsys.chnmon_area + offset, - MEMTXATTRS_UNSPECIFIED, - NULL); + count = address_space_lduw_be(&address_space_memory, + channel_subsys.chnmon_area + offset, + MEMTXATTRS_UNSPECIFIED, NULL); count++; - address_space_stw(&address_space_memory, - channel_subsys.chnmon_area + offset, count, - MEMTXATTRS_UNSPECIFIED, NULL); + address_space_stw_be(&address_space_memory, + channel_subsys.chnmon_area + offset, count, + MEMTXATTRS_UNSPECIFIED, NULL); } } diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 30fdca1e8a..b438d63c44 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -462,8 +462,8 @@ static uint64_t table_translate(S390IOTLBEntry *entry, uint64_t to, int8_t ett, uint16_t err = 0; tx = get_table_index(entry->iova, ett); - te = address_space_ldq(&address_space_memory, to + tx * sizeof(uint64_t), - MEMTXATTRS_UNSPECIFIED, NULL); + te = address_space_ldq_be(&address_space_memory, to + tx * sizeof(uint64_t), + MEMTXATTRS_UNSPECIFIED, NULL); if (!te) { err = ERR_EVENT_INVALTE; diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index b4011c4049..6855e20d09 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -890,26 +890,26 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t vector) } } else { assert(vector < NR_CLASSIC_INDICATOR_BITS); - indicators = address_space_ldq(&address_space_memory, - dev->indicators->addr, - MEMTXATTRS_UNSPECIFIED, - NULL); + indicators = address_space_ldq_be(&address_space_memory, + dev->indicators->addr, + MEMTXATTRS_UNSPECIFIED, + NULL); indicators |= 1ULL << vector; - address_space_stq(&address_space_memory, dev->indicators->addr, - indicators, MEMTXATTRS_UNSPECIFIED, NULL); + address_space_stq_be(&address_space_memory, dev->indicators->addr, + indicators, MEMTXATTRS_UNSPECIFIED, NULL); css_conditional_io_interrupt(sch); } } else { if (!dev->indicators2) { return; } - indicators = address_space_ldq(&address_space_memory, - dev->indicators2->addr, - MEMTXATTRS_UNSPECIFIED, - NULL); + indicators = address_space_ldq_be(&address_space_memory, + dev->indicators2->addr, + MEMTXATTRS_UNSPECIFIED, + NULL); indicators |= 1ULL; - address_space_stq(&address_space_memory, dev->indicators2->addr, - indicators, MEMTXATTRS_UNSPECIFIED, NULL); + address_space_stq_be(&address_space_memory, dev->indicators2->addr, + indicators, MEMTXATTRS_UNSPECIFIED, NULL); css_conditional_io_interrupt(sch); } }