All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Hu Yaohui <loki2441@gmail.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: Nested EPT Write Protection
Date: Fri, 19 Jun 2015 17:23:27 +0200	[thread overview]
Message-ID: <558433EF.4040508@redhat.com> (raw)
In-Reply-To: <CAHqbYQtLSUr+TTxn-QJVpXt257ZowMVH+1B+DSR1X2KEgmFawg@mail.gmail.com>



On 19/06/2015 14:44, Hu Yaohui wrote:
> Hi Paolo,
> Thanks a lot!
> 
> On Fri, Jun 19, 2015 at 2:27 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 19/06/2015 03:52, Hu Yaohui wrote:
>>> Hi All,
>>> In kernel 3.14.2, the kvm uses shadow EPT(EPT02) to implement the
>>> nested EPT. The shadow EPT(EPT02) is a shadow of guest EPT (EPT12). If
>>> the L1 guest writes to the guest EPT(EPT12). How can the shadow
>>> EPT(EPT02) be modified according?
>>
>> Because the EPT02 is write protected, writes to the EPT12 will trap to
>> the hypervisor.  The hypervisor will execute the write instruction
>> before reentering the guest and invalidate the modified parts of the
>> EPT02.  When the invalidated part of the EPT02 is accessed, the
>> hypervisor will rebuild it according to the EPT12 and the KVM memslots.
>>
> Do you mean EPT12 is write protected instead of EPT02?

Yes, sorry.

> According to my understanding, EPT12 will be write protected by marking the
> page table entry of EPT01 as readonly or marking the host page table
> entry as readonly.
> Could you please be more specific the code path which makes the
> corresponding page table entry as write protected?

Look at set_spte's call to mmu_need_write_protect.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in

  reply	other threads:[~2015-06-19 15:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19  1:52 Nested EPT Write Protection Hu Yaohui
2015-06-19  6:27 ` Paolo Bonzini
2015-06-19 12:44   ` Hu Yaohui
2015-06-19 15:23     ` Paolo Bonzini [this message]
2015-06-19 18:57       ` Hu Yaohui
2015-06-22 11:26         ` Paolo Bonzini
     [not found]           ` <CAHqbYQsXfmQfBGva2t_VSFMQj3dnwUUcFPBbvnQDN_tR0y3i8g@mail.gmail.com>
2015-06-22 13:59             ` 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=558433EF.4040508@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=loki2441@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.