linux/arch/x86/kvm/smm.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ASM_KVM_SMM_H
#define ASM_KVM_SMM_H

#include <linux/build_bug.h>

#ifdef CONFIG_KVM_SMM


/*
 * 32 bit KVM's emulated SMM layout. Based on Intel P6 layout
 * (https://www.sandpile.org/x86/smm.htm).
 */

struct kvm_smm_seg_state_32 {} __packed;

struct kvm_smram_state_32 {} __packed;


/* 64 bit KVM's emulated SMM layout. Based on AMD64 layout */

struct kvm_smm_seg_state_64 {};

struct kvm_smram_state_64 {};

kvm_smram;

static inline int kvm_inject_smi(struct kvm_vcpu *vcpu)
{}

static inline bool is_smm(struct kvm_vcpu *vcpu)
{}

void kvm_smm_changed(struct kvm_vcpu *vcpu, bool in_smm);
void enter_smm(struct kvm_vcpu *vcpu);
int emulator_leave_smm(struct x86_emulate_ctxt *ctxt);
void process_smi(struct kvm_vcpu *vcpu);
#else
static inline int kvm_inject_smi(struct kvm_vcpu *vcpu) { return -ENOTTY; }
static inline bool is_smm(struct kvm_vcpu *vcpu) { return false; }

/*
 * emulator_leave_smm is used as a function pointer, so the
 * stub is defined in x86.c.
 */
#endif

#endif