qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "David Hildenbrand" <david@redhat.com>,
	qemu-s390x@nongnu.org,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 6/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3)
Date: Thu,  2 Oct 2025 11:11:29 +0200	[thread overview]
Message-ID: <20251002091132.65703-7-philmd@linaro.org> (raw)
In-Reply-To: <20251002091132.65703-1-philmd@linaro.org>

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é <philmd@linaro.org>
---
 target/s390x/helper.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index a6d4a1ce05d..b01b7d9bbbf 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)
-- 
2.51.0



  parent reply	other threads:[~2025-10-02  9:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02  9:11 [PATCH 0/9] target/s390x: Remove legacy cpu_physical_memory_*() calls Philippe Mathieu-Daudé
2025-10-02  9:11 ` [PATCH 1/9] target/s390x: Factor diag_iplb_write() out Philippe Mathieu-Daudé
2025-10-06 13:55   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 2/9] target/s390x: Factor diag_iplb_read() out Philippe Mathieu-Daudé
2025-10-06 13:57   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 3/9] target/s390x: Replace legacy cpu_physical_memory_read/write() calls Philippe Mathieu-Daudé
2025-10-06 14:04   ` Thomas Huth
2025-10-06 14:44     ` Philippe Mathieu-Daudé
2025-10-02  9:11 ` [PATCH 4/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (1/3) Philippe Mathieu-Daudé
2025-10-02  9:11 ` [PATCH 5/9] target/s390x: Propagate CPUS390XState to cpu_unmap_lowcore() Philippe Mathieu-Daudé
2025-10-06 14:08   ` Thomas Huth
2025-10-02  9:11 ` Philippe Mathieu-Daudé [this message]
2025-10-06 14:09   ` [PATCH 6/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3) Thomas Huth
2025-10-02  9:11 ` [PATCH 7/9] target/s390x: Reduce s390_store_adtl_status() scope Philippe Mathieu-Daudé
2025-10-06 14:11   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 8/9] target/s390x: Reduce s390_store_status() scope Philippe Mathieu-Daudé
2025-10-06 14:16   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 9/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (3/3) Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251002091132.65703-7-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).