OSDN Git Service

KVM: x86: move SMM exit to a new file
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 28 Oct 2022 10:01:26 +0000 (06:01 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Nov 2022 17:31:18 +0000 (12:31 -0500)
commitf1554150d3c694e30e92c681c20ce9714cac3d42
tree74b77ecaebc0b9e9228cc030cc709b01c6ba490b
parentc53da4f3af6e613e82f88abc6eb988e44c5dadd7
KVM: x86: move SMM exit to a new file

Some users of KVM implement the UEFI variable store through a paravirtual
device that does not require the "SMM lockbox" component of edk2, and
would like to compile out system management mode.  In preparation for
that, move the SMM exit code out of emulate.c and into a new file.

The code is still written as a series of invocations of the emulator
callbacks, but the two exiting_smm and leave_smm callbacks are merged
into one, and all the code from em_rsm is now part of the callback.
This removes all knowledge of the format of the SMM save state area
from the emulator.  Further patches will clean up the code and
invoke KVM's own functions to access control registers, descriptor
caches, etc.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220929172016.319443-4-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c
arch/x86/kvm/kvm_emulate.h
arch/x86/kvm/smm.c
arch/x86/kvm/smm.h
arch/x86/kvm/x86.c