linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: vkuznets@redhat.com
Subject: [PATCH 2/4] x86/kvm/mmu.c: set get_pdptr hook in kvm_init_shadow_ept_mmu()
Date: Fri, 27 Jul 2018 18:56:39 +0200	[thread overview]
Message-ID: <1532710601-45449-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1532710601-45449-1-git-send-email-pbonzini@redhat.com>

From: Vitaly Kuznetsov <vkuznets@redhat.com>

kvm_init_shadow_ept_mmu() doesn't set get_pdptr() hook and is this
not a problem just because MMU context is already initialized and this
hook points to kvm_pdptr_read(). As we're intended to use a dedicated
MMU for shadow EPT MMU set this hook explicitly.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/mmu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 0a40afd71d74..b013aec73d46 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -4816,6 +4816,8 @@ void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, bool execonly,
 	context->root_level = PT64_ROOT_4LEVEL;
 	context->direct_map = false;
 	context->base_role.word = root_page_role.word & mmu_base_role_mask.word;
+	context->get_pdptr = kvm_pdptr_read;
+
 	update_permission_bitmask(vcpu, context, true);
 	update_pkru_bitmask(vcpu, context, true);
 	update_last_nonleaf_level(vcpu, context);
-- 
1.8.3.1



  parent reply	other threads:[~2018-07-27 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 16:56 [PATCH rebase/RFC 0/4] x86/kvm/nVMX: optimize MMU switch between L1 and L2 Paolo Bonzini
2018-07-27 16:56 ` [PATCH 1/4] x86/kvm/mmu: make vcpu->mmu a pointer to the current MMU Paolo Bonzini
2018-07-27 16:56 ` Paolo Bonzini [this message]
2018-07-27 16:56 ` [PATCH 3/4] x86/kvm/mmu.c: add kvm_mmu parameter to kvm_mmu_free_roots() Paolo Bonzini
2018-07-27 16:56 ` [PATCH 4/4] x86/kvm/mmu: introduce guest_mmu Paolo Bonzini
2018-07-31 15:58 ` [PATCH rebase/RFC 0/4] x86/kvm/nVMX: optimize MMU switch between L1 and L2 Vitaly Kuznetsov
2018-07-31 16:52   ` 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=1532710601-45449-3-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkuznets@redhat.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).