diff options
author | Maxim Levitsky <mlevitsk@redhat.com> | 2021-06-07 11:02:03 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-06-17 19:09:48 +0200 |
commit | 158a48ecf776d0ebc916befcb0dc0862f136a31f (patch) | |
tree | 806d4fdaf6eeca8e6c6a55fb5e8d4627e96d15ad /arch/x86/kvm/svm | |
parent | KVM: x86: Introduce KVM_GET_SREGS2 / KVM_SET_SREGS2 (diff) | |
download | linux-158a48ecf776d0ebc916befcb0dc0862f136a31f.tar.xz linux-158a48ecf776d0ebc916befcb0dc0862f136a31f.zip |
KVM: x86: avoid loading PDPTRs after migration when possible
if new KVM_*_SREGS2 ioctls are used, the PDPTRs are
a part of the migration state and are correctly
restored by those ioctls.
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210607090203.133058-9-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm')
-rw-r--r-- | arch/x86/kvm/svm/nested.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index e917eba659b3..c902ace2bd17 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1367,7 +1367,8 @@ static bool svm_get_nested_state_pages(struct kvm_vcpu *vcpu) if (WARN_ON(!is_guest_mode(vcpu))) return true; - if (!nested_npt_enabled(svm) && is_pae_paging(vcpu)) + if (!vcpu->arch.pdptrs_from_userspace && + !nested_npt_enabled(svm) && is_pae_paging(vcpu)) /* * Reload the guest's PDPTRs since after a migration * the guest CR3 might be restored prior to setting the nested |