All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: David Matlack <dmatlack@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm list <kvm@vger.kernel.org>, Jim Mattson <jmattson@google.com>
Subject: Re: [PATCH] KVM: nVMX: do not pin the VMCS12
Date: Wed, 2 Aug 2017 22:36:52 +0200	[thread overview]
Message-ID: <20170802203652.GD32403@flask> (raw)
In-Reply-To: <CALzav=eggFFXCKxQ67kT6SDx7w2ygwZnrWc-WFpbX7=SOkSduQ@mail.gmail.com>

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.

  parent reply	other threads:[~2017-08-02 20:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 13:54 [PATCH] KVM: nVMX: do not pin the VMCS12 Paolo Bonzini
2017-07-27 17:20 ` David Matlack
2017-07-28  1:28   ` Wanpeng Li
2017-07-28  6:57   ` Paolo Bonzini
2017-07-28  7:29     ` Christian Borntraeger
2017-08-02 20:36   ` Radim Krčmář [this message]
2017-07-27 17:54 ` David Hildenbrand

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=20170802203652.GD32403@flask \
    --to=rkrcmar@redhat.com \
    --cc=dmatlack@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@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 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.