]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: Move RESET emulation to svm_vcpu_reset()
authorSean Christopherson <seanjc@google.com>
Tue, 21 Sep 2021 00:03:02 +0000 (17:03 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Sep 2021 08:27:07 +0000 (04:27 -0400)
commited3d35844019bac2e3519ce740b4fb8c9c5f3b5e
tree12bdeff3863d366c032e2e59c22794e72161f664
parent01801e41fab92ce41efcb88e02bbc35649b6ab2f
KVM: SVM: Move RESET emulation to svm_vcpu_reset()

Move RESET emulation for SVM vCPUs to svm_vcpu_reset(), and drop an extra
init_vmcb() from svm_create_vcpu() in the process.  Hopefully KVM will
someday expose a dedicated RESET ioctl(), and in the meantime separating
"create" from "RESET" is a nice cleanup.

Keep the call to svm_switch_vmcb() so that misuse of svm->vmcb at worst
breaks the guest, e.g. premature accesses doesn't cause a NULL pointer
dereference.

Cc: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210921000303.400537-10-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h