aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2009-12-18 03:48:46 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:35:40 -0500
commit0e85188049afacdfce9c026144142264981bbabb (patch)
tree773021a2bd3a799e2814e750ad85ff016f51fccf /arch/x86/kvm/x86.c
parentbe43f83dada2cf0e9e01c9a0ba42977c5bd70f9d (diff)
KVM: Add cpuid_update() callback to kvm_x86_ops
Sometime, we need to adjust some state in order to reflect guest CPUID setting, e.g. if we don't expose rdtscp to guest, we won't want to enable it on hardware. cpuid_update() is introduced for this purpose. Also export kvm_find_cpuid_entry() for later use. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4e7bbc49b7e4..e5ac21f992f0 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1574,6 +1574,7 @@ static int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
1574 cpuid_fix_nx_cap(vcpu); 1574 cpuid_fix_nx_cap(vcpu);
1575 r = 0; 1575 r = 0;
1576 kvm_apic_set_version(vcpu); 1576 kvm_apic_set_version(vcpu);
1577 kvm_x86_ops->cpuid_update(vcpu);
1577 1578
1578out_free: 1579out_free:
1579 vfree(cpuid_entries); 1580 vfree(cpuid_entries);
@@ -1596,6 +1597,7 @@ static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
1596 goto out; 1597 goto out;
1597 vcpu->arch.cpuid_nent = cpuid->nent; 1598 vcpu->arch.cpuid_nent = cpuid->nent;
1598 kvm_apic_set_version(vcpu); 1599 kvm_apic_set_version(vcpu);
1600 kvm_x86_ops->cpuid_update(vcpu);
1599 return 0; 1601 return 0;
1600 1602
1601out: 1603out:
@@ -3733,6 +3735,7 @@ struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
3733 } 3735 }
3734 return best; 3736 return best;
3735} 3737}
3738EXPORT_SYMBOL_GPL(kvm_find_cpuid_entry);
3736 3739
3737int cpuid_maxphyaddr(struct kvm_vcpu *vcpu) 3740int cpuid_maxphyaddr(struct kvm_vcpu *vcpu)
3738{ 3741{