Commit 9cf15a3c0d for qemu.org
commit 9cf15a3c0d6073de8e373a476f8757c04cd58f1a
Author: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Date: Wed Oct 21 11:12:43 2026 -0700
target/loongarch: 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-21-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
diff --git a/target/loongarch/arch_dump.c b/target/loongarch/arch_dump.c
index 853a60d7b8..47036105e0 100644
--- a/target/loongarch/arch_dump.c
+++ b/target/loongarch/arch_dump.c
@@ -150,7 +150,8 @@ void loongarch_get_dump_info(const CPUState *cs, ArchDumpInfo *info,
info->d_class = ELFCLASS64;
}
-ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
+size_t loongarch_get_note_size(const CPUState *cs, int class,
+ int machine, int nr_cpus)
{
size_t note_size = 0;
@@ -160,3 +161,8 @@ ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
return note_size * nr_cpus;
}
+
+ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
+{
+ return loongarch_get_note_size(first_cpu, class, machine, nr_cpus);
+}
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 65772f3094..5e182922b7 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -842,6 +842,7 @@ static const struct SysemuCPUOps loongarch_sysemu_ops = {
.has_work = loongarch_cpu_has_work,
.write_elf64_note = loongarch_cpu_write_elf64_note,
.get_dump_info = loongarch_get_dump_info,
+ .get_note_size = loongarch_get_note_size,
.get_phys_addr_debug = loongarch_cpu_get_phys_addr_debug,
};
diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h
index 041d07442f..952c98f74a 100644
--- a/target/loongarch/internals.h
+++ b/target/loongarch/internals.h
@@ -53,5 +53,7 @@ int loongarch_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
void loongarch_get_dump_info(const CPUState *cs, ArchDumpInfo *info,
const GuestPhysBlockList *guest_phys_blocks);
+size_t loongarch_get_note_size(const CPUState *cs, int class,
+ int machine, int nr_cpus);
#endif