From: Maxim Levitsky Date: Thu, 7 Jan 2021 09:38:52 +0000 (+0200) Subject: KVM: nSVM: correctly restore nested_run_pending on migration X-Git-Tag: v5.15~2020^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81f76adad560dfc39cb9625cf1e00a7e2b7b88df;p=platform%2Fkernel%2Flinux-starfive.git 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 Message-Id: <20210107093854.882483-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index b0b6674..a466336a 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;