~ubuntu-branches/ubuntu/precise/linux-lowlatency/precise

« back to all changes in this revision

Viewing changes to arch/x86/kvm/cpuid.h

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich, Luke Yelavich, Upstream Kernel Changes
  • Date: 2012-03-30 09:03:19 UTC
  • Revision ID: package-import@ubuntu.com-20120330090319-5445yb1865swhoiv
Tags: 3.2.0-21.29
[ Luke Yelavich ]

* [Config] Update configs after rebase against Ubuntu-3.2.0-21.34

[ Upstream Kernel Changes ]

* Low-latency: Rebase against Ubuntu-3.2.0-21.34

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef ARCH_X86_KVM_CPUID_H
 
2
#define ARCH_X86_KVM_CPUID_H
 
3
 
 
4
#include "x86.h"
 
5
 
 
6
void kvm_update_cpuid(struct kvm_vcpu *vcpu);
 
7
struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
 
8
                                              u32 function, u32 index);
 
9
int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
 
10
                                      struct kvm_cpuid_entry2 __user *entries);
 
11
int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
 
12
                             struct kvm_cpuid *cpuid,
 
13
                             struct kvm_cpuid_entry __user *entries);
 
14
int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
 
15
                              struct kvm_cpuid2 *cpuid,
 
16
                              struct kvm_cpuid_entry2 __user *entries);
 
17
int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
 
18
                              struct kvm_cpuid2 *cpuid,
 
19
                              struct kvm_cpuid_entry2 __user *entries);
 
20
 
 
21
 
 
22
static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu)
 
23
{
 
24
        struct kvm_cpuid_entry2 *best;
 
25
 
 
26
        best = kvm_find_cpuid_entry(vcpu, 1, 0);
 
27
        return best && (best->ecx & bit(X86_FEATURE_XSAVE));
 
28
}
 
29
 
 
30
static inline bool guest_cpuid_has_smep(struct kvm_vcpu *vcpu)
 
31
{
 
32
        struct kvm_cpuid_entry2 *best;
 
33
 
 
34
        best = kvm_find_cpuid_entry(vcpu, 7, 0);
 
35
        return best && (best->ebx & bit(X86_FEATURE_SMEP));
 
36
}
 
37
 
 
38
static inline bool guest_cpuid_has_fsgsbase(struct kvm_vcpu *vcpu)
 
39
{
 
40
        struct kvm_cpuid_entry2 *best;
 
41
 
 
42
        best = kvm_find_cpuid_entry(vcpu, 7, 0);
 
43
        return best && (best->ebx & bit(X86_FEATURE_FSGSBASE));
 
44
}
 
45
 
 
46
#endif