diff options
author | Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> | 2012-01-20 10:40:16 +0000 |
---|---|---|
committer | Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> | 2012-01-20 10:40:16 +0000 |
commit | b4960592ac4f1e9c34ae50d6fefd4df92d9601fb (patch) | |
tree | 60c221f9105f967037079f3a571cd3c0055234d7 /xen/arch/x86/hvm/vpmu.c | |
parent | 3852f2a6da36de3a600a00c432426a3ba967526a (diff) | |
download | xen-b4960592ac4f1e9c34ae50d6fefd4df92d9601fb.tar.gz xen-b4960592ac4f1e9c34ae50d6fefd4df92d9601fb.tar.bz2 xen-b4960592ac4f1e9c34ae50d6fefd4df92d9601fb.zip |
vpmu: separate architecture specific PMU initialisation
This patch moves the architecture specific initialisation of the PMU
into the archicture specific directory.
Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hvm/vpmu.c')
-rw-r--r-- | xen/arch/x86/hvm/vpmu.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c index d761fb2c91..bae6eedcf4 100644 --- a/xen/arch/x86/hvm/vpmu.c +++ b/xen/arch/x86/hvm/vpmu.c @@ -81,9 +81,7 @@ void vpmu_load(struct vcpu *v) void vpmu_initialise(struct vcpu *v) { struct vpmu_struct *vpmu = vcpu_vpmu(v); - __u8 vendor = current_cpu_data.x86_vendor; - __u8 family = current_cpu_data.x86; - __u8 cpu_model = current_cpu_data.x86_model; + uint8_t vendor = current_cpu_data.x86_vendor; if ( !opt_vpmu_enabled ) return; @@ -94,47 +92,19 @@ void vpmu_initialise(struct vcpu *v) switch ( vendor ) { case X86_VENDOR_AMD: - switch ( family ) - { - case 0x10: - case 0x12: - case 0x14: - case 0x15: - vpmu->arch_vpmu_ops = &amd_vpmu_ops; - break; - default: - printk("VPMU: Initialization failed. " - "AMD processor family %d has not " - "been supported\n", family); - return; - } + if ( svm_vpmu_initialise(v) != 0 ) + opt_vpmu_enabled = 0; break; case X86_VENDOR_INTEL: - if ( family == 6 ) - { - switch ( cpu_model ) - { - case 15: - case 23: - case 26: - case 29: - case 42: - case 46: - case 47: - vpmu->arch_vpmu_ops = &core2_vpmu_ops; - break; - } - } - if ( vpmu->arch_vpmu_ops == NULL ) - printk("VPMU: Initialization failed. " - "Intel processor family %d model %d has not " - "been supported\n", family, cpu_model); + if ( vmx_vpmu_initialise(v) != 0 ) + opt_vpmu_enabled = 0; break; default: printk("VPMU: Initialization failed. " "Unknown CPU vendor %d\n", vendor); + opt_vpmu_enabled = 0; break; } |