From nobody Tue Feb 10 02:00:55 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665075286; cv=none; d=zohomail.com; s=zohoarc; b=TDbOc33up0vLTm66EYEM++641UePwt2tNlsxOJQrLpzgwKvfx+l0ydkEMTtjR7gXFyXjhrPSqlmUQmFY8UygQcFTB6IOEJ+SSMroZNfp93EhF3FmmUHjSEOZU8XlmC8VzzrgEpm83HcG0OlPAwDJY8GN4wP92vSgvp4aqQ+oCBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665075286; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TVvpc/SrUvmDLkZ9chOAhp6yjjLI22kiwBGCNoZZB4s=; b=BncqplPCxNAeIp6+rUHyFk+iS8aDp9ZbjDHy6PW3bzbw1rzAK/3DSC/DHSWAnWj9sLYmEz5Byeu1lr+HLnJkstl/WyTCy0r7g7HYpTjjt0cSh+vboDLDZVoi8Ti8sharEcjj9u81uFcopOK1yAtCs/lqtJoLN6VEV3ASbqDBn9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665075286250769.1172248974026; Thu, 6 Oct 2022 09:54:46 -0700 (PDT) Received: from localhost ([::1]:57808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogU8y-0005A5-JX for importer@patchew.org; Thu, 06 Oct 2022 12:54:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogStd-0003Op-Ls for qemu-devel@nongnu.org; Thu, 06 Oct 2022 11:34:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:51322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogStb-00008c-95 for qemu-devel@nongnu.org; Thu, 06 Oct 2022 11:34:49 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-a3lxBPbnOJetHbbjZawmqA-1; Thu, 06 Oct 2022 11:34:41 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4F28A858F17; Thu, 6 Oct 2022 15:34:40 +0000 (UTC) Received: from localhost (unknown [10.39.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 642BD403167; Thu, 6 Oct 2022 15:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665070486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TVvpc/SrUvmDLkZ9chOAhp6yjjLI22kiwBGCNoZZB4s=; b=U9atOK/c5zc9Da+L7CUht/h4/LA/MiiuYxsGytbwmkuJEL9T66yhKs+wJoSp6vSyZFu0iw h6XoiIRFOOxPVB1TgQMTPoKmZA++Kl8wWuxZ8avmHXtDDPW69a/9JXoiWxiNgjNUwIIMvq z6yefs03vB/hkERshN1KTX/pvrhaGeU= X-MC-Unique: a3lxBPbnOJetHbbjZawmqA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Bin Meng , Daniel Henrique Barboza , qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Alistair Francis , qemu-riscv@nongnu.org, Peter Maydell , viktor.prutyanov@redhat.com, Greg Kurz , frankja@linux.ibm.com, David Hildenbrand , Palmer Dabbelt , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , qemu-arm@nongnu.org, Cornelia Huck , Thomas Huth Subject: [PULL 01/10] dump: Replace opaque DumpState pointer with a typed one Date: Thu, 6 Oct 2022 19:34:20 +0400 Message-Id: <20221006153430.2775580-2-marcandre.lureau@redhat.com> In-Reply-To: <20221006153430.2775580-1-marcandre.lureau@redhat.com> References: <20221006153430.2775580-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665075289027100001 From: Janosch Frank It's always better to convey the type of a pointer if at all possible. So let's add the DumpState typedef to typedefs.h and move the dump note functions from the opaque pointers to DumpState pointers. Signed-off-by: Janosch Frank CC: Peter Maydell CC: C=C3=A9dric Le Goater CC: Daniel Henrique Barboza CC: David Gibson CC: Greg Kurz CC: Palmer Dabbelt CC: Alistair Francis CC: Bin Meng CC: Cornelia Huck CC: Thomas Huth CC: Richard Henderson CC: David Hildenbrand Acked-by: Daniel Henrique Barboza Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220811121111.9878-2-frankja@linux.ibm.com> --- include/hw/core/sysemu-cpu-ops.h | 8 ++++---- include/qemu/typedefs.h | 1 + target/arm/cpu.h | 4 ++-- target/i386/cpu.h | 8 ++++---- target/ppc/cpu.h | 4 ++-- target/riscv/cpu.h | 4 ++-- target/s390x/s390x-internal.h | 2 +- target/arm/arch_dump.c | 6 ++---- target/i386/arch_dump.c | 30 +++++++++++++++--------------- target/ppc/arch_dump.c | 18 +++++++++--------- target/riscv/arch_dump.c | 6 ++---- target/s390x/arch_dump.c | 10 +++++----- 12 files changed, 49 insertions(+), 52 deletions(-) diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index a9ba39e5f2..ee169b872c 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -53,25 +53,25 @@ typedef struct SysemuCPUOps { * 32-bit VM coredump. */ int (*write_elf32_note)(WriteCoreDumpFunction f, CPUState *cpu, - int cpuid, void *opaque); + int cpuid, DumpState *s); /** * @write_elf64_note: Callback for writing a CPU-specific ELF note to a * 64-bit VM coredump. */ int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu, - int cpuid, void *opaque); + int cpuid, DumpState *s); /** * @write_elf32_qemunote: Callback for writing a CPU- and QEMU-specifi= c ELF * note to a 32-bit VM coredump. */ int (*write_elf32_qemunote)(WriteCoreDumpFunction f, CPUState *cpu, - void *opaque); + DumpState *s); /** * @write_elf64_qemunote: Callback for writing a CPU- and QEMU-specifi= c ELF * note to a 64-bit VM coredump. */ int (*write_elf64_qemunote)(WriteCoreDumpFunction f, CPUState *cpu, - void *opaque); + DumpState *s); /** * @virtio_is_big_endian: Callback to return %true if a CPU which supp= orts * runtime configurable endianness is currently big-endian. diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 5f95169827..6d4e6d9708 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -131,6 +131,7 @@ typedef struct VirtIODevice VirtIODevice; typedef struct Visitor Visitor; typedef struct VMChangeStateEntry VMChangeStateEntry; typedef struct VMStateDescription VMStateDescription; +typedef struct DumpState DumpState; =20 /* * Pointer types diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 429ed42eec..85dc263318 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1102,9 +1102,9 @@ int arm_gen_dynamic_svereg_xml(CPUState *cpu, int bas= e_reg); const char *arm_gdb_get_dynamic_xml(CPUState *cpu, const char *xmlname); =20 int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); + int cpuid, DumpState *s); int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); + int cpuid, DumpState *s); =20 #ifdef TARGET_AARCH64 int aarch64_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 82004b65b9..b75108d6a3 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1938,13 +1938,13 @@ extern const VMStateDescription vmstate_x86_cpu; int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request); =20 int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu, - int cpuid, void *opaque); + int cpuid, DumpState *s); int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu, - int cpuid, void *opaque); + int cpuid, DumpState *s); int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu, - void *opaque); + DumpState *s); int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu, - void *opaque); + DumpState *s); =20 void x86_cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list, Error **errp); diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 7f73e2ac81..cca6c4e51c 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1354,9 +1354,9 @@ void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu); const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name); #endif int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); + int cpuid, DumpState *s); int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); + int cpuid, DumpState *s); #ifndef CONFIG_USER_ONLY void ppc_cpu_do_interrupt(CPUState *cpu); bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req); diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index b131fa8c8e..3a9e25053f 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -534,9 +534,9 @@ extern const char * const riscv_fpr_regnames[]; const char *riscv_cpu_get_trap_name(target_ulong cause, bool async); void riscv_cpu_do_interrupt(CPUState *cpu); int riscv_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); + int cpuid, DumpState *s); int riscv_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); + int cpuid, DumpState *s); int riscv_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int riscv_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); int riscv_cpu_hviprio_index2irq(int index, int *out_irq, int *out_rdzero); diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 6aba7fd0ca..b5ae0ae364 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -227,7 +227,7 @@ static inline hwaddr decode_basedisp_s(CPUS390XState *e= nv, uint32_t ipb, =20 /* arch_dump.c */ int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); + int cpuid, DumpState *s); =20 =20 /* cc_helper.c */ diff --git a/target/arm/arch_dump.c b/target/arm/arch_dump.c index b1f040e69f..2d8e41ab8a 100644 --- a/target/arm/arch_dump.c +++ b/target/arm/arch_dump.c @@ -232,12 +232,11 @@ static int aarch64_write_elf64_sve(WriteCoreDumpFunct= ion f, #endif =20 int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { struct aarch64_note note; ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; - DumpState *s =3D opaque; uint64_t pstate, sp; int ret, i; =20 @@ -360,12 +359,11 @@ static int arm_write_elf32_vfp(WriteCoreDumpFunction = f, CPUARMState *env, } =20 int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { struct arm_note note; ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; - DumpState *s =3D opaque; int ret, i; bool fpvalid =3D cpu_isar_feature(aa32_vfp_simd, cpu); =20 diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c index 004141fc04..c290910a04 100644 --- a/target/i386/arch_dump.c +++ b/target/i386/arch_dump.c @@ -42,7 +42,7 @@ typedef struct { =20 static int x86_64_write_elf64_note(WriteCoreDumpFunction f, CPUX86State *env, int id, - void *opaque) + DumpState *s) { x86_64_user_regs_struct regs; Elf64_Nhdr *note; @@ -94,7 +94,7 @@ static int x86_64_write_elf64_note(WriteCoreDumpFunction = f, buf +=3D descsz - sizeof(x86_64_user_regs_struct)-sizeof(target_ulong); memcpy(buf, ®s, sizeof(x86_64_user_regs_struct)); =20 - ret =3D f(note, note_size, opaque); + ret =3D f(note, note_size, s); g_free(note); if (ret < 0) { return -1; @@ -148,7 +148,7 @@ static void x86_fill_elf_prstatus(x86_elf_prstatus *prs= tatus, CPUX86State *env, } =20 static int x86_write_elf64_note(WriteCoreDumpFunction f, CPUX86State *env, - int id, void *opaque) + int id, DumpState *s) { x86_elf_prstatus prstatus; Elf64_Nhdr *note; @@ -170,7 +170,7 @@ static int x86_write_elf64_note(WriteCoreDumpFunction f= , CPUX86State *env, buf +=3D ROUND_UP(name_size, 4); memcpy(buf, &prstatus, sizeof(prstatus)); =20 - ret =3D f(note, note_size, opaque); + ret =3D f(note, note_size, s); g_free(note); if (ret < 0) { return -1; @@ -180,7 +180,7 @@ static int x86_write_elf64_note(WriteCoreDumpFunction f= , CPUX86State *env, } =20 int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { X86CPU *cpu =3D X86_CPU(cs); int ret; @@ -189,10 +189,10 @@ int x86_cpu_write_elf64_note(WriteCoreDumpFunction f,= CPUState *cs, bool lma =3D !!(first_x86_cpu->env.hflags & HF_LMA_MASK); =20 if (lma) { - ret =3D x86_64_write_elf64_note(f, &cpu->env, cpuid, opaque); + ret =3D x86_64_write_elf64_note(f, &cpu->env, cpuid, s); } else { #endif - ret =3D x86_write_elf64_note(f, &cpu->env, cpuid, opaque); + ret =3D x86_write_elf64_note(f, &cpu->env, cpuid, s); #ifdef TARGET_X86_64 } #endif @@ -201,7 +201,7 @@ int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, C= PUState *cs, } =20 int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { X86CPU *cpu =3D X86_CPU(cs); x86_elf_prstatus prstatus; @@ -224,7 +224,7 @@ int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, C= PUState *cs, buf +=3D ROUND_UP(name_size, 4); memcpy(buf, &prstatus, sizeof(prstatus)); =20 - ret =3D f(note, note_size, opaque); + ret =3D f(note, note_size, s); g_free(note); if (ret < 0) { return -1; @@ -329,7 +329,7 @@ static void qemu_get_cpustate(QEMUCPUState *s, CPUX86St= ate *env) =20 static inline int cpu_write_qemu_note(WriteCoreDumpFunction f, CPUX86State *env, - void *opaque, + DumpState *s, int type) { QEMUCPUState state; @@ -369,7 +369,7 @@ static inline int cpu_write_qemu_note(WriteCoreDumpFunc= tion f, buf +=3D ROUND_UP(name_size, 4); memcpy(buf, &state, sizeof(state)); =20 - ret =3D f(note, note_size, opaque); + ret =3D f(note, note_size, s); g_free(note); if (ret < 0) { return -1; @@ -379,19 +379,19 @@ static inline int cpu_write_qemu_note(WriteCoreDumpFu= nction f, } =20 int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cs, - void *opaque) + DumpState *s) { X86CPU *cpu =3D X86_CPU(cs); =20 - return cpu_write_qemu_note(f, &cpu->env, opaque, 1); + return cpu_write_qemu_note(f, &cpu->env, s, 1); } =20 int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cs, - void *opaque) + DumpState *s) { X86CPU *cpu =3D X86_CPU(cs); =20 - return cpu_write_qemu_note(f, &cpu->env, opaque, 0); + return cpu_write_qemu_note(f, &cpu->env, s, 0); } =20 int cpu_get_dump_info(ArchDumpInfo *info, diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c index 1139cead9f..f58e6359d5 100644 --- a/target/ppc/arch_dump.c +++ b/target/ppc/arch_dump.c @@ -270,23 +270,23 @@ ssize_t cpu_get_note_size(int class, int machine, int= nr_cpus) static int ppc_write_all_elf_notes(const char *note_name, WriteCoreDumpFunction f, PowerPCCPU *cpu, int id, - void *opaque) + DumpState *s) { - NoteFuncArg arg =3D { .state =3D opaque }; + NoteFuncArg arg =3D { .state =3D s }; int ret =3D -1; int note_size; const NoteFuncDesc *nf; =20 for (nf =3D note_func; nf->note_contents_func; nf++) { - arg.note.hdr.n_namesz =3D cpu_to_dump32(opaque, sizeof(arg.note.na= me)); - arg.note.hdr.n_descsz =3D cpu_to_dump32(opaque, nf->contents_size); + arg.note.hdr.n_namesz =3D cpu_to_dump32(s, sizeof(arg.note.name)); + arg.note.hdr.n_descsz =3D cpu_to_dump32(s, nf->contents_size); strncpy(arg.note.name, note_name, sizeof(arg.note.name)); =20 (*nf->note_contents_func)(&arg, cpu); =20 note_size =3D sizeof(arg.note) - sizeof(arg.note.contents) + nf->contents_si= ze; - ret =3D f(&arg.note, note_size, opaque); + ret =3D f(&arg.note, note_size, s); if (ret < 0) { return -1; } @@ -295,15 +295,15 @@ static int ppc_write_all_elf_notes(const char *note_n= ame, } =20 int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); - return ppc_write_all_elf_notes("CORE", f, cpu, cpuid, opaque); + return ppc_write_all_elf_notes("CORE", f, cpu, cpuid, s); } =20 int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); - return ppc_write_all_elf_notes("CORE", f, cpu, cpuid, opaque); + return ppc_write_all_elf_notes("CORE", f, cpu, cpuid, s); } diff --git a/target/riscv/arch_dump.c b/target/riscv/arch_dump.c index 709f621d82..736a232956 100644 --- a/target/riscv/arch_dump.c +++ b/target/riscv/arch_dump.c @@ -64,12 +64,11 @@ static void riscv64_note_init(struct riscv64_note *note= , DumpState *s, } =20 int riscv_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { struct riscv64_note note; RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; - DumpState *s =3D opaque; int ret, i =3D 0; const char name[] =3D "CORE"; =20 @@ -134,12 +133,11 @@ static void riscv32_note_init(struct riscv32_note *no= te, DumpState *s, } =20 int riscv_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { struct riscv32_note note; RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; - DumpState *s =3D opaque; int ret, i; const char name[] =3D "CORE"; =20 diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index 08daf93ae1..f60a14920d 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -204,7 +204,7 @@ static const NoteFuncDesc note_linux[] =3D { static int s390x_write_elf64_notes(const char *note_name, WriteCoreDumpFunction f, S390CPU *cpu, int id, - void *opaque, + DumpState *s, const NoteFuncDesc *funcs) { Note note; @@ -222,7 +222,7 @@ static int s390x_write_elf64_notes(const char *note_nam= e, (*nf->note_contents_func)(¬e, cpu, id); =20 note_size =3D sizeof(note) - sizeof(note.contents) + nf->contents_= size; - ret =3D f(¬e, note_size, opaque); + ret =3D f(¬e, note_size, s); =20 if (ret < 0) { return -1; @@ -235,16 +235,16 @@ static int s390x_write_elf64_notes(const char *note_n= ame, =20 =20 int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque) + int cpuid, DumpState *s) { S390CPU *cpu =3D S390_CPU(cs); int r; =20 - r =3D s390x_write_elf64_notes("CORE", f, cpu, cpuid, opaque, note_core= ); + r =3D s390x_write_elf64_notes("CORE", f, cpu, cpuid, s, note_core); if (r) { return r; } - return s390x_write_elf64_notes("LINUX", f, cpu, cpuid, opaque, note_li= nux); + return s390x_write_elf64_notes("LINUX", f, cpu, cpuid, s, note_linux); } =20 int cpu_get_dump_info(ArchDumpInfo *info, --=20 2.37.3