lkml.org 
[lkml]   [2017]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: nVMX: do not pin the VMCS12
2017-07-27 10:20-0700, David Matlack:
> On Thu, Jul 27, 2017 at 6:54 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > Since the current implementation of VMCS12 does a memcpy in and out
> > of guest memory, we do not need current_vmcs12 and current_vmcs12_page
> > anymore. current_vmptr is enough to read and write the VMCS12.
>
> This patch also fixes dirty tracking (memslot->dirty_bitmap) of the
> VMCS12 page by using kvm_write_guest. nested_release_page() only marks
> the struct page dirty.
>
> >
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> > @@ -7623,14 +7614,13 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu)
> > }
> >
> > nested_release_vmcs12(vmx);
> > - vmx->nested.current_vmcs12 = new_vmcs12;
> > - vmx->nested.current_vmcs12_page = page;
> > /*
> > * Load VMCS12 from guest memory since it is not already
> > * cached.
> > */
> > - memcpy(vmx->nested.cached_vmcs12,
> > - vmx->nested.current_vmcs12, VMCS12_SIZE);
> > + memcpy(vmx->nested.cached_vmcs12, new_vmcs12, VMCS12_SIZE);
> > + kunmap(page);
>
> + nested_release_page_clean(page);

Added this and your note about the dirty bit when applying,

thanks.

\
 
 \ /
  Last update: 2017-08-02 22:37    [W:1.329 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site