xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Yunbin Wang <wangyunbin1989@gmail.com>
Cc: Xen-devel List <xen-devel@lists.xen.org>
Subject: Re: Memory strategy in xen
Date: Tue, 3 Dec 2013 14:18:51 +0000	[thread overview]
Message-ID: <529DE84B.20407@citrix.com> (raw)
In-Reply-To: <CAEPeN01y7cD9kdFzBcmb+J7FJGL124x=xKNT0HAmimDFMkatSA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2629 bytes --]

On 03/12/13 13:48, Yunbin Wang wrote:
> Hi Andrew,
> Thanks for your reply.
>
> How does Xen map guest virtual address to machine physical address in
> PV mode?
>
> In PV mode, guests are aware of VMM, and know the actual physical
> memory address assigned to them, so do they map guest virtual address
> to guest physical address first, and then map physical address to
> machine physical, OR they map virtual address to machine physical
> directly?
>
> Thanks,
> Yunbin Wang

Please do not drop xen-devel from CC, and please do not top-post.

Xen does not keep track of guest virtual address - that is the guests
job to do.  Xen maintains the pagetables, but the PV guest has to ask
Xen to update a PTE, and what value to update it to.

PV guests are aware that their physical address space is not contiguous,
and have to take this into account for memory management purposes.

~Andrew

>
>
> 2013/11/18 Andrew Cooper <andrew.cooper3@citrix.com
> <mailto:andrew.cooper3@citrix.com>>
>
>     On 17/11/13 00:26, Yunbin Wang wrote:
>>     Hi all,
>>     I'm a newer to xen. But now I need to do research about live
>>     migration in xen. And now I'm confused with some questions:
>>     1. Is shadowing page used in both paravirtualization and hvm
>>     mode? Since from source code xc_domain_save.c, I see the
>>     following code to get dirty memory bitmap,
>>
>>     frc = xc_shadow_control(
>>                         xch, dom, XEN_DOMCTL_SHADOW_OP_PEEK,
>>     HYPERCALL_BUFFER(to_skip),
>>                         dinfo->p2m_size, NULL, 0, NULL);
>
>     From domctl.h
>
>     /* Log-dirty bitmap operations. */
>      /* Return the bitmap and clean internal copy for next round. */
>     #define XEN_DOMCTL_SHADOW_OP_CLEAN       11
>      /* Return the bitmap but do not modify internal copy. */
>     #define XEN_DOMCTL_SHADOW_OP_PEEK        12
>
>     Shadow and logdirty are related, but not the same.  Shadow is
>     certainly not expected to be used with PV guests (although a PV
>     guest specifying autotranslate will be run with shadowing enabled).
>
>     ~Andrew
>
>>
>>
>>     2. The strategy about memory allocation in xen, I know that dom0
>>     will get all available memory at first, and xen will allocate
>>     memory via balloon strategy to domU.
>>
>>     And now I need to know how balloon works?
>>
>>     Can anyone give me some ideas about questions above.
>>
>>     Thanks,
>>     Yunbin Wang
>>
>>
>>     _______________________________________________
>>     Xen-devel mailing list
>>     Xen-devel@lists.xen.org <mailto:Xen-devel@lists.xen.org>
>>     http://lists.xen.org/xen-devel
>
>


[-- Attachment #1.2: Type: text/html, Size: 6420 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

      parent reply	other threads:[~2013-12-03 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-17  0:26 Memory strategy in xen Yunbin Wang
2013-11-18 16:39 ` George Dunlap
     [not found] ` <5289F3A1.10000@citrix.com>
     [not found]   ` <CAEPeN01y7cD9kdFzBcmb+J7FJGL124x=xKNT0HAmimDFMkatSA@mail.gmail.com>
2013-12-03 14:18     ` Andrew Cooper [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=529DE84B.20407@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=wangyunbin1989@gmail.com \
    --cc=xen-devel@lists.xen.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).