cregit-Linux how code gets into the kernel

Release 4.11 arch/x86/kvm/cpuid.h

Directory: arch/x86/kvm
#ifndef ARCH_X86_KVM_CPUID_H

#define ARCH_X86_KVM_CPUID_H

#include "x86.h"
#include <asm/cpu.h>

int kvm_update_cpuid(struct kvm_vcpu *vcpu);
bool kvm_mpx_supported(void);
struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
					      u32 function, u32 index);
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);
void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx);

int cpuid_query_maxphyaddr(struct kvm_vcpu *vcpu);


static inline int cpuid_maxphyaddr(struct kvm_vcpu *vcpu) { return vcpu->arch.maxphyaddr; }

Contributors

PersonTokensPropCommitsCommitProp
Eugene Korenevsky19100.00%1100.00%
Total19100.00%1100.00%


static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; if (!static_cpu_has(X86_FEATURE_XSAVE)) return false; best = kvm_find_cpuid_entry(vcpu, 1, 0); return best && (best->ecx & bit(X86_FEATURE_XSAVE)); }

Contributors

PersonTokensPropCommitsCommitProp
Avi Kivity4279.25%133.33%
Petr Matousek1018.87%133.33%
Joe Perches11.89%133.33%
Total53100.00%3100.00%


static inline bool guest_cpuid_has_mtrr(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 1, 0); return best && (best->edx & bit(X86_FEATURE_MTRR)); }

Contributors

PersonTokensPropCommitsCommitProp
Paolo Bonzini42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_tsc_adjust(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 7, 0); return best && (best->ebx & bit(X86_FEATURE_TSC_ADJUST)); }

Contributors

PersonTokensPropCommitsCommitProp
Will Auld42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_smep(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 7, 0); return best && (best->ebx & bit(X86_FEATURE_SMEP)); }

Contributors

PersonTokensPropCommitsCommitProp
Avi Kivity42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_smap(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 7, 0); return best && (best->ebx & bit(X86_FEATURE_SMAP)); }

Contributors

PersonTokensPropCommitsCommitProp
Feng Wu42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_fsgsbase(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 7, 0); return best && (best->ebx & bit(X86_FEATURE_FSGSBASE)); }

Contributors

PersonTokensPropCommitsCommitProp
Avi Kivity42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_pku(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 7, 0); return best && (best->ecx & bit(X86_FEATURE_PKU)); }

Contributors

PersonTokensPropCommitsCommitProp
Huaitong Han42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_longmode(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x80000001, 0); return best && (best->edx & bit(X86_FEATURE_LM)); }

Contributors

PersonTokensPropCommitsCommitProp
Paolo Bonzini42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_osvw(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x80000001, 0); return best && (best->ecx & bit(X86_FEATURE_OSVW)); }

Contributors

PersonTokensPropCommitsCommitProp
Boris Ostrovsky42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_pcid(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 1, 0); return best && (best->ecx & bit(X86_FEATURE_PCID)); }

Contributors

PersonTokensPropCommitsCommitProp
Junjie Mao42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_x2apic(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 1, 0); return best && (best->ecx & bit(X86_FEATURE_X2APIC)); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kiszka42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_is_amd(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0, 0); return best && best->ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx; }

Contributors

PersonTokensPropCommitsCommitProp
Paolo Bonzini37100.00%1100.00%
Total37100.00%1100.00%


static inline bool guest_cpuid_has_gbpages(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x80000001, 0); return best && (best->edx & bit(X86_FEATURE_GBPAGES)); }

Contributors

PersonTokensPropCommitsCommitProp
Nadav Amit42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_rtm(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 7, 0); return best && (best->ebx & bit(X86_FEATURE_RTM)); }

Contributors

PersonTokensPropCommitsCommitProp
Nadav Amit42100.00%1100.00%
Total42100.00%1100.00%


static inline bool guest_cpuid_has_rdtscp(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x80000001, 0); return best && (best->edx & bit(X86_FEATURE_RDTSCP)); }

Contributors

PersonTokensPropCommitsCommitProp
Xiao Guangrong42100.00%1100.00%
Total42100.00%1100.00%

/* * NRIPS is provided through cpuidfn 0x8000000a.edx bit 3 */ #define BIT_NRIPS 3
static inline bool guest_cpuid_has_nrips(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x8000000a, 0); /* * NRIPS is a scattered cpuid feature, so we can't use * X86_FEATURE_NRIPS here (X86_FEATURE_NRIPS would be bit * position 8, not 3). */ return best && (best->edx & bit(BIT_NRIPS)); }

Contributors

PersonTokensPropCommitsCommitProp
Joerg Roedel43100.00%1100.00%
Total43100.00%1100.00%

#undef BIT_NRIPS
static inline int guest_cpuid_family(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x1, 0); if (!best) return -1; return x86_family(best->eax); }

Contributors

PersonTokensPropCommitsCommitProp
Borislav Petkov45100.00%1100.00%
Total45100.00%1100.00%


static inline int guest_cpuid_model(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x1, 0); if (!best) return -1; return x86_model(best->eax); }

Contributors

PersonTokensPropCommitsCommitProp
Borislav Petkov45100.00%1100.00%
Total45100.00%1100.00%


static inline int guest_cpuid_stepping(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x1, 0); if (!best) return -1; return x86_stepping(best->eax); }

Contributors

PersonTokensPropCommitsCommitProp
Borislav Petkov45100.00%1100.00%
Total45100.00%1100.00%

#endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Avi Kivity26126.10%29.09%
Borislav Petkov14314.30%29.09%
Paolo Bonzini12712.70%418.18%
Nadav Amit858.50%313.64%
Joerg Roedel515.10%14.55%
Xiao Guangrong424.20%14.55%
Boris Ostrovsky424.20%14.55%
Will Auld424.20%14.55%
Feng Wu424.20%14.55%
Huaitong Han424.20%14.55%
Junjie Mao424.20%14.55%
Jan Kiszka424.20%14.55%
Eugene Korenevsky282.80%14.55%
Petr Matousek101.00%14.55%
Joe Perches10.10%14.55%
Total1000100.00%22100.00%
Directory: arch/x86/kvm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.