All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCHv2 6/6] dump: fix memory region handling
Date: Sun, 24 Mar 2013 20:35:51 +0100	[thread overview]
Message-ID: <CAH+eYFBCVKeWmXJcmJhx6eM69mnWnUOByZcdL2yqhBgYc=u=7w@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_=RhjS6LnqAaB40K3fa8+j5UHpk_gm836OmNgYpzqrMw@mail.gmail.com>

2013/3/24 Peter Maydell <peter.maydell@linaro.org>:
> On 24 March 2013 17:27, Rabin Vincent <rabin@rab.in> wrote:
>>  /**
>> + * memory_region_get_addr: Get the address of a memory region
>> + *
>> + * @mr: the memory region
>> + */
>> +hwaddr memory_region_get_addr(MemoryRegion *mr);
>
> I'm afraid this doesn't make sense. A MemoryRegion by itself has
> no "address" -- it could be mapped into several places in several
> different address maps or none at all.

OK.  Do you mean that such a function can be used internally to the dump
code where it gets the MemoryRegion only from the RAMBlock.mr or do you
mean the dump code also shouldn't be doing it that way?

If you mean the latter, could you please suggest an alternative way to
handle this?  The problem is that the dump code assumes that
RAMBlock.offset provides the physical address, and this appears to not
be the case.  For example, with a dump generated from vexpress I get
these Program Headers in the dump:

  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  NOTE           0x0000f4 0x00000000 0x00000000 0x002a0 0x002a0     0
  LOAD           0x000394 0x00000000 0x00000000 0x8000000 0x8000000     0
  LOAD           0x8000394 0x00000000 0x08000000 0x4000000 0x4000000     0
  LOAD           0xc000394 0x00000000 0x0c000000 0x4000000 0x4000000     0
  LOAD           0x10000394 0x00000000 0x10000000 0x2000000 0x2000000     0
  LOAD           0x12000394 0x00000000 0x12000000 0x800000 0x800000     0

The physical addresses are completely wrong, and with the patch I get
the right ones:

  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  NOTE           0x0000f4 0x00000000 0x00000000 0x002a0 0x002a0     0
  LOAD           0x8000394 0x00000000 0x40000000 0x4000000 0x4000000     0
  LOAD           0xc000394 0x00000000 0x44000000 0x4000000 0x4000000     0
  LOAD           0x10000394 0x00000000 0x48000000 0x2000000 0x2000000     0
  LOAD           0x12000394 0x00000000 0x4c000000 0x800000 0x800000     0
  LOAD           0x000394 0x00000000 0x60000000 0x8000000 0x8000000     0

Thanks.

  reply	other threads:[~2013-03-24 19:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-24 17:27 [Qemu-devel] [PATCHv2 0/6] ARM dump-guest-memory support Rabin Vincent
2013-03-24 17:27 ` [Qemu-devel] [PATCHv2 1/6] dump: create writable files Rabin Vincent
2013-04-04  9:42   ` Paolo Bonzini
2013-03-24 17:27 ` [Qemu-devel] [PATCHv2 2/6] dump: extract out note helper Rabin Vincent
2013-03-24 17:27 ` [Qemu-devel] [PATCHv2 3/6] dump: extract out get note size function Rabin Vincent
2013-03-24 17:27 ` [Qemu-devel] [PATCHv2 4/6] dump: fix up memory mapping dependencies / stub Rabin Vincent
2013-04-04  9:43   ` Paolo Bonzini
2013-03-24 17:27 ` [Qemu-devel] [PATCHv2 5/6] target-arm: add dump-guest-memory support Rabin Vincent
2013-03-24 18:34   ` Peter Maydell
2013-03-24 19:26     ` Rabin Vincent
2013-03-24 20:39       ` Peter Maydell
2013-04-04  9:47         ` Paolo Bonzini
2013-04-04  9:49           ` Peter Maydell
2013-03-24 17:27 ` [Qemu-devel] [PATCHv2 6/6] dump: fix memory region handling Rabin Vincent
2013-03-24 18:36   ` Peter Maydell
2013-03-24 19:35     ` Rabin Vincent [this message]
2013-03-24 20:18       ` Peter Maydell
2013-03-25 11:49 ` [Qemu-devel] [PATCHv2 0/6] ARM dump-guest-memory support Andreas Färber
2013-03-29  8:36   ` Rabin Vincent
2013-04-04  8:52     ` Andreas Färber
2013-04-09 12:09       ` [Qemu-devel] [RFC] make write_elf_xx functions part of CPUClass, use CPUState Jens Freimann
2013-04-09 13:15         ` Andreas Färber
2013-04-19 14:45           ` [Qemu-devel] [PATCH 0/2] qom: make cpu_write_elfXX_ functions part of CPUClass Jens Freimann
2013-04-19 14:45             ` [Qemu-devel] [PATCH 1/2] qom: Convert cpu_write_elfXX_note functions to CPUState Jens Freimann
2013-04-19 14:45             ` [Qemu-devel] [PATCH 2/2] i386: use CPUClass->write_elf* functions Jens Freimann
2013-04-29 14:21             ` [Qemu-devel] [PATCH 0/2] qom: make cpu_write_elfXX_ functions part of CPUClass Andreas Färber

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='CAH+eYFBCVKeWmXJcmJhx6eM69mnWnUOByZcdL2yqhBgYc=u=7w@mail.gmail.com' \
    --to=rabin@rab.in \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.