qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Jun Koi <junkoi2004@gmail.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Greg Kurz <gkurz@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] dump-guest-memory command?
Date: Fri, 16 May 2014 17:38:03 +0200	[thread overview]
Message-ID: <537630DB.2070500@redhat.com> (raw)
In-Reply-To: <CA+g7VZ09MA5TNLW9ue3YQ+tn8+Wk+Mo2E34RmqQbLrSiwTEv1w@mail.gmail.com>

On 05/16/14 15:01, Jun Koi wrote:
> 
> 
> 
> On Fri, May 16, 2014 at 7:30 PM, Laszlo Ersek <lersek@redhat.com
> <mailto:lersek@redhat.com>> wrote:
> 
>     On 05/16/14 11:59, Jun Koi wrote:
> 
>     > - is it true that dump-guest-memory just write down physical memory
>     > page, and does not consider the virtual-memory concept?
> 
>     No, it isn't.
> 
>     Basically, "dump-guest-memory" supports two modes of operation, "paging
>     enabled" and "paging disabled".
> 
>     Many (most?) people dump for the "crash" utility, which is super smart,
>     and extra paging info is not needed. For "crash" we just dump the
>     guest-phys memory ranges the way the guest sees them, and that's it;
>     "crash" figures out everything from that.
> 
>     If you want to use "gdb" rather than "crash", or need the guest-virtual
>     addresses in the ELF vmcore for some other reason, then you should
>     invoke "dump-guest-memory" with paging enabled.
> 
>     Enter "help dump-guest-memory" at the qemu monitor prompt, and look for
>     the "-p" option.
> 
> 
> so i suppose this works for all kind of OS in guest VM, not only Linux
> guest?

far as I remember, it should; the virtual mappings "in effect" are
searched starting from cr3:

qmp_dump_guest_memory() [dump.c]
  dump_init()
    qemu_get_guest_memory_mapping() [memory_mapping.c]
      for (almost) all VCPUs:
        cpu_get_memory_mapping() [qom/cpu.c]
          x86_cpu_get_memory_mapping()
                                     [target-i386/arch_memory_mapping.c]
            check cr3, cr4; walk page tables etc

There are some caveats / limitations: search "qapi-schema.json" for the
string "dump-guest-memory", and read that section.

Laszlo

      reply	other threads:[~2014-05-16 15:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16  6:24 [Qemu-devel] dump-guest-memory command? Jun Koi
2014-05-16  7:03 ` Greg Kurz
2014-05-16  8:40   ` Jun Koi
2014-05-16  8:45     ` Andreas Färber
2014-05-16  8:51       ` Jun Koi
2014-05-16 10:00         ` Greg Kurz
2014-05-16  9:51     ` Greg Kurz
2014-05-16  9:59       ` Jun Koi
2014-05-16 10:15         ` Greg Kurz
2014-05-16 11:30         ` Laszlo Ersek
2014-05-16 13:01           ` Jun Koi
2014-05-16 15:38             ` Laszlo Ersek [this message]

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=537630DB.2070500@redhat.com \
    --to=lersek@redhat.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=junkoi2004@gmail.com \
    --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 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).