From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Junaid Shahid <junaids@google.com>
Subject: [PATCH v2 0/3] KVM: MMU: fix nested guest live migration with PML
Date: Fri, 27 Sep 2019 13:15:40 +0200 [thread overview]
Message-ID: <1569582943-13476-1-git-send-email-pbonzini@redhat.com> (raw)
Shadow paging is fundamentally incompatible with the page-modification
log, because the GPAs in the log come from the wrong memory map.
In particular, for the EPT page-modification log, the GPAs in the log come
from L2 rather than L1. (If there was a non-EPT page-modification log,
we couldn't use it for shadow paging because it would log GVAs rather
than GPAs).
Therefore, we need to rely on write protection to record dirty pages.
This has the side effect of bypassing PML, since writes now result in an
EPT violation vmexit.
This turns out to be a surprisingly small patch---the testcase is what's
guilty of the scary diffstat. But that is because the KVM MMU code is
absurdly clever, so a very close review is appreciated.
Paolo
v1->v2: don't place the new code in spte_clear_dirty [Junaid]
Paolo Bonzini (3):
KVM: x86: assign two bits to track SPTE kinds
KVM: x86: fix nested guest live migration with PML
selftests: kvm: add test for dirty logging inside nested guests
arch/x86/include/asm/kvm_host.h | 7 -
arch/x86/kvm/mmu.c | 65 +++++--
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/include/x86_64/processor.h | 3 +
tools/testing/selftests/kvm/include/x86_64/vmx.h | 14 ++
tools/testing/selftests/kvm/lib/kvm_util.c | 2 +-
.../testing/selftests/kvm/lib/kvm_util_internal.h | 3 +
tools/testing/selftests/kvm/lib/x86_64/vmx.c | 201 ++++++++++++++++++++-
.../selftests/kvm/x86_64/vmx_dirty_log_test.c | 156 ++++++++++++++++
9 files changed, 426 insertions(+), 26 deletions(-)
create mode 100644 tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
--
1.8.3.1
next reply other threads:[~2019-09-27 11:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 11:15 Paolo Bonzini [this message]
2019-09-27 11:15 ` [PATCH v2 1/3] KVM: x86: assign two bits to track SPTE kinds Paolo Bonzini
2019-12-11 18:39 ` Ben Gardon
2019-12-11 19:13 ` Sean Christopherson
2019-12-11 23:28 ` Paolo Bonzini
2019-12-12 0:29 ` Sean Christopherson
2019-12-12 0:33 ` Paolo Bonzini
2019-09-27 11:15 ` [PATCH v2 2/3] KVM: x86: fix nested guest live migration with PML Paolo Bonzini
2019-09-27 20:24 ` Junaid Shahid
2019-09-27 11:15 ` [PATCH v2 3/3] selftests: kvm: add test for dirty logging inside nested guests 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=1569582943-13476-1-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=junaids@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sean.j.christopherson@intel.com \
--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
all inboxes | Powered by JetHome®