#ifndef ARCH_X86_KVM_CPUID_H
#define ARCH_X86_KVM_CPUID_H
#include "x86.h"
#include "reverse_cpuid.h"
#include <asm/cpu.h>
#include <asm/processor.h>
#include <uapi/asm/kvm_para.h>
extern u32 kvm_cpu_caps[NR_KVM_CPU_CAPS] __read_mostly;
void kvm_set_cpu_caps(void);
void kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu);
void kvm_update_pv_runtime(struct kvm_vcpu *vcpu);
struct kvm_cpuid_entry2 *kvm_find_cpuid_entry_index(struct kvm_vcpu *vcpu,
u32 function, u32 index);
struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
u32 function);
int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries,
unsigned int type);
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);
bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
u32 *ecx, u32 *edx, bool exact_only);
u32 xstate_required_size(u64 xstate_bv, bool compacted);
int cpuid_query_maxphyaddr(struct kvm_vcpu *vcpu);
u64 kvm_vcpu_reserved_gpa_bits_raw(struct kvm_vcpu *vcpu);
static inline int cpuid_maxphyaddr(struct kvm_vcpu *vcpu)
{ … }
static inline bool kvm_vcpu_is_legal_gpa(struct kvm_vcpu *vcpu, gpa_t gpa)
{ … }
static inline bool kvm_vcpu_is_legal_aligned_gpa(struct kvm_vcpu *vcpu,
gpa_t gpa, gpa_t alignment)
{ … }
static inline bool page_address_valid(struct kvm_vcpu *vcpu, gpa_t gpa)
{ … }
static __always_inline void cpuid_entry_override(struct kvm_cpuid_entry2 *entry,
unsigned int leaf)
{ … }
static __always_inline u32 *guest_cpuid_get_register(struct kvm_vcpu *vcpu,
unsigned int x86_feature)
{ … }
static __always_inline bool guest_cpuid_has(struct kvm_vcpu *vcpu,
unsigned int x86_feature)
{ … }
static __always_inline void guest_cpuid_clear(struct kvm_vcpu *vcpu,
unsigned int x86_feature)
{ … }
static inline bool guest_cpuid_is_amd_compatible(struct kvm_vcpu *vcpu)
{ … }
static inline bool guest_cpuid_is_intel_compatible(struct kvm_vcpu *vcpu)
{ … }
static inline int guest_cpuid_family(struct kvm_vcpu *vcpu)
{ … }
static inline int guest_cpuid_model(struct kvm_vcpu *vcpu)
{ … }
static inline bool cpuid_model_is_consistent(struct kvm_vcpu *vcpu)
{ … }
static inline int guest_cpuid_stepping(struct kvm_vcpu *vcpu)
{ … }
static inline bool guest_has_spec_ctrl_msr(struct kvm_vcpu *vcpu)
{ … }
static inline bool guest_has_pred_cmd_msr(struct kvm_vcpu *vcpu)
{ … }
static inline bool supports_cpuid_fault(struct kvm_vcpu *vcpu)
{ … }
static inline bool cpuid_fault_enabled(struct kvm_vcpu *vcpu)
{ … }
static __always_inline void kvm_cpu_cap_clear(unsigned int x86_feature)
{ … }
static __always_inline void kvm_cpu_cap_set(unsigned int x86_feature)
{ … }
static __always_inline u32 kvm_cpu_cap_get(unsigned int x86_feature)
{ … }
static __always_inline bool kvm_cpu_cap_has(unsigned int x86_feature)
{ … }
static __always_inline void kvm_cpu_cap_check_and_set(unsigned int x86_feature)
{ … }
static __always_inline bool guest_pv_has(struct kvm_vcpu *vcpu,
unsigned int kvm_feature)
{ … }
enum kvm_governed_features { … };
static __always_inline int kvm_governed_feature_index(unsigned int x86_feature)
{ … }
static __always_inline bool kvm_is_governed_feature(unsigned int x86_feature)
{ … }
static __always_inline void kvm_governed_feature_set(struct kvm_vcpu *vcpu,
unsigned int x86_feature)
{ … }
static __always_inline void kvm_governed_feature_check_and_set(struct kvm_vcpu *vcpu,
unsigned int x86_feature)
{ … }
static __always_inline bool guest_can_use(struct kvm_vcpu *vcpu,
unsigned int x86_feature)
{ … }
static inline bool kvm_vcpu_is_legal_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
{ … }
#endif