From: Philippe Mathieu-Daudé <[email protected]>

cpu_physical_memory_read() and cpu_physical_memory_write() are
legacy (see commit b7ecba0f6f6), replace by address_space_read()
and address_space_write().

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Eric Farman <[email protected]>
Message-Id: <[email protected]>
(cherry picked from commit 0d4e15e8f80e77a5bf22e3620ed990331f05256d)
(Mjt: pick this one up for 10.0.x so subsequent changes apply cleanly)
Signed-off-by: Michael Tokarev <[email protected]>

diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 5945c9b1d82..ce31bf8b0c0 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -303,6 +303,8 @@ int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t 
code)
     SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
     SCCBHeader header;
     g_autofree SCCB *work_sccb = NULL;
+    AddressSpace *as = CPU(cpu)->as;
+    const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED;
 
     /* first some basic checks on program checks */
     if (env->psw.mask & PSW_MASK_PSTATE) {
@@ -317,7 +319,7 @@ int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t 
code)
     }
 
     /* the header contains the actual length of the sccb */
-    cpu_physical_memory_read(sccb, &header, sizeof(SCCBHeader));
+    address_space_read(as, sccb, attrs, &header, sizeof(SCCBHeader));
 
     /* Valid sccb sizes */
     if (be16_to_cpu(header.length) < sizeof(SCCBHeader)) {
@@ -330,7 +332,7 @@ int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t 
code)
      * the host has checked the values
      */
     work_sccb = g_malloc0(be16_to_cpu(header.length));
-    cpu_physical_memory_read(sccb, work_sccb, be16_to_cpu(header.length));
+    address_space_read(as, sccb, attrs, work_sccb, be16_to_cpu(header.length));
 
     if (!sclp_command_code_valid(code)) {
         work_sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND);
@@ -344,8 +346,7 @@ int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t 
code)
 
     sclp_c->execute(sclp, work_sccb, code);
 out_write:
-    cpu_physical_memory_write(sccb, work_sccb,
-                              be16_to_cpu(work_sccb->h.length));
+    address_space_write(as, sccb, attrs, work_sccb, 
be16_to_cpu(header.length));
 
     sclp_c->service_interrupt(sclp, sccb);
 
-- 
2.47.3


Reply via email to