From: Philippe Mathieu-Daudé Date: Thu, 2 Oct 2025 09:11:29 +0000 (+0200) Subject: target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3) X-Git-Tag: v10.2.0-rc1~68^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64321858d0735191b6160ba78f2282a67df6d9d9;p=thirdparty%2Fqemu.git target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3) Commit b7ecba0f6f6 ("docs/devel/loads-stores.rst: Document our various load and store APIs") mentioned cpu_physical_memory_*() methods are legacy, the replacement being address_space_*(). Replace the *_map() / *_unmap() methods in cpu_[un]map_lowcore(). No behavioral change expected. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-ID: <20251002091132.65703-7-philmd@linaro.org> Signed-off-by: Thomas Huth --- diff --git a/target/s390x/helper.c b/target/s390x/helper.c index a6d4a1ce05..b01b7d9bbb 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -26,6 +26,7 @@ #include "hw/s390x/ioinst.h" #include "target/s390x/kvm/pv.h" #include "system/hw_accel.h" +#include "system/memory.h" #include "system/runstate.h" #include "exec/target_page.h" #include "exec/watchpoint.h" @@ -107,11 +108,13 @@ LowCore *cpu_map_lowcore(CPUS390XState *env) { LowCore *lowcore; hwaddr len = sizeof(LowCore); + CPUState *cs = env_cpu(env); + const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED; - lowcore = cpu_physical_memory_map(env->psa, &len, true); + lowcore = address_space_map(cs->as, env->psa, &len, true, attrs); if (len < sizeof(LowCore)) { - cpu_abort(env_cpu(env), "Could not map lowcore\n"); + cpu_abort(cs, "Could not map lowcore\n"); } return lowcore; @@ -119,7 +122,9 @@ LowCore *cpu_map_lowcore(CPUS390XState *env) void cpu_unmap_lowcore(CPUS390XState *env, LowCore *lowcore) { - cpu_physical_memory_unmap(lowcore, sizeof(LowCore), 1, sizeof(LowCore)); + AddressSpace *as = env_cpu(env)->as; + + address_space_unmap(as, lowcore, sizeof(LowCore), true, sizeof(LowCore)); } void do_restart_interrupt(CPUS390XState *env)