#include <asm/setup_data.h>
#ifndef __BOOT_COMPRESSED
#define error(v) …
#define has_cpuflag(f) …
#define sev_printk(fmt, ...) …
#define sev_printk_rtl(fmt, ...) …
#else
#undef WARN
#define WARN …
#define sev_printk …
#define sev_printk_rtl …
#undef vc_forward_exception
#define vc_forward_exception …
#endif
u8 snp_vmpl __ro_after_init;
EXPORT_SYMBOL_GPL(…);
static struct svsm_ca *boot_svsm_caa __ro_after_init;
static u64 boot_svsm_caa_pa __ro_after_init;
static struct svsm_ca *svsm_get_caa(void);
static u64 svsm_get_caa_pa(void);
static int svsm_perform_call_protocol(struct svsm_call *call);
struct cpuid_leaf { … };
struct snp_cpuid_fn { … } __packed;
#define SNP_CPUID_COUNT_MAX …
struct snp_cpuid_table { … } __packed;
static u16 ghcb_version __ro_after_init;
static struct snp_cpuid_table cpuid_table_copy __ro_after_init;
static u32 cpuid_std_range_max __ro_after_init;
static u32 cpuid_hyp_range_max __ro_after_init;
static u32 cpuid_ext_range_max __ro_after_init;
static bool __init sev_es_check_cpu_features(void)
{ … }
static void __head __noreturn
sev_es_terminate(unsigned int set, unsigned int reason)
{ … }
static u64 get_hv_features(void)
{ … }
static void snp_register_ghcb_early(unsigned long paddr)
{ … }
static bool sev_es_negotiate_protocol(void)
{ … }
static __always_inline void vc_ghcb_invalidate(struct ghcb *ghcb)
{ … }
static bool vc_decoding_needed(unsigned long exit_code)
{ … }
static enum es_result vc_init_em_ctxt(struct es_em_ctxt *ctxt,
struct pt_regs *regs,
unsigned long exit_code)
{ … }
static void vc_finish_insn(struct es_em_ctxt *ctxt)
{ … }
static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
{ … }
static inline int svsm_process_result_codes(struct svsm_call *call)
{ … }
static __always_inline void svsm_issue_call(struct svsm_call *call, u8 *pending)
{ … }
static int svsm_perform_msr_protocol(struct svsm_call *call)
{ … }
static int svsm_perform_ghcb_protocol(struct ghcb *ghcb, struct svsm_call *call)
{ … }
static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
struct es_em_ctxt *ctxt,
u64 exit_code, u64 exit_info_1,
u64 exit_info_2)
{ … }
static int __sev_cpuid_hv(u32 fn, int reg_idx, u32 *reg)
{ … }
static int __sev_cpuid_hv_msr(struct cpuid_leaf *leaf)
{ … }
static int __sev_cpuid_hv_ghcb(struct ghcb *ghcb, struct es_em_ctxt *ctxt, struct cpuid_leaf *leaf)
{ … }
static int sev_cpuid_hv(struct ghcb *ghcb, struct es_em_ctxt *ctxt, struct cpuid_leaf *leaf)
{ … }
static const struct snp_cpuid_table *snp_cpuid_get_table(void)
{ … }
static u32 snp_cpuid_calc_xsave_size(u64 xfeatures_en, bool compacted)
{ … }
static bool __head
snp_cpuid_get_validated_func(struct cpuid_leaf *leaf)
{ … }
static void snp_cpuid_hv(struct ghcb *ghcb, struct es_em_ctxt *ctxt, struct cpuid_leaf *leaf)
{ … }
static int snp_cpuid_postprocess(struct ghcb *ghcb, struct es_em_ctxt *ctxt,
struct cpuid_leaf *leaf)
{ … }
static int __head
snp_cpuid(struct ghcb *ghcb, struct es_em_ctxt *ctxt, struct cpuid_leaf *leaf)
{ … }
void __head do_vc_no_ghcb(struct pt_regs *regs, unsigned long exit_code)
{ … }
static enum es_result vc_insn_string_check(struct es_em_ctxt *ctxt,
unsigned long address,
bool write)
{ … }
static enum es_result vc_insn_string_read(struct es_em_ctxt *ctxt,
void *src, char *buf,
unsigned int data_size,
unsigned int count,
bool backwards)
{ … }
static enum es_result vc_insn_string_write(struct es_em_ctxt *ctxt,
void *dst, char *buf,
unsigned int data_size,
unsigned int count,
bool backwards)
{ … }
#define IOIO_TYPE_STR …
#define IOIO_TYPE_IN …
#define IOIO_TYPE_INS …
#define IOIO_TYPE_OUT …
#define IOIO_TYPE_OUTS …
#define IOIO_REP …
#define IOIO_ADDR_64 …
#define IOIO_ADDR_32 …
#define IOIO_ADDR_16 …
#define IOIO_DATA_32 …
#define IOIO_DATA_16 …
#define IOIO_DATA_8 …
#define IOIO_SEG_ES …
#define IOIO_SEG_DS …
static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo)
{ … }
static enum es_result vc_handle_ioio(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
{ … }
static int vc_handle_cpuid_snp(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
{ … }
static enum es_result vc_handle_cpuid(struct ghcb *ghcb,
struct es_em_ctxt *ctxt)
{ … }
static enum es_result vc_handle_rdtsc(struct ghcb *ghcb,
struct es_em_ctxt *ctxt,
unsigned long exit_code)
{ … }
struct cc_setup_data { … };
static __head
struct cc_blob_sev_info *find_cc_blob_setup_data(struct boot_params *bp)
{ … }
static void __head setup_cpuid_table(const struct cc_blob_sev_info *cc_info)
{ … }
static inline void __pval_terminate(u64 pfn, bool action, unsigned int page_size,
int ret, u64 svsm_ret)
{ … }
static void svsm_pval_terminate(struct svsm_pvalidate_call *pc, int ret, u64 svsm_ret)
{ … }
static void svsm_pval_4k_page(unsigned long paddr, bool validate)
{ … }
static void pvalidate_4k_page(unsigned long vaddr, unsigned long paddr, bool validate)
{ … }
static void pval_pages(struct snp_psc_desc *desc)
{ … }
static u64 svsm_build_ca_from_pfn_range(u64 pfn, u64 pfn_end, bool action,
struct svsm_pvalidate_call *pc)
{ … }
static int svsm_build_ca_from_psc_desc(struct snp_psc_desc *desc, unsigned int desc_entry,
struct svsm_pvalidate_call *pc)
{ … }
static void svsm_pval_pages(struct snp_psc_desc *desc)
{ … }
static void pvalidate_pages(struct snp_psc_desc *desc)
{ … }
static int vmgexit_psc(struct ghcb *ghcb, struct snp_psc_desc *desc)
{ … }
static enum es_result vc_check_opcode_bytes(struct es_em_ctxt *ctxt,
unsigned long exit_code)
{ … }
static bool __head svsm_setup_ca(const struct cc_blob_sev_info *cc_info)
{ … }