Skip to content
Snippets Groups Projects
Commit 5609400a authored by Fabiano Rosas's avatar Fabiano Rosas Committed by Cédric Le Goater
Browse files

target/ppc: Set the correct endianness for powernv memory dumps


We use the endianness of interrupts to determine which endianness to
use for the guest kernel memory dump. For machines that support HILE
(powernv8 and up) we have been always generating big endian dump
files.

This patch uses the HILE support recently added to
ppc_interrupts_little_endian to fix the endianness of the dumps for
powernv machines.

Here are two dumps created at different moments:

$ file skiboot.dump
skiboot.dump: ELF 64-bit MSB core file, 64-bit PowerPC ...

$ file kernel.dump
kernel.dump: ELF 64-bit LSB core file, 64-bit PowerPC ...

Suggested-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarFabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220107222601.4101511-9-farosas@linux.ibm.com>
Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
parent dc88dd0a
No related branches found
No related tags found
No related merge requests found
......@@ -237,7 +237,7 @@ int cpu_get_dump_info(ArchDumpInfo *info,
info->d_machine = PPC_ELF_MACHINE;
info->d_class = ELFCLASS;
if (ppc_interrupts_little_endian(cpu, false)) {
if (ppc_interrupts_little_endian(cpu, cpu->env.has_hv_mode)) {
info->d_endian = ELFDATA2LSB;
} else {
info->d_endian = ELFDATA2MSB;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment