Skip to contentSkip to conversation

Dump patches

GIT PULL Applied Marc-André Lureau 3 participants 4 messages Feb 6, 2019 – Feb 7, 2019

lore
Share & tools
lore
#0 lore raw

The following changes since commit 47994e16b1d66411953623e7c0bf0cdcd50bd507:

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190205' into staging (2019-02-05 18:25:07 +0000)

are available in the Git repository at:

https://github.com/elmarco/qemu.git tags/dump-pull-request

for you to fetch changes up to e17bebd049d78f489c2cff755e2b66a0536a156e:

dump: Set correct vaddr for ELF dump (2019-02-06 15:51:12 +0100)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Jon Doron (1):
dump: Set correct vaddr for ELF dump

 scripts/dump-guest-memory.py | 1 +
 dump.c                       | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1.98.gecbdaf0899
#1 lore raw

[Qemu-devel] [PULL 1/1] dump: Set correct vaddr for ELF dump

From: Jon Doron <[email protected]>

vaddr needs to be equal to the paddr since the dump file represents the physical memory image.

Without setting vaddr correctly, GDB would load all the different memory regions on top of each other to vaddr 0, thus making GDB showing the wrong memory data for a given address.

Message-Id: <[email protected]>

---
 scripts/dump-guest-memory.py | 1 +
 dump.c                       | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
scripts/dump-guest-memory.py +1 -0
index 198cd0fe40..2c587cbefc 100644
@@ -163,6 +163,7 @@ class ELF(object):
         phdr = get_arch_phdr(self.endianness, self.elfclass)
         phdr.p_type = p_type
         phdr.p_paddr = p_paddr
+        phdr.p_vaddr = p_paddr
         phdr.p_filesz = p_size
         phdr.p_memsz = p_size
         self.segments.append(phdr)
dump.c +3 -2
index ef1d8025c9..107a67165a 100644
@@ -192,7 +192,7 @@ static void write_elf64_load(DumpState *s, MemoryMapping *memory_mapping,
     phdr.p_paddr = cpu_to_dump64(s, memory_mapping->phys_addr);
     phdr.p_filesz = cpu_to_dump64(s, filesz);
     phdr.p_memsz = cpu_to_dump64(s, memory_mapping->length);
-    phdr.p_vaddr = cpu_to_dump64(s, memory_mapping->virt_addr);
+    phdr.p_vaddr = cpu_to_dump64(s, memory_mapping->virt_addr) ?: phdr.p_paddr;
 
     assert(memory_mapping->length >= filesz);
 
@@ -216,7 +216,8 @@ static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
     phdr.p_paddr = cpu_to_dump32(s, memory_mapping->phys_addr);
     phdr.p_filesz = cpu_to_dump32(s, filesz);
     phdr.p_memsz = cpu_to_dump32(s, memory_mapping->length);
-    phdr.p_vaddr = cpu_to_dump32(s, memory_mapping->virt_addr);
+    phdr.p_vaddr =
+        cpu_to_dump32(s, memory_mapping->virt_addr) ?: phdr.p_paddr;
 
     assert(memory_mapping->length >= filesz);
 
Signature · 1 line
2.20.1.98.gecbdaf0899
#2 lore raw
In reply to Marc-André Lureau
Quoted 7 lines · Marc-André Lureau

The following changes since commit 47994e16b1d66411953623e7c0bf0cdcd50bd507:

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190205' into staging (2019-02-05 18:25:07 +0000)

are available in the Git repository at:

Quoted 9 lines

https://github.com/elmarco/qemu.git tags/dump-pull-request

for you to fetch changes up to e17bebd049d78f489c2cff755e2b66a0536a156e:

dump: Set correct vaddr for ELF dump (2019-02-06 15:51:12 +0100)

----------------------------------------------------------------
Pull request

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.

-- PMM

#3 lore raw
In reply to Marc-André Lureau
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-mingw@fedora SHOW_ENV=1 J=14 === TEST SCRIPT END ===

The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]