From: Paolo Bonzini <pbonzini@redhat.com>
To: "Estrada, Zachary J" <zestrad2@illinois.edu>, kvm@vger.kernel.org
Subject: Re: Trying to switch EPTP for execute-protecting guest pages
Date: Tue, 24 Nov 2015 12:44:12 +0100 [thread overview]
Message-ID: <56544D8C.10307@redhat.com> (raw)
In-Reply-To: <565348BA.4020905@illinois.edu>
On 23/11/2015 18:11, Estrada, Zachary J wrote:
> I'm playing around with EPTs and kvm to track execution in the guest.
> I've created a separate set of EPTs (and copied the last level entries
> from the real tables, minus execute permissions) but I'm not getting
> exits where I expect. I also have code in handle_ept_violation to
> preserve those permissions for any non-execute ept violations.
>
> Here is what I am calling within a VM Exit handler:
> ---
> kvm_mmu_unload(vcpu);
> vcpu->arch.mmu.root_hpa = eptp;
> kvm_x86_ops->set_tdp_cr3(vcpu, eptp);
> kvm_mmu_load(vcpu);
> kvm_flush_remote_tlbs(vcpu->kvm);
> ---
>
> I think some of this is overkill, but am I missing something? I think I
> may need to flush the rmaps too, but I'm not exactly sure how.
My suggestion is:
1) use tracing and check that kvm_mmu_get_page is being called correctly.
2) there is already code for write protection. Try copying that code
instead of doing a complete reimplementation.
Paolo
next prev parent reply other threads:[~2015-11-24 11:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 17:11 Trying to switch EPTP for execute-protecting guest pages Estrada, Zachary J
2015-11-24 11:44 ` Paolo Bonzini [this message]
2015-11-24 14:51 ` Estrada, Zachary J
2015-11-24 15:13 ` Paolo Bonzini
2015-11-24 15:52 ` Estrada, Zachary J
2015-11-24 16:00 ` 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=56544D8C.10307@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=zestrad2@illinois.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.