Commit a8256e9ee1 for qemu.org
commit a8256e9ee153d555402f096e3a67720660329e7f
Author: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Date: Wed Oct 21 11:12:32 2026 -0700
target/ppc: implement get_dump_info sysemu op
For now, we keep the global cpu_get_dump_info symbol defined.
Reviewed-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20261021181244.867840-10-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c
index 80ac6c3e32..2296a0c9e8 100644
--- a/target/ppc/arch_dump.c
+++ b/target/ppc/arch_dump.c
@@ -17,6 +17,7 @@
#include "elf.h"
#include "system/dump.h"
#include "system/kvm.h"
+#include "internal.h"
#ifdef TARGET_PPC64
#define ELFCLASS ELFCLASS64
@@ -229,16 +230,10 @@ static const struct NoteFuncDescStruct {
typedef struct NoteFuncDescStruct NoteFuncDesc;
-int cpu_get_dump_info(ArchDumpInfo *info,
- const struct GuestPhysBlockList *guest_phys_blocks)
+void ppc_get_dump_info(const CPUState *cs, ArchDumpInfo *info,
+ const GuestPhysBlockList *guest_phys_blocks)
{
- PowerPCCPU *cpu;
-
- if (first_cpu == NULL) {
- return -1;
- }
-
- cpu = POWERPC_CPU(first_cpu);
+ const PowerPCCPU *cpu = POWERPC_CPU(cs);
info->d_machine = PPC_ELF_MACHINE;
info->d_class = ELFCLASS;
@@ -253,7 +248,16 @@ int cpu_get_dump_info(ArchDumpInfo *info,
"pseries-", 8) == 0) {
info->page_size = (1U << 16);
}
+}
+
+int cpu_get_dump_info(ArchDumpInfo *info,
+ const struct GuestPhysBlockList *guest_phys_blocks)
+{
+ if (first_cpu == NULL) {
+ return -1;
+ }
+ ppc_get_dump_info(first_cpu, info, guest_phys_blocks);
return 0;
}
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index b711f9c0a8..5853a92bff 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -7473,6 +7473,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = {
.get_phys_addr_debug = ppc_cpu_get_phys_addr_debug,
.write_elf32_note = ppc32_cpu_write_elf32_note,
.write_elf64_note = ppc64_cpu_write_elf64_note,
+ .get_dump_info = ppc_get_dump_info,
.internal_is_big_endian = ppc_cpu_is_big_endian,
.legacy_vmsd = &vmstate_ppc_cpu,
};
diff --git a/target/ppc/internal.h b/target/ppc/internal.h
index a20a0f9f7e..02dc68fe2c 100644
--- a/target/ppc/internal.h
+++ b/target/ppc/internal.h
@@ -324,4 +324,9 @@ static inline int ger_pack_masks(int pmsk, int ymsk, int xmsk)
TCGTBCPUState ppc_get_tb_cpu_state(CPUState *cs);
#endif
+#ifndef CONFIG_USER_ONLY
+void ppc_get_dump_info(const CPUState *cs, ArchDumpInfo *info,
+ const GuestPhysBlockList *guest_phys_blocks);
+#endif
+
#endif /* PPC_INTERNAL_H */