From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhDw7-0002Q0-Ay for qemu-devel@nongnu.org; Mon, 05 May 2014 04:07:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhDvx-0005cV-4T for qemu-devel@nongnu.org; Mon, 05 May 2014 04:07:43 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:36539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhDvw-0005cD-Qn for qemu-devel@nongnu.org; Mon, 05 May 2014 04:07:33 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 5 May 2014 09:07:32 +0100 From: Greg Kurz Date: Mon, 05 May 2014 10:07:24 +0200 Message-ID: <20140505080708.25523.5757.stgit@bahia.local> In-Reply-To: <20140505074816.25523.71374.stgit@bahia.local> References: <20140505074816.25523.71374.stgit@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2 4/4] ppc64 dump: Set the correct endianness in ELF dump header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: afaerber@suse.de, agraf@suse.de Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, bharata@linux.vnet.ibm.com From: Bharata B Rao Signed-off-by: Bharata B Rao [ use PowerPCCPUClass::interrupts_big_endian(), Greg Kurz ] Reviewed-by: Alexander Graf Signed-off-by: Greg Kurz --- No changes, resent in case it helps target-ppc/arch_dump.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/target-ppc/arch_dump.c b/target-ppc/arch_dump.c index 5487b61..53e2fe0 100644 --- a/target-ppc/arch_dump.c +++ b/target-ppc/arch_dump.c @@ -196,12 +196,16 @@ typedef struct NoteFuncDescStruct NoteFuncDesc; int cpu_get_dump_info(ArchDumpInfo *info, const struct GuestPhysBlockList *guest_phys_blocks) { - /* - * Currently only handling PPC64 big endian. - */ + PowerPCCPU *cpu = POWERPC_CPU(first_cpu); + PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); + info->d_machine = EM_PPC64; - info->d_endian = ELFDATA2MSB; info->d_class = ELFCLASS64; + if ((*pcc->interrupts_big_endian)(cpu)) { + info->d_endian = ELFDATA2MSB; + } else { + info->d_endian = ELFDATA2LSB; + } return 0; }