From: Paolo Bonzini <pbonzini@redhat.com>
To: Rohith Kugve Raghavendra <rkugver1@binghamton.edu>, kvm@vger.kernel.org
Subject: Re: Finding EPT entries for nested guest in L0
Date: Wed, 9 Nov 2016 00:34:25 +0100 [thread overview]
Message-ID: <940752a6-b92e-00a4-cc83-8d0c61bb8362@redhat.com> (raw)
In-Reply-To: <CAEqNykA_=RV50YO=MvM98MbzTHBCkVtcvGGEyZXe4ktQesX=ag@mail.gmail.com>
On 08/11/2016 21:27, Rohith Kugve Raghavendra wrote:
> I have 2 questions.
>
> 1. In nested VMs that use multi-dimensional page tables( EPT on EPT)
> where exactly in the code are EPT ( 0 -> 2) entries constructed? I can
> know from the Turtles paper that these entries are created by
> combining EPT 1->2 and EPT 0->1. But I can find that in KVM code.
It's in mmu.c, same as for shadow pages.
vcpu->arch.nested_mmu contains the MMU for L0->L2, while vcpu->arch.mmu
contains the MMU for L0->L1.
vcpu->arch.walk_mmu points to one of the two, depending on who was
running at the time of the last vmexit. In particular, prepare_vmcs02
(through nested_ept_init_mmu_context) sets vcpu->arch.walk_mmu to
&vcpu->arch.nested_mmu.
> 2. Are there rmap entries for EPT 0->2 pages maintained? I am trying
> to write protect nested guest GFN's directly in L0 ( without letting
> L1 do it) but I don't know how to find the EPT 0->2 entry for a given
> L2 guest GFN.
Yes, they are. There is only one rmap for both vcpu->arch.mmu and
vcpu->arch.nested_mmu, but for EPT02 pages of course vcpu->arch.mmu
should be direct mapped and not have any rmap.
Thanks,
Paolo
prev parent reply other threads:[~2016-11-08 23:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 20:27 Finding EPT entries for nested guest in L0 Rohith Kugve Raghavendra
2016-11-08 23:34 ` 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=940752a6-b92e-00a4-cc83-8d0c61bb8362@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=rkugver1@binghamton.edu \
/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.