#define pr_fmt(fmt) …
#include <linux/kvm_host.h>
#include "linux/lockdep.h"
#include <linux/export.h>
#include <linux/vmalloc.h>
#include <linux/uaccess.h>
#include <linux/sched/stat.h>
#include <asm/processor.h>
#include <asm/user.h>
#include <asm/fpu/xstate.h>
#include <asm/sgx.h>
#include <asm/cpuid.h>
#include "cpuid.h"
#include "lapic.h"
#include "mmu.h"
#include "trace.h"
#include "pmu.h"
#include "xen.h"
u32 kvm_cpu_caps[NR_KVM_CPU_CAPS] __read_mostly;
EXPORT_SYMBOL_GPL(…);
u32 xstate_required_size(u64 xstate_bv, bool compacted)
{ … }
#define F …
#define SF(name) …
#define KVM_CPUID_INDEX_NOT_SIGNIFICANT …
static inline struct kvm_cpuid_entry2 *cpuid_entry2_find(
struct kvm_cpuid_entry2 *entries, int nent, u32 function, u64 index)
{ … }
static int kvm_check_cpuid(struct kvm_vcpu *vcpu,
struct kvm_cpuid_entry2 *entries,
int nent)
{ … }
static int kvm_cpuid_check_equal(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 *e2,
int nent)
{ … }
static struct kvm_hypervisor_cpuid __kvm_get_hypervisor_cpuid(struct kvm_cpuid_entry2 *entries,
int nent, const char *sig)
{ … }
static struct kvm_hypervisor_cpuid kvm_get_hypervisor_cpuid(struct kvm_vcpu *vcpu,
const char *sig)
{ … }
static struct kvm_cpuid_entry2 *__kvm_find_kvm_cpuid_features(struct kvm_cpuid_entry2 *entries,
int nent, u32 kvm_cpuid_base)
{ … }
static struct kvm_cpuid_entry2 *kvm_find_kvm_cpuid_features(struct kvm_vcpu *vcpu)
{ … }
void kvm_update_pv_runtime(struct kvm_vcpu *vcpu)
{ … }
static u64 cpuid_get_supported_xcr0(struct kvm_cpuid_entry2 *entries, int nent)
{ … }
static void __kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 *entries,
int nent)
{ … }
void kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool kvm_cpuid_has_hyperv(struct kvm_cpuid_entry2 *entries, int nent)
{ … }
static bool guest_cpuid_is_amd_or_hygon(struct kvm_vcpu *vcpu)
{ … }
static void kvm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu)
{ … }
int cpuid_query_maxphyaddr(struct kvm_vcpu *vcpu)
{ … }
u64 kvm_vcpu_reserved_gpa_bits_raw(struct kvm_vcpu *vcpu)
{ … }
static int kvm_set_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 *e2,
int nent)
{ … }
int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
struct kvm_cpuid *cpuid,
struct kvm_cpuid_entry __user *entries)
{ … }
int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries)
{ … }
int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries)
{ … }
static __always_inline void __kvm_cpu_cap_mask(unsigned int leaf)
{ … }
static __always_inline
void kvm_cpu_cap_init_kvm_defined(enum kvm_only_cpuid_leafs leaf, u32 mask)
{ … }
static __always_inline void kvm_cpu_cap_mask(enum cpuid_leafs leaf, u32 mask)
{ … }
void kvm_set_cpu_caps(void)
{ … }
EXPORT_SYMBOL_GPL(…);
struct kvm_cpuid_array { … };
static struct kvm_cpuid_entry2 *get_next_cpuid(struct kvm_cpuid_array *array)
{ … }
static struct kvm_cpuid_entry2 *do_host_cpuid(struct kvm_cpuid_array *array,
u32 function, u32 index)
{ … }
static int __do_cpuid_func_emulated(struct kvm_cpuid_array *array, u32 func)
{ … }
static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
{ … }
static int do_cpuid_func(struct kvm_cpuid_array *array, u32 func,
unsigned int type)
{ … }
#define CENTAUR_CPUID_SIGNATURE …
static int get_cpuid_func(struct kvm_cpuid_array *array, u32 func,
unsigned int type)
{ … }
static bool sanity_check_entries(struct kvm_cpuid_entry2 __user *entries,
__u32 num_entries, unsigned int ioctl_type)
{ … }
int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries,
unsigned int type)
{ … }
struct kvm_cpuid_entry2 *kvm_find_cpuid_entry_index(struct kvm_vcpu *vcpu,
u32 function, u32 index)
{ … }
EXPORT_SYMBOL_GPL(…);
struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
u32 function)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct kvm_cpuid_entry2 *
get_out_of_range_cpuid_entry(struct kvm_vcpu *vcpu, u32 *fn_ptr, u32 index)
{ … }
bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
u32 *ecx, u32 *edx, bool exact_only)
{ … }
EXPORT_SYMBOL_GPL(…);
int kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
{ … }
EXPORT_SYMBOL_GPL(…);