qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel <qemu-devel@nongnu.org>
Cc: Igor Mammedov <imammedo@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] How guest physical RAM works
Date: Fri, 8 Jan 2016 10:44:25 +0100	[thread overview]
Message-ID: <568F84F9.1050109@redhat.com> (raw)
In-Reply-To: <CAJSP0QUyef1DAmz62XZEokuAdfhRyUcdg9SVfgL1zgh62Zoo3w@mail.gmail.com>



On 08/01/2016 10:29, Stefan Hajnoczi wrote:
> As a side-note, the initial RAM that the guest started with might not
> be modelled with a "pc-dimm" device and it can't be unplugged.
> 
> The guest RAM itself isn't contained inside the "pc-dimm" object.
> Instead the "pc-dimm" must be associated with a "memory-backend"
> object.

Perhaps it's worth mentioning that the initial RAM can also be
associated with one or more memory-backend objects, typically one per
virtual NUMA node.  The memory-backend is passed to QEMU via "-numa
node,...,memdev=ID".

> The MemoryRegion is the link between guest physical address space and
> the RAMBlocks containing the memory. Each MemoryRegion has the
> ram_addr_t offset of the RAMBlock and each RAMBlock has a MemoryRegion
> pointer.

As a side note (probably beyond the scope of your post) there is no
reason for the MemoryRegion to use the ram_addr_t instead of the
RAMBlock.  It would actually be faster if the MemoryRegion contained the
RAMBlock, since it's slow to look up the mmap address corresponding to
the ram_addr_t.  There is a 1-element MRU cache, but it's still slowish.

Paolo

      reply	other threads:[~2016-01-08  9:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08  9:29 [Qemu-devel] How guest physical RAM works Stefan Hajnoczi
2016-01-08  9:44 ` Paolo Bonzini [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=568F84F9.1050109@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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).