aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorLadi Prosek <lprosek@redhat.com>2017-10-11 10:54:40 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2017-10-12 08:01:55 -0400
commit0234bf885236a41ef05376039f2a8ebe7028a388 (patch)
treece9efe96403c64ef235b626357111d1151f94834 /arch/x86/kvm/svm.c
parentd0006530576f1c7a49b2010eac7afdcb5a3613ae (diff)
KVM: x86: introduce ISA specific SMM entry/exit callbacks
Entering and exiting SMM may require ISA specific handling under certain circumstances. This commit adds two new callbacks with empty implementations. Actual functionality will be added in following commits. * pre_enter_smm() is to be called when injecting an SMM, before any SMM related vcpu state has been changed * pre_leave_smm() is to be called when emulating the RSM instruction, when the vcpu is in real mode and before any SMM related vcpu state has been restored Signed-off-by: Ladi Prosek <lprosek@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 84f18634d87c..c4e9b99d48d8 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -5401,6 +5401,18 @@ static void svm_setup_mce(struct kvm_vcpu *vcpu)
5401 vcpu->arch.mcg_cap &= 0x1ff; 5401 vcpu->arch.mcg_cap &= 0x1ff;
5402} 5402}
5403 5403
5404static int svm_pre_enter_smm(struct kvm_vcpu *vcpu, char *smstate)
5405{
5406 /* TODO: Implement */
5407 return 0;
5408}
5409
5410static int svm_pre_leave_smm(struct kvm_vcpu *vcpu, u64 smbase)
5411{
5412 /* TODO: Implement */
5413 return 0;
5414}
5415
5404static struct kvm_x86_ops svm_x86_ops __ro_after_init = { 5416static struct kvm_x86_ops svm_x86_ops __ro_after_init = {
5405 .cpu_has_kvm_support = has_svm, 5417 .cpu_has_kvm_support = has_svm,
5406 .disabled_by_bios = is_disabled, 5418 .disabled_by_bios = is_disabled,
@@ -5511,6 +5523,9 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = {
5511 .deliver_posted_interrupt = svm_deliver_avic_intr, 5523 .deliver_posted_interrupt = svm_deliver_avic_intr,
5512 .update_pi_irte = svm_update_pi_irte, 5524 .update_pi_irte = svm_update_pi_irte,
5513 .setup_mce = svm_setup_mce, 5525 .setup_mce = svm_setup_mce,
5526
5527 .pre_enter_smm = svm_pre_enter_smm,
5528 .pre_leave_smm = svm_pre_leave_smm,
5514}; 5529};
5515 5530
5516static int __init svm_init(void) 5531static int __init svm_init(void)