qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
	Qiao Nuohan <qiaonuohan@cn.fujitsu.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 5/7] dump: select header bitness based on ELF class, not ELF architecture
Date: Tue, 20 May 2014 13:39:45 +0200	[thread overview]
Message-ID: <1400585987-6285-6-git-send-email-lersek@redhat.com> (raw)
In-Reply-To: <1400585987-6285-1-git-send-email-lersek@redhat.com>

The specific ELF architecture (d_machine) carries Too Much Information
(TM) for deciding between create_header32() and create_header64(), use
"d_class" instead (ELFCLASS32 vs. ELFCLASS64).

This change adapts write_dump_header() to write_elf_loads(), dump_begin()
etc. that also rely on the ELF class of the target for bitness selection.

Considering the current targets that support dumping, cpu_get_dump_info()
works as follows:
- target-s390x/arch_dump.c: (EM_S390, ELFCLASS64) only
- target-ppc/arch_dump.c (EM_PPC64, ELFCLASS64) only
- target-i386/arch_dump.c: sets (EM_X86_64, ELFCLASS64) vs. (EM_386,
  ELFCLASS32) keying off the same Long Mode Active flag.

Hence no observable change.

Approximately-suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dump.c b/dump.c
index e0a606f..7e0982b 100644
--- a/dump.c
+++ b/dump.c
@@ -998,11 +998,11 @@ out:
     return ret;
 }
 
 static int write_dump_header(DumpState *s)
 {
-    if (s->dump_info.d_machine == EM_386) {
+    if (s->dump_info.d_class == ELFCLASS32) {
         return create_header32(s);
     } else {
         return create_header64(s);
     }
 }
-- 
1.8.3.1

  parent reply	other threads:[~2014-05-20 11:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 11:39 [Qemu-devel] [PATCH 0/7] cleanups for compressed dumps (kdumps) Laszlo Ersek
2014-05-20 11:39 ` [Qemu-devel] [PATCH 3/7] dump: eliminate DumpState.page_shift ("guest's page shift") Laszlo Ersek
2014-05-20 11:39 ` [Qemu-devel] [PATCH 4/7] dump: eliminate DumpState.page_size ("guest's page size") Laszlo Ersek
2014-05-20 11:39 ` Laszlo Ersek [this message]
2014-05-20 11:42 ` [Qemu-devel] [PATCH 6/7] dump: hoist lzo_init() from get_len_buf_out() to dump_init() Laszlo Ersek
2014-05-20 11:42 ` [Qemu-devel] [PATCH 7/7] dump: simplify get_len_buf_out() Laszlo Ersek
2014-05-20 12:56 ` [Qemu-devel] [PATCH 0/7] cleanups for compressed dumps (kdumps) Paolo Bonzini
2014-05-20 13:03   ` Laszlo Ersek

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=1400585987-6285-6-git-send-email-lersek@redhat.com \
    --to=lersek@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qiaonuohan@cn.fujitsu.com \
    --cc=tumanova@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).