|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86/vpmu: Add a cpuid function
# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxx>
# Date 1331820690 -3600
# Node ID 28f5f047d060a0c8e831fb4e693a8509a2b62bd8
# Parent f47d91cb0faac1f8b505bc5f61c9608d39010992
x86/vpmu: Add a cpuid function
Add a new function - do_cpuid - to the vpmu struct arch_vpmu_ops. This
permits the vpmu to set specific bits in the cpuid for the hvm guest.
Signed-off-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c Thu Mar 15 15:11:30 2012 +0100
@@ -1613,6 +1613,8 @@
break;
}
+ vpmu_do_cpuid(input, eax, ebx, ecx, edx);
+
HVMTRACE_5D (CPUID, input, *eax, *ebx, *ecx, *edx);
}
diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c Thu Mar 15 15:11:30 2012 +0100
@@ -547,6 +547,12 @@
return 1;
}
+static void core2_vpmu_do_cpuid(unsigned int input,
+ unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+{
+}
+
static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
{
struct vcpu *v = current;
@@ -608,6 +614,7 @@
.do_wrmsr = core2_vpmu_do_wrmsr,
.do_rdmsr = core2_vpmu_do_rdmsr,
.do_interrupt = core2_vpmu_do_interrupt,
+ .do_cpuid = core2_vpmu_do_cpuid,
.arch_vpmu_destroy = core2_vpmu_destroy,
.arch_vpmu_save = core2_vpmu_save,
.arch_vpmu_load = core2_vpmu_load
diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vpmu.c Thu Mar 15 15:11:30 2012 +0100
@@ -62,6 +62,16 @@
return 0;
}
+void vpmu_do_cpuid(unsigned int input,
+ unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+{
+ struct vpmu_struct *vpmu = vcpu_vpmu(current);
+
+ if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->do_cpuid )
+ vpmu->arch_vpmu_ops->do_cpuid(input, eax, ebx, ecx, edx);
+}
+
void vpmu_save(struct vcpu *v)
{
struct vpmu_struct *vpmu = vcpu_vpmu(v);
diff -r f47d91cb0faa -r 28f5f047d060 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/include/asm-x86/hvm/vpmu.h Thu Mar 15 15:11:30 2012 +0100
@@ -40,6 +40,9 @@
int (*do_wrmsr)(unsigned int msr, uint64_t msr_content);
int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content);
int (*do_interrupt)(struct cpu_user_regs *regs);
+ void (*do_cpuid)(unsigned int input,
+ unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx);
void (*arch_vpmu_destroy)(struct vcpu *v);
void (*arch_vpmu_save)(struct vcpu *v);
void (*arch_vpmu_load)(struct vcpu *v);
@@ -67,6 +70,8 @@
int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content);
int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
int vpmu_do_interrupt(struct cpu_user_regs *regs);
+void vpmu_do_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx);
void vpmu_initialise(struct vcpu *v);
void vpmu_destroy(struct vcpu *v);
void vpmu_save(struct vcpu *v);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |