Commit 3fb20a1247 for qemu.org
commit 3fb20a12477440ff58d6d3693d884e3e0e1fcf7e
Author: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Date: Wed Oct 21 11:12:40 2026 -0700
target/ppc: implement get_note_size sysemu op
For now, we keep the global cpu_get_note_size 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-18-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 86e31c6546..42e5cf936d 100644
--- a/target/ppc/arch_dump.c
+++ b/target/ppc/arch_dump.c
@@ -250,7 +250,8 @@ void ppc_get_dump_info(const CPUState *cs, ArchDumpInfo *info,
}
}
-ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
+size_t ppc_get_note_size(const CPUState *cs, int class, int machine,
+ int nr_cpus)
{
int name_size = 8; /* "CORE" or "QEMU" rounded */
size_t elf_note_size = 0;
@@ -266,6 +267,11 @@ ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
return (elf_note_size) * nr_cpus;
}
+ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
+{
+ return ppc_get_note_size(first_cpu, class, machine, nr_cpus);
+}
+
static int ppc_write_all_elf_notes(const char *note_name,
WriteCoreDumpFunction f,
PowerPCCPU *cpu, int id,
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 5853a92bff..578dd9194e 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -7474,6 +7474,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = {
.write_elf32_note = ppc32_cpu_write_elf32_note,
.write_elf64_note = ppc64_cpu_write_elf64_note,
.get_dump_info = ppc_get_dump_info,
+ .get_note_size = ppc_get_note_size,
.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 02dc68fe2c..b3ed57eaf7 100644
--- a/target/ppc/internal.h
+++ b/target/ppc/internal.h
@@ -327,6 +327,8 @@ TCGTBCPUState ppc_get_tb_cpu_state(CPUState *cs);
#ifndef CONFIG_USER_ONLY
void ppc_get_dump_info(const CPUState *cs, ArchDumpInfo *info,
const GuestPhysBlockList *guest_phys_blocks);
+size_t ppc_get_note_size(const CPUState *cs, int class, int machine,
+ int nr_cpus);
#endif
#endif /* PPC_INTERNAL_H */