All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Arthur Chunqi Li <yzt356@gmail.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: EPT page fault procedure
Date: Thu, 31 Oct 2013 11:54:21 +0100	[thread overview]
Message-ID: <527236DD.5000804@redhat.com> (raw)
In-Reply-To: <CABpY8MKRSX+RLmqNAAp8pDG6vEGHOwa0AmdH5DHf7gAdeN4nRQ@mail.gmail.com>

Il 31/10/2013 10:07, Arthur Chunqi Li ha scritto:
> Sorry to disturb you with so many trivial questions in KVM EPT memory
> management and thanks for your patience.

No problem, please remain onlist though.  Adding back kvm@vger.kernel.org.


> I got confused in the EPT
> page fault processing function (tdp_page_fault). I think when Qemu
> registers the memory region for a VM, physical memory mapped to this
> PVA region isn't allocated indeed. So the page fault procedure of EPT
> violation which maps GFN to PFN should allocate the real physical
> memory and establish the real mapping from PVA to PFA in Qemu's page

Do you mean HVA to PFN?  If so, you can look at function hva_to_pfn. :)

> table. What is the point in tdp_page_fault() handling such mapping
> from PVA to PFA?

The EPT page table entry is created in __direct_map using the pfn
returned by try_async_pf.  try_async_pf itself gets the pfn from
gfn_to_pfn_async and gfn_to_pfn_prot.  Both of them call __gfn_to_pfn
with different arguments.  __gfn_to_pfn first goes from GFN to HVA using
the memslots (gfn_to_memslot and, in __gfn_to_pfn_memslot,
__gfn_to_hva_many), then it calls hva_to_pfn.

Ultimately, hva_to_pfn_fast and hva_to_pfn_slow is where KVM calls
functions from the kernel's get_user_page family.

Paolo

       reply	other threads:[~2013-10-31 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABpY8MKRSX+RLmqNAAp8pDG6vEGHOwa0AmdH5DHf7gAdeN4nRQ@mail.gmail.com>
2013-10-31 10:54 ` Paolo Bonzini [this message]
2013-11-04  1:05   ` EPT page fault procedure Arthur Chunqi Li
2013-11-04 12:20     ` Paolo Bonzini

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=527236DD.5000804@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=yzt356@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.