KVM: nSVM: refactor the CR3 reload on migration
authorMaxim Levitsky <mlevitsk@redhat.com>
Mon, 7 Jun 2021 09:01:59 +0000 (12:01 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Jun 2021 17:09:47 +0000 (13:09 -0400)
commitb222b0b88162bdef4eceb12a79d5edbbdb23dbfd
treeab666166b5cba47cc2b8294d33bbfa5e1d5a2025
parentc7313155bf11906ad75ae0edc4a97bf93d69c275
KVM: nSVM: refactor the CR3 reload on migration

Document the actual reason why we need to do it
on migration and move the call to svm_set_nested_state
to be closer to VMX code.

To avoid loading the PDPTRs from possibly not up to date memory map,
in nested_svm_load_cr3 after the move, move this code to
.get_nested_state_pages.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210607090203.133058-5-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c