From: Xiao Guangrong <xiaoguangrong.eric@gmail.com>
To: Steven <wangwangkang@gmail.com>, KVM <kvm@vger.kernel.org>
Subject: Re: Question about physical page allocation to the guest
Date: Thu, 23 Oct 2014 00:39:56 +0800 [thread overview]
Message-ID: <5447DDDC.5070106@gmail.com> (raw)
In-Reply-To: <CAMTrTqXXOKph4q1apVQ0GzZKceUVfwVJCTDxVQ6mMnMT3mvHvw@mail.gmail.com>
On 10/20/14 2:09 AM, Steven wrote:
> Hi, Eric,
> I am trying to understand how KVM allocates physical pages to the
> guest and your slides clarify a lot of questions.
> (https://events.linuxfoundation.org/slides/2011/linuxcon-japan/lcj2011_guangrong.pdf)
>
> However, I still have some difficulty in figuring out what happens in
> the kvm code.
>
> The host kernel is 3.2.14 and EPT is disabled.
>
> In the guest VM, I run a micro-benchmark program that touches 1024
> pages (as an integer array). So in the guest VM, I can trace 1024
> mm_page_alloc event. However, in the hypervisor I can only trace about
> 45 (sometimes < 45) kvm_page_fault events, which means that most page
> faults in the guest are not exposed to the hypervisor. My questions
> are
>
> (1) why such kind of page faults are not exposed to the hypervisor as
> EPT is disabled? (My doubt is that it is related to non-presetn PTE as
> you discussed in the slides. But could you give some more details?)
Two cases, the one is the page you accessed have already mapped into the
guest (the Present bit in the SPTE (shadow page table entry) is set).
Another is that we can do page prefetch in KVM that can fill
more nonpresent sptes in one vm-exit.
>
> (2) In such case, when the physical page are allocated to the VM to
> backup the virtual pages? Could you give some hint about which piece
> of KVM code calling the get get_user_pages()?
In the case if the hva of the gpa you are accessing is not mapped in
the hypervisor's address space. Please follow the code of try_async_pf
>
> Thanks in advance.
Enjoy it. :)
next prev parent reply other threads:[~2014-10-22 16:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-19 18:09 Question about physical page allocation to the guest Steven
2014-10-22 16:39 ` Xiao Guangrong [this message]
2014-10-27 23:36 ` Wanpeng Li
2014-12-02 3:51 ` Steven
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=5447DDDC.5070106@gmail.com \
--to=xiaoguangrong.eric@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=wangwangkang@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).