qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] How guest physical RAM works


From: Paolo Bonzini
Subject: Re: [Qemu-devel] How guest physical RAM works
Date: Fri, 8 Jan 2016 10:44:25 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0


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 via email to

[Prev in Thread] Current Thread [Next in Thread]