@samitouri / QOSamiQemu / commits / 21e2778c9d

target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (kvm)

Prefer the address_space_ld/st API over the legacy ld_phys() because it allow checking for bus access fault. This code however doesn't check for fault, so we simply inline the calls (not specifying any memory transaction attribute nor expecting transation result). No logical change intended. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Tested-by: Matthew Rosato <mjrosato@linux.ibm.com> Message-ID: <20260319185203.11799-5-philmd@linaro.org> Signed-off-by: Cornelia Huck <cohuck@redhat.com>

Philippe Mathieu-Daudé committed Mar 19, 2026 at 19:52 UTC 21e2778c9d4a02aee07224ef31def267330fedf9
1 file changed +8 -4
target/s390x/kvm/kvm.c
+8 -4
@@ -36,6 +36,7 @@
36 #include "qemu/main-loop.h"
37 #include "qemu/mmap-alloc.h"
38 #include "qemu/log.h"
39 +#include "system/memory.h"
40 #include "system/system.h"
41 #include "system/hw_accel.h"
42 #include "system/runstate.h"
@@ -1634,13 +1635,16 @@ static void unmanageable_intercept(S390CPU *cpu, S390CrashReason reason,
1635 /* try to detect pgm check loops */
1636 static int handle_oper_loop(S390CPU *cpu, struct kvm_run *run)
1637 {
1638 + const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED;
1639 CPUState *cs = CPU(cpu);
1640 PSW oldpsw, newpsw;
1641
1640 - newpsw.mask = ldq_be_phys(cs->as, cpu->env.psa +
1641 - offsetof(LowCore, program_new_psw));
1642 - newpsw.addr = ldq_be_phys(cs->as, cpu->env.psa +
1643 - offsetof(LowCore, program_new_psw) + 8);
1642 + newpsw.mask = address_space_ldq_be(cs->as, cpu->env.psa +
1643 + offsetof(LowCore, program_new_psw),
1644 + attrs, NULL);
1645 + newpsw.addr = address_space_ldq_be(cs->as, cpu->env.psa +
1646 + offsetof(LowCore, program_new_psw) + 8,
1647 + attrs, NULL);
1648 oldpsw.mask = run->psw_mask;
1649 oldpsw.addr = run->psw_addr;
1650 /*