summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Levitsky <mlevitsk@redhat.com>2021-01-07 10:38:52 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-01-08 00:11:33 +0100
commit81f76adad560dfc39cb9625cf1e00a7e2b7b88df (patch)
tree8479d4a8aee319985603cee5c83175ed1119edbf
parentKVM: x86/mmu: Clarify TDP MMU page list invariants (diff)
downloadlinux-81f76adad560dfc39cb9625cf1e00a7e2b7b88df.tar.xz
linux-81f76adad560dfc39cb9625cf1e00a7e2b7b88df.zip
KVM: nSVM: correctly restore nested_run_pending on migration
The code to store it on the migration exists, but no code was restoring it. One of the side effects of fixing this is that L1->L2 injected events are no longer lost when migration happens with nested run pending. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20210107093854.882483-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/svm/nested.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index b0b667456b2e..a466336aab43 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -1194,6 +1194,10 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
* in the registers, the save area of the nested state instead
* contains saved L1 state.
*/
+
+ svm->nested.nested_run_pending =
+ !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
+
copy_vmcb_control_area(&hsave->control, &svm->vmcb->control);
hsave->save = *save;