From: Daniel Axtens <dja@axtens.net>
To: linuxppc-dev@lists.ozlabs.org
Cc: Daniel Axtens <dja@axtens.net>,
Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>,
Hari Bathini <hbathini@linux.vnet.ibm.com>
Subject: [PATCH v2 4/5] powerpc/fadump: Make ELF eflags depend on endian
Date: Tue, 6 Sep 2016 15:32:42 +1000 [thread overview]
Message-ID: <1473139963-7496-4-git-send-email-dja@axtens.net> (raw)
In-Reply-To: <1473139963-7496-1-git-send-email-dja@axtens.net>
Firmware Assisted Dump is a facility to dump kernel core with assistance
from firmware. As part of this process the kernel ELF version is
stored.
Currently, fadump.h defines this to 0 if it is not already defined. This
clashes with a define in elf.h which sets it based on the current task -
not based on the kernel.
When the kernel is compiled on LE, the kernel will always be version
2. Otherwise it will be version 0. So the correct behaviour is to set
the ELF eflags based on the endianness of the kernel. Do that.
Remove the definition in fadump.h, which becomes unused.
Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
---
Mahesh or Hari: I'm not familiar with this code at all, so if either of
you could check that this makes sense I would really appreciate that.
Thanks!
---
arch/powerpc/include/asm/fadump.h | 4 ----
arch/powerpc/kernel/fadump.c | 6 +++++-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/fadump.h b/arch/powerpc/include/asm/fadump.h
index b4407d0add27..0031806475f0 100644
--- a/arch/powerpc/include/asm/fadump.h
+++ b/arch/powerpc/include/asm/fadump.h
@@ -45,10 +45,6 @@
#define memblock_num_regions(memblock_type) (memblock.memblock_type.cnt)
-#ifndef ELF_CORE_EFLAGS
-#define ELF_CORE_EFLAGS 0
-#endif
-
/* Firmware provided dump sections */
#define FADUMP_CPU_STATE_DATA 0x0001
#define FADUMP_HPTE_REGION 0x0002
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 0638b82ce294..457f08e544c6 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -779,7 +779,11 @@ static int fadump_init_elfcore_header(char *bufp)
elf->e_entry = 0;
elf->e_phoff = sizeof(struct elfhdr);
elf->e_shoff = 0;
- elf->e_flags = ELF_CORE_EFLAGS;
+#ifdef __LITTLE_ENDIAN__
+ elf->e_flags = 2;
+#else
+ elf->e_flags = 0;
+#endif
elf->e_ehsize = sizeof(struct elfhdr);
elf->e_phentsize = sizeof(struct elf_phdr);
elf->e_phnum = 0;
--
2.7.4
next prev parent reply other threads:[~2016-09-06 5:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 5:32 [PATCH v2 1/5] powerpc/cell: drop unused iic_get_irq_host() Daniel Axtens
2016-09-06 5:32 ` [PATCH v2 2/5] powerpc/sparse: Make a bunch of things static Daniel Axtens
2016-09-13 12:16 ` [v2,2/5] " Michael Ellerman
2016-09-14 0:11 ` [PATCH v2 2/5] " Michael Ellerman
2016-09-06 5:32 ` [PATCH v2 3/5] powerpc/kvm: sparse: prototypes for functions called from assembler Daniel Axtens
2016-09-06 5:32 ` Daniel Axtens [this message]
2016-09-08 7:00 ` [PATCH v2 4/5] powerpc/fadump: Make ELF eflags depend on endian Mahesh Jagannath Salgaonkar
2016-09-08 8:21 ` Mahesh Jagannath Salgaonkar
2016-09-09 10:58 ` Michael Ellerman
2016-09-08 9:17 ` Michael Ellerman
2016-09-08 9:35 ` Michael Ellerman
2016-09-13 12:16 ` [v2,4/5] " Michael Ellerman
2016-09-06 5:32 ` [PATCH v2 5/5] powerpc/sparse: Add more assembler prototypes Daniel Axtens
2016-09-13 12:16 ` [v2,5/5] " Michael Ellerman
2016-09-06 6:01 ` [PATCH v2 1/5] powerpc/cell: drop unused iic_get_irq_host() Andrew Donnellan
2016-09-08 7:44 ` Arnd Bergmann
2016-09-09 0:43 ` Daniel Axtens
2016-09-09 1:14 ` Andrew Donnellan
2016-09-09 7:42 ` Arnd Bergmann
2016-09-13 12:16 ` [v2,1/5] " Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1473139963-7496-4-git-send-email-dja@axtens.net \
--to=dja@axtens.net \
--cc=hbathini@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).