linux/arch/x86/include/asm/svm.h

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

#include <uapi/asm/svm.h>
#include <uapi/asm/kvm.h>

#include <asm/hyperv-tlfs.h>

/*
 * 32-bit intercept words in the VMCB Control Area, starting
 * at Byte offset 000h.
 */

enum intercept_words {};

enum {};


struct __attribute__ ((__packed__)) vmcb_control_area {};


#define TLB_CONTROL_DO_NOTHING
#define TLB_CONTROL_FLUSH_ALL_ASID
#define TLB_CONTROL_FLUSH_ASID
#define TLB_CONTROL_FLUSH_ASID_LOCAL

#define V_TPR_MASK

#define V_IRQ_SHIFT
#define V_IRQ_MASK

#define V_GIF_SHIFT
#define V_GIF_MASK

#define V_NMI_PENDING_SHIFT
#define V_NMI_PENDING_MASK

#define V_NMI_BLOCKING_SHIFT
#define V_NMI_BLOCKING_MASK

#define V_INTR_PRIO_SHIFT
#define V_INTR_PRIO_MASK

#define V_IGN_TPR_SHIFT
#define V_IGN_TPR_MASK

#define V_IRQ_INJECTION_BITS_MASK

#define V_INTR_MASKING_SHIFT
#define V_INTR_MASKING_MASK

#define V_GIF_ENABLE_SHIFT
#define V_GIF_ENABLE_MASK

#define V_NMI_ENABLE_SHIFT
#define V_NMI_ENABLE_MASK

#define AVIC_ENABLE_SHIFT
#define AVIC_ENABLE_MASK

#define X2APIC_MODE_SHIFT
#define X2APIC_MODE_MASK

#define LBR_CTL_ENABLE_MASK
#define VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK

#define SVM_INTERRUPT_SHADOW_MASK
#define SVM_GUEST_INTERRUPT_MASK

#define SVM_IOIO_STR_SHIFT
#define SVM_IOIO_REP_SHIFT
#define SVM_IOIO_SIZE_SHIFT
#define SVM_IOIO_ASIZE_SHIFT

#define SVM_IOIO_TYPE_MASK
#define SVM_IOIO_STR_MASK
#define SVM_IOIO_REP_MASK
#define SVM_IOIO_SIZE_MASK
#define SVM_IOIO_ASIZE_MASK

#define SVM_NESTED_CTL_NP_ENABLE
#define SVM_NESTED_CTL_SEV_ENABLE
#define SVM_NESTED_CTL_SEV_ES_ENABLE


#define SVM_TSC_RATIO_RSVD
#define SVM_TSC_RATIO_MIN
#define SVM_TSC_RATIO_MAX
#define SVM_TSC_RATIO_DEFAULT


/* AVIC */
#define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK
#define AVIC_LOGICAL_ID_ENTRY_VALID_BIT
#define AVIC_LOGICAL_ID_ENTRY_VALID_MASK

#define AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK
#define AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK
#define AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK
#define AVIC_PHYSICAL_ID_ENTRY_VALID_MASK
#define AVIC_PHYSICAL_ID_TABLE_SIZE_MASK

#define AVIC_DOORBELL_PHYSICAL_ID_MASK

#define VMCB_AVIC_APIC_BAR_MASK

#define AVIC_UNACCEL_ACCESS_WRITE_MASK
#define AVIC_UNACCEL_ACCESS_OFFSET_MASK
#define AVIC_UNACCEL_ACCESS_VECTOR_MASK

enum avic_ipi_failure_cause {};

#define AVIC_PHYSICAL_MAX_INDEX_MASK

/*
 * For AVIC, the max index allowed for physical APIC ID table is 0xfe (254), as
 * 0xff is a broadcast to all CPUs, i.e. can't be targeted individually.
 */
#define AVIC_MAX_PHYSICAL_ID

/*
 * For x2AVIC, the max index allowed for physical APIC ID table is 0x1ff (511).
 */
#define X2AVIC_MAX_PHYSICAL_ID

static_assert();
static_assert();

#define AVIC_HPA_MASK

#define SVM_SEV_FEAT_SNP_ACTIVE
#define SVM_SEV_FEAT_RESTRICTED_INJECTION
#define SVM_SEV_FEAT_ALTERNATE_INJECTION
#define SVM_SEV_FEAT_DEBUG_SWAP

#define SVM_SEV_FEAT_INT_INJ_MODES

struct vmcb_seg {} __packed;

/* Save area definition for legacy and SEV-MEM guests */
struct vmcb_save_area {} __packed;

/* Save area definition for SEV-ES and SEV-SNP guests */
struct sev_es_save_area {} __packed;

struct ghcb_save_area {} __packed;

#define GHCB_SHARED_BUF_SIZE

struct ghcb {} __packed;


#define EXPECTED_VMCB_SAVE_AREA_SIZE
#define EXPECTED_GHCB_SAVE_AREA_SIZE
#define EXPECTED_SEV_ES_SAVE_AREA_SIZE
#define EXPECTED_VMCB_CONTROL_AREA_SIZE
#define EXPECTED_GHCB_SIZE

#define BUILD_BUG_RESERVED_OFFSET(x, y)

static inline void __unused_size_checks(void)
{}

struct vmcb {} __packed;

#define SVM_CPUID_FUNC

#define SVM_SELECTOR_S_SHIFT
#define SVM_SELECTOR_DPL_SHIFT
#define SVM_SELECTOR_P_SHIFT
#define SVM_SELECTOR_AVL_SHIFT
#define SVM_SELECTOR_L_SHIFT
#define SVM_SELECTOR_DB_SHIFT
#define SVM_SELECTOR_G_SHIFT

#define SVM_SELECTOR_TYPE_MASK
#define SVM_SELECTOR_S_MASK
#define SVM_SELECTOR_DPL_MASK
#define SVM_SELECTOR_P_MASK
#define SVM_SELECTOR_AVL_MASK
#define SVM_SELECTOR_L_MASK
#define SVM_SELECTOR_DB_MASK
#define SVM_SELECTOR_G_MASK

#define SVM_SELECTOR_WRITE_MASK
#define SVM_SELECTOR_READ_MASK
#define SVM_SELECTOR_CODE_MASK

#define SVM_EVTINJ_VEC_MASK

#define SVM_EVTINJ_TYPE_SHIFT
#define SVM_EVTINJ_TYPE_MASK

#define SVM_EVTINJ_TYPE_INTR
#define SVM_EVTINJ_TYPE_NMI
#define SVM_EVTINJ_TYPE_EXEPT
#define SVM_EVTINJ_TYPE_SOFT

#define SVM_EVTINJ_VALID
#define SVM_EVTINJ_VALID_ERR

#define SVM_EXITINTINFO_VEC_MASK
#define SVM_EXITINTINFO_TYPE_MASK

#define SVM_EXITINTINFO_TYPE_INTR
#define SVM_EXITINTINFO_TYPE_NMI
#define SVM_EXITINTINFO_TYPE_EXEPT
#define SVM_EXITINTINFO_TYPE_SOFT

#define SVM_EXITINTINFO_VALID
#define SVM_EXITINTINFO_VALID_ERR

#define SVM_EXITINFOSHIFT_TS_REASON_IRET
#define SVM_EXITINFOSHIFT_TS_REASON_JMP
#define SVM_EXITINFOSHIFT_TS_HAS_ERROR_CODE

#define SVM_EXITINFO_REG_MASK

#define SVM_CR0_SELECTIVE_MASK

/* GHCB Accessor functions */

#define GHCB_BITMAP_IDX(field)

#define DEFINE_GHCB_ACCESSORS(field)

DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()
DEFINE_GHCB_ACCESSORS()

#endif