Blame SOURCES/kvm-dump-Replace-opaque-DumpState-pointer-with-a-typed-o.patch

bf143f
From 8f674e0e12e4b88fc035948612a0b0949e0ad892 Mon Sep 17 00:00:00 2001
bf143f
From: Janosch Frank <frankja@linux.ibm.com>
bf143f
Date: Thu, 11 Aug 2022 12:10:54 +0000
bf143f
Subject: [PATCH 22/42] dump: Replace opaque DumpState pointer with a typed one
bf143f
MIME-Version: 1.0
bf143f
Content-Type: text/plain; charset=UTF-8
bf143f
Content-Transfer-Encoding: 8bit
bf143f
bf143f
RH-Author: Cédric Le Goater <clg@redhat.com>
bf143f
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
bf143f
RH-Bugzilla: 1664378 2043909
bf143f
RH-Acked-by: Thomas Huth <thuth@redhat.com>
bf143f
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
bf143f
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
bf143f
RH-Commit: [22/41] 5f071d7ef441ae6f5da70eb56018c4657deee3d7
bf143f
bf143f
It's always better to convey the type of a pointer if at all
bf143f
possible. So let's add the DumpState typedef to typedefs.h and move
bf143f
the dump note functions from the opaque pointers to DumpState
bf143f
pointers.
bf143f
bf143f
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
bf143f
CC: Peter Maydell <peter.maydell@linaro.org>
bf143f
CC: Cédric Le Goater <clg@kaod.org>
bf143f
CC: Daniel Henrique Barboza <danielhb413@gmail.com>
bf143f
CC: David Gibson <david@gibson.dropbear.id.au>
bf143f
CC: Greg Kurz <groug@kaod.org>
bf143f
CC: Palmer Dabbelt <palmer@dabbelt.com>
bf143f
CC: Alistair Francis <alistair.francis@wdc.com>
bf143f
CC: Bin Meng <bin.meng@windriver.com>
bf143f
CC: Cornelia Huck <cohuck@redhat.com>
bf143f
CC: Thomas Huth <thuth@redhat.com>
bf143f
CC: Richard Henderson <richard.henderson@linaro.org>
bf143f
CC: David Hildenbrand <david@redhat.com>
bf143f
Acked-by: Daniel Henrique Barboza <danielhb413@gmail.com>
bf143f
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
bf143f
Message-Id: <20220811121111.9878-2-frankja@linux.ibm.com>
bf143f
(cherry picked from commit 1af0006ab959864dfa2f59e9136c5fb93000b61f)
bf143f
Signed-off-by: Cédric Le Goater <clg@redhat.com>
bf143f
---
bf143f
 include/hw/core/sysemu-cpu-ops.h |  8 ++++----
bf143f
 include/qemu/typedefs.h          |  1 +
bf143f
 target/arm/arch_dump.c           |  6 ++----
bf143f
 target/arm/cpu.h                 |  4 ++--
bf143f
 target/i386/arch_dump.c          | 30 +++++++++++++++---------------
bf143f
 target/i386/cpu.h                |  8 ++++----
bf143f
 target/ppc/arch_dump.c           | 18 +++++++++---------
bf143f
 target/ppc/cpu.h                 |  4 ++--
bf143f
 target/riscv/arch_dump.c         |  6 ++----
bf143f
 target/riscv/cpu.h               |  4 ++--
bf143f
 target/s390x/arch_dump.c         | 10 +++++-----
bf143f
 target/s390x/s390x-internal.h    |  2 +-
bf143f
 12 files changed, 49 insertions(+), 52 deletions(-)
bf143f
bf143f
diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-ops.h
bf143f
index a9ba39e5f2..ee169b872c 100644
bf143f
--- a/include/hw/core/sysemu-cpu-ops.h
bf143f
+++ b/include/hw/core/sysemu-cpu-ops.h
bf143f
@@ -53,25 +53,25 @@ typedef struct SysemuCPUOps {
bf143f
      * 32-bit VM coredump.
bf143f
      */
bf143f
     int (*write_elf32_note)(WriteCoreDumpFunction f, CPUState *cpu,
bf143f
-                            int cpuid, void *opaque);
bf143f
+                            int cpuid, DumpState *s);
bf143f
     /**
bf143f
      * @write_elf64_note: Callback for writing a CPU-specific ELF note to a
bf143f
      * 64-bit VM coredump.
bf143f
      */
bf143f
     int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu,
bf143f
-                            int cpuid, void *opaque);
bf143f
+                            int cpuid, DumpState *s);
bf143f
     /**
bf143f
      * @write_elf32_qemunote: Callback for writing a CPU- and QEMU-specific ELF
bf143f
      * note to a 32-bit VM coredump.
bf143f
      */
bf143f
     int (*write_elf32_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
bf143f
-                                void *opaque);
bf143f
+                                DumpState *s);
bf143f
     /**
bf143f
      * @write_elf64_qemunote: Callback for writing a CPU- and QEMU-specific ELF
bf143f
      * note to a 64-bit VM coredump.
bf143f
      */
bf143f
     int (*write_elf64_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
bf143f
-                                void *opaque);
bf143f
+                                DumpState *s);
bf143f
     /**
bf143f
      * @virtio_is_big_endian: Callback to return %true if a CPU which supports
bf143f
      * runtime configurable endianness is currently big-endian.
bf143f
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
bf143f
index ee60eb3de4..ac9d031be6 100644
bf143f
--- a/include/qemu/typedefs.h
bf143f
+++ b/include/qemu/typedefs.h
bf143f
@@ -125,6 +125,7 @@ typedef struct VirtIODevice VirtIODevice;
bf143f
 typedef struct Visitor Visitor;
bf143f
 typedef struct VMChangeStateEntry VMChangeStateEntry;
bf143f
 typedef struct VMStateDescription VMStateDescription;
bf143f
+typedef struct DumpState DumpState;
bf143f
 
bf143f
 /*
bf143f
  * Pointer types
bf143f
diff --git a/target/arm/arch_dump.c b/target/arm/arch_dump.c
bf143f
index 0184845310..3a824e0aa6 100644
bf143f
--- a/target/arm/arch_dump.c
bf143f
+++ b/target/arm/arch_dump.c
bf143f
@@ -232,12 +232,11 @@ static int aarch64_write_elf64_sve(WriteCoreDumpFunction f,
bf143f
 #endif
bf143f
 
bf143f
 int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                             int cpuid, void *opaque)
bf143f
+                             int cpuid, DumpState *s)
bf143f
 {
bf143f
     struct aarch64_note note;
bf143f
     ARMCPU *cpu = ARM_CPU(cs);
bf143f
     CPUARMState *env = &cpu->env;
bf143f
-    DumpState *s = opaque;
bf143f
     uint64_t pstate, sp;
bf143f
     int ret, i;
bf143f
 
bf143f
@@ -360,12 +359,11 @@ static int arm_write_elf32_vfp(WriteCoreDumpFunction f, CPUARMState *env,
bf143f
 }
bf143f
 
bf143f
 int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                             int cpuid, void *opaque)
bf143f
+                             int cpuid, DumpState *s)
bf143f
 {
bf143f
     struct arm_note note;
bf143f
     ARMCPU *cpu = ARM_CPU(cs);
bf143f
     CPUARMState *env = &cpu->env;
bf143f
-    DumpState *s = opaque;
bf143f
     int ret, i;
bf143f
     bool fpvalid = cpu_isar_feature(aa32_vfp_simd, cpu);
bf143f
 
bf143f
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
bf143f
index e33f37b70a..8d2f496ef9 100644
bf143f
--- a/target/arm/cpu.h
bf143f
+++ b/target/arm/cpu.h
bf143f
@@ -1065,9 +1065,9 @@ int arm_gen_dynamic_svereg_xml(CPUState *cpu, int base_reg);
bf143f
 const char *arm_gdb_get_dynamic_xml(CPUState *cpu, const char *xmlname);
bf143f
 
bf143f
 int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                             int cpuid, void *opaque);
bf143f
+                             int cpuid, DumpState *s);
bf143f
 int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                             int cpuid, void *opaque);
bf143f
+                             int cpuid, DumpState *s);
bf143f
 
bf143f
 #ifdef TARGET_AARCH64
bf143f
 int aarch64_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
bf143f
diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c
bf143f
index 004141fc04..c290910a04 100644
bf143f
--- a/target/i386/arch_dump.c
bf143f
+++ b/target/i386/arch_dump.c
bf143f
@@ -42,7 +42,7 @@ typedef struct {
bf143f
 
bf143f
 static int x86_64_write_elf64_note(WriteCoreDumpFunction f,
bf143f
                                    CPUX86State *env, int id,
bf143f
-                                   void *opaque)
bf143f
+                                   DumpState *s)
bf143f
 {
bf143f
     x86_64_user_regs_struct regs;
bf143f
     Elf64_Nhdr *note;
bf143f
@@ -94,7 +94,7 @@ static int x86_64_write_elf64_note(WriteCoreDumpFunction f,
bf143f
     buf += descsz - sizeof(x86_64_user_regs_struct)-sizeof(target_ulong);
bf143f
     memcpy(buf, &regs, sizeof(x86_64_user_regs_struct));
bf143f
 
bf143f
-    ret = f(note, note_size, opaque);
bf143f
+    ret = f(note, note_size, s);
bf143f
     g_free(note);
bf143f
     if (ret < 0) {
bf143f
         return -1;
bf143f
@@ -148,7 +148,7 @@ static void x86_fill_elf_prstatus(x86_elf_prstatus *prstatus, CPUX86State *env,
bf143f
 }
bf143f
 
bf143f
 static int x86_write_elf64_note(WriteCoreDumpFunction f, CPUX86State *env,
bf143f
-                                int id, void *opaque)
bf143f
+                                int id, DumpState *s)
bf143f
 {
bf143f
     x86_elf_prstatus prstatus;
bf143f
     Elf64_Nhdr *note;
bf143f
@@ -170,7 +170,7 @@ static int x86_write_elf64_note(WriteCoreDumpFunction f, CPUX86State *env,
bf143f
     buf += ROUND_UP(name_size, 4);
bf143f
     memcpy(buf, &prstatus, sizeof(prstatus));
bf143f
 
bf143f
-    ret = f(note, note_size, opaque);
bf143f
+    ret = f(note, note_size, s);
bf143f
     g_free(note);
bf143f
     if (ret < 0) {
bf143f
         return -1;
bf143f
@@ -180,7 +180,7 @@ static int x86_write_elf64_note(WriteCoreDumpFunction f, CPUX86State *env,
bf143f
 }
bf143f
 
bf143f
 int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                             int cpuid, void *opaque)
bf143f
+                             int cpuid, DumpState *s)
bf143f
 {
bf143f
     X86CPU *cpu = X86_CPU(cs);
bf143f
     int ret;
bf143f
@@ -189,10 +189,10 @@ int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
     bool lma = !!(first_x86_cpu->env.hflags & HF_LMA_MASK);
bf143f
 
bf143f
     if (lma) {
bf143f
-        ret = x86_64_write_elf64_note(f, &cpu->env, cpuid, opaque);
bf143f
+        ret = x86_64_write_elf64_note(f, &cpu->env, cpuid, s);
bf143f
     } else {
bf143f
 #endif
bf143f
-        ret = x86_write_elf64_note(f, &cpu->env, cpuid, opaque);
bf143f
+        ret = x86_write_elf64_note(f, &cpu->env, cpuid, s);
bf143f
 #ifdef TARGET_X86_64
bf143f
     }
bf143f
 #endif
bf143f
@@ -201,7 +201,7 @@ int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
 }
bf143f
 
bf143f
 int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                             int cpuid, void *opaque)
bf143f
+                             int cpuid, DumpState *s)
bf143f
 {
bf143f
     X86CPU *cpu = X86_CPU(cs);
bf143f
     x86_elf_prstatus prstatus;
bf143f
@@ -224,7 +224,7 @@ int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
     buf += ROUND_UP(name_size, 4);
bf143f
     memcpy(buf, &prstatus, sizeof(prstatus));
bf143f
 
bf143f
-    ret = f(note, note_size, opaque);
bf143f
+    ret = f(note, note_size, s);
bf143f
     g_free(note);
bf143f
     if (ret < 0) {
bf143f
         return -1;
bf143f
@@ -329,7 +329,7 @@ static void qemu_get_cpustate(QEMUCPUState *s, CPUX86State *env)
bf143f
 
bf143f
 static inline int cpu_write_qemu_note(WriteCoreDumpFunction f,
bf143f
                                       CPUX86State *env,
bf143f
-                                      void *opaque,
bf143f
+                                      DumpState *s,
bf143f
                                       int type)
bf143f
 {
bf143f
     QEMUCPUState state;
bf143f
@@ -369,7 +369,7 @@ static inline int cpu_write_qemu_note(WriteCoreDumpFunction f,
bf143f
     buf += ROUND_UP(name_size, 4);
bf143f
     memcpy(buf, &state, sizeof(state));
bf143f
 
bf143f
-    ret = f(note, note_size, opaque);
bf143f
+    ret = f(note, note_size, s);
bf143f
     g_free(note);
bf143f
     if (ret < 0) {
bf143f
         return -1;
bf143f
@@ -379,19 +379,19 @@ static inline int cpu_write_qemu_note(WriteCoreDumpFunction f,
bf143f
 }
bf143f
 
bf143f
 int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                                 void *opaque)
bf143f
+                                 DumpState *s)
bf143f
 {
bf143f
     X86CPU *cpu = X86_CPU(cs);
bf143f
 
bf143f
-    return cpu_write_qemu_note(f, &cpu->env, opaque, 1);
bf143f
+    return cpu_write_qemu_note(f, &cpu->env, s, 1);
bf143f
 }
bf143f
 
bf143f
 int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                                 void *opaque)
bf143f
+                                 DumpState *s)
bf143f
 {
bf143f
     X86CPU *cpu = X86_CPU(cs);
bf143f
 
bf143f
-    return cpu_write_qemu_note(f, &cpu->env, opaque, 0);
bf143f
+    return cpu_write_qemu_note(f, &cpu->env, s, 0);
bf143f
 }
bf143f
 
bf143f
 int cpu_get_dump_info(ArchDumpInfo *info,
bf143f
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
bf143f
index 006b735fe4..5d2ddd81b9 100644
bf143f
--- a/target/i386/cpu.h
bf143f
+++ b/target/i386/cpu.h
bf143f
@@ -1887,13 +1887,13 @@ extern const VMStateDescription vmstate_x86_cpu;
bf143f
 int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);
bf143f
 
bf143f
 int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
bf143f
-                             int cpuid, void *opaque);
bf143f
+                             int cpuid, DumpState *s);
bf143f
 int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
bf143f
-                             int cpuid, void *opaque);
bf143f
+                             int cpuid, DumpState *s);
bf143f
 int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
bf143f
-                                 void *opaque);
bf143f
+                                 DumpState *s);
bf143f
 int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
bf143f
-                                 void *opaque);
bf143f
+                                 DumpState *s);
bf143f
 
bf143f
 void x86_cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
bf143f
                                 Error **errp);
bf143f
diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c
bf143f
index bb392f6d88..e9f512bcd4 100644
bf143f
--- a/target/ppc/arch_dump.c
bf143f
+++ b/target/ppc/arch_dump.c
bf143f
@@ -270,23 +270,23 @@ ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
bf143f
 static int ppc_write_all_elf_notes(const char *note_name,
bf143f
                                    WriteCoreDumpFunction f,
bf143f
                                    PowerPCCPU *cpu, int id,
bf143f
-                                   void *opaque)
bf143f
+                                   DumpState *s)
bf143f
 {
bf143f
-    NoteFuncArg arg = { .state = opaque };
bf143f
+    NoteFuncArg arg = { .state = s };
bf143f
     int ret = -1;
bf143f
     int note_size;
bf143f
     const NoteFuncDesc *nf;
bf143f
 
bf143f
     for (nf = note_func; nf->note_contents_func; nf++) {
bf143f
-        arg.note.hdr.n_namesz = cpu_to_dump32(opaque, sizeof(arg.note.name));
bf143f
-        arg.note.hdr.n_descsz = cpu_to_dump32(opaque, nf->contents_size);
bf143f
+        arg.note.hdr.n_namesz = cpu_to_dump32(s, sizeof(arg.note.name));
bf143f
+        arg.note.hdr.n_descsz = cpu_to_dump32(s, nf->contents_size);
bf143f
         strncpy(arg.note.name, note_name, sizeof(arg.note.name));
bf143f
 
bf143f
         (*nf->note_contents_func)(&arg, cpu);
bf143f
 
bf143f
         note_size =
bf143f
             sizeof(arg.note) - sizeof(arg.note.contents) + nf->contents_size;
bf143f
-        ret = f(&arg.note, note_size, opaque);
bf143f
+        ret = f(&arg.note, note_size, s);
bf143f
         if (ret < 0) {
bf143f
             return -1;
bf143f
         }
bf143f
@@ -295,15 +295,15 @@ static int ppc_write_all_elf_notes(const char *note_name,
bf143f
 }
bf143f
 
bf143f
 int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                               int cpuid, void *opaque)
bf143f
+                               int cpuid, DumpState *s)
bf143f
 {
bf143f
     PowerPCCPU *cpu = POWERPC_CPU(cs);
bf143f
-    return ppc_write_all_elf_notes("CORE", f, cpu, cpuid, opaque);
bf143f
+    return ppc_write_all_elf_notes("CORE", f, cpu, cpuid, s);
bf143f
 }
bf143f
 
bf143f
 int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                               int cpuid, void *opaque)
bf143f
+                               int cpuid, DumpState *s)
bf143f
 {
bf143f
     PowerPCCPU *cpu = POWERPC_CPU(cs);
bf143f
-    return ppc_write_all_elf_notes("CORE", f, cpu, cpuid, opaque);
bf143f
+    return ppc_write_all_elf_notes("CORE", f, cpu, cpuid, s);
bf143f
 }
bf143f
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
bf143f
index 23e8b76c85..f5fb284706 100644
bf143f
--- a/target/ppc/cpu.h
bf143f
+++ b/target/ppc/cpu.h
bf143f
@@ -1289,9 +1289,9 @@ void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu);
bf143f
 const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name);
bf143f
 #endif
bf143f
 int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                               int cpuid, void *opaque);
bf143f
+                               int cpuid, DumpState *s);
bf143f
 int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                               int cpuid, void *opaque);
bf143f
+                               int cpuid, DumpState *s);
bf143f
 #ifndef CONFIG_USER_ONLY
bf143f
 void ppc_cpu_do_interrupt(CPUState *cpu);
bf143f
 bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
bf143f
diff --git a/target/riscv/arch_dump.c b/target/riscv/arch_dump.c
bf143f
index 709f621d82..736a232956 100644
bf143f
--- a/target/riscv/arch_dump.c
bf143f
+++ b/target/riscv/arch_dump.c
bf143f
@@ -64,12 +64,11 @@ static void riscv64_note_init(struct riscv64_note *note, DumpState *s,
bf143f
 }
bf143f
 
bf143f
 int riscv_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                               int cpuid, void *opaque)
bf143f
+                               int cpuid, DumpState *s)
bf143f
 {
bf143f
     struct riscv64_note note;
bf143f
     RISCVCPU *cpu = RISCV_CPU(cs);
bf143f
     CPURISCVState *env = &cpu->env;
bf143f
-    DumpState *s = opaque;
bf143f
     int ret, i = 0;
bf143f
     const char name[] = "CORE";
bf143f
 
bf143f
@@ -134,12 +133,11 @@ static void riscv32_note_init(struct riscv32_note *note, DumpState *s,
bf143f
 }
bf143f
 
bf143f
 int riscv_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                               int cpuid, void *opaque)
bf143f
+                               int cpuid, DumpState *s)
bf143f
 {
bf143f
     struct riscv32_note note;
bf143f
     RISCVCPU *cpu = RISCV_CPU(cs);
bf143f
     CPURISCVState *env = &cpu->env;
bf143f
-    DumpState *s = opaque;
bf143f
     int ret, i;
bf143f
     const char name[] = "CORE";
bf143f
 
bf143f
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
bf143f
index 0760c0af93..4cce524b2c 100644
bf143f
--- a/target/riscv/cpu.h
bf143f
+++ b/target/riscv/cpu.h
bf143f
@@ -344,9 +344,9 @@ extern const char * const riscv_fpr_regnames[];
bf143f
 const char *riscv_cpu_get_trap_name(target_ulong cause, bool async);
bf143f
 void riscv_cpu_do_interrupt(CPUState *cpu);
bf143f
 int riscv_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                               int cpuid, void *opaque);
bf143f
+                               int cpuid, DumpState *s);
bf143f
 int riscv_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                               int cpuid, void *opaque);
bf143f
+                               int cpuid, DumpState *s);
bf143f
 int riscv_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
bf143f
 int riscv_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
bf143f
 bool riscv_cpu_fp_enabled(CPURISCVState *env);
bf143f
diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c
bf143f
index 08daf93ae1..f60a14920d 100644
bf143f
--- a/target/s390x/arch_dump.c
bf143f
+++ b/target/s390x/arch_dump.c
bf143f
@@ -204,7 +204,7 @@ static const NoteFuncDesc note_linux[] = {
bf143f
 static int s390x_write_elf64_notes(const char *note_name,
bf143f
                                        WriteCoreDumpFunction f,
bf143f
                                        S390CPU *cpu, int id,
bf143f
-                                       void *opaque,
bf143f
+                                       DumpState *s,
bf143f
                                        const NoteFuncDesc *funcs)
bf143f
 {
bf143f
     Note note;
bf143f
@@ -222,7 +222,7 @@ static int s390x_write_elf64_notes(const char *note_name,
bf143f
         (*nf->note_contents_func)(&note, cpu, id);
bf143f
 
bf143f
         note_size = sizeof(note) - sizeof(note.contents) + nf->contents_size;
bf143f
-        ret = f(&note, note_size, opaque);
bf143f
+        ret = f(&note, note_size, s);
bf143f
 
bf143f
         if (ret < 0) {
bf143f
             return -1;
bf143f
@@ -235,16 +235,16 @@ static int s390x_write_elf64_notes(const char *note_name,
bf143f
 
bf143f
 
bf143f
 int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                              int cpuid, void *opaque)
bf143f
+                              int cpuid, DumpState *s)
bf143f
 {
bf143f
     S390CPU *cpu = S390_CPU(cs);
bf143f
     int r;
bf143f
 
bf143f
-    r = s390x_write_elf64_notes("CORE", f, cpu, cpuid, opaque, note_core);
bf143f
+    r = s390x_write_elf64_notes("CORE", f, cpu, cpuid, s, note_core);
bf143f
     if (r) {
bf143f
         return r;
bf143f
     }
bf143f
-    return s390x_write_elf64_notes("LINUX", f, cpu, cpuid, opaque, note_linux);
bf143f
+    return s390x_write_elf64_notes("LINUX", f, cpu, cpuid, s, note_linux);
bf143f
 }
bf143f
 
bf143f
 int cpu_get_dump_info(ArchDumpInfo *info,
bf143f
diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h
bf143f
index 1a178aed41..02cf6c3f43 100644
bf143f
--- a/target/s390x/s390x-internal.h
bf143f
+++ b/target/s390x/s390x-internal.h
bf143f
@@ -228,7 +228,7 @@ static inline hwaddr decode_basedisp_s(CPUS390XState *env, uint32_t ipb,
bf143f
 
bf143f
 /* arch_dump.c */
bf143f
 int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
bf143f
-                              int cpuid, void *opaque);
bf143f
+                              int cpuid, DumpState *s);
bf143f
 
bf143f
 
bf143f
 /* cc_helper.c */
bf143f
-- 
bf143f
2.37.3
bf143f