aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/vpmu.c
Commit message (Collapse)AuthorAgeFilesLines
* x86/VPMU: Save/restore VPMU only when necessaryBoris Ostrovsky2013-04-151-7/+68
| | | | | | | | | | | | | VPMU doesn't need to always be saved during context switch. If we are comming back to the same processor and no other VPCU has run here we can simply continue running. This is especailly useful on Intel processors where Global Control MSR is stored in VMCS, thus not requiring us to stop the counters during save operation. On AMD we need to explicitly stop the counters but we don't need to save them. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
* x86/VPMU: Factor out VPMU common codeBoris Ostrovsky2013-04-151-5/+45
| | | | | | | | | Factor out common code from SVM amd VMX into VPMU. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Acked-by: Jun Nakajima <jun.nakajima@intel.com>
* vpmu intel: Dump vpmu infos in 'q' keyhandlerDietmar Hahn2013-04-081-0/+9
| | | | | | | | | | | | | | | | | This patch extends the printout of the VPCU infos of the keyhandler 'q'. If vPMU is enabled is on the VCPU and active lines are printed like (when running HVM openSuSE-12.3 with 'perf top'); (XEN) vPMU running (XEN) general_0: 0x000000ffffff3ae1 ctrl: 0x000000000053003c (XEN) fixed_1: 0x000000ff90799188 ctrl: 0xb This means general counter 0 and fixed counter 1 are running with showing their contents and the contents of their configuration msr. Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Jun Nakajima <jun.nakajima@intel.com>
* vpmu intel: Add cpuid handling when vpmu disabledDietmar Hahn2013-03-261-9/+6
| | | | | | | | | | | | | | | | | Even though vpmu is disabled in the hypervisor in the HVM guest the call of cpuid(0xa) returns informations about usable performance counters. This may confuse guest software when trying to use the counters and nothing happens. This patch clears most bits in registers eax and edx of cpuid(0xa) instruction for the guest when vpmu is disabled: - version ID of architectural performance counting - number of general pmu registers - width of general pmu registers - number of fixed pmu registers - width of ixed pmu registers Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/vpmu: Add the BTS extensionDietmar Hahn2012-03-151-4/+32
| | | | | | | | Add the BTS functionality to the existing vpmu implementation for Intel CPUs. Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86/vpmu: Add a cpuid functionDietmar Hahn2012-03-151-0/+10
| | | | | | | | 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@ts.fujitsu.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* vpmu: No need for two initialisation functionsDietmar Hahn2012-02-291-7/+2
| | | | | | | | With the changeset 24529:87854d3bed93 we got 2 initialisation functions for the arch specific stuff. This is no more needed. Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Committed-by: Keir Fraser <keir@xen.org>
* vpmu: Use macros to access struct vpmu_struct.flagsDietmar Hahn2012-02-091-2/+2
| | | | | | | | | | This patch introduces some macros realising the access to the item 'flags' in the struct vpmu_struct (see xen/include/asm-x86/hvm/vpmu.h). Only bits within 'flags' are set/reset/checked. Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Committed-by: Keir Fraser <keir@xen.org>
* vpmu: separate architecture specific PMU initialisationDietmar Hahn2012-01-201-36/+6
| | | | | | | | | 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>
* vpmu: Add processors Westmere E7-8837 and SandyBridge i5-2500 to the vpmu listDietmar Hahn2011-08-311-0/+2
| | | | Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
* xen: remove more declarations from C files.Tim Deegan2011-05-271-3/+0
| | | | | | | | | | This patch moves some more, mostly data, extern declarations into header files. I haven't been as strict as I was with functions; in particular there are a number of declarations of assembler labels that are only used in one place. I've also left a few compat-mode tricks, and all the magic in symbols.c Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* xen: Include headers that are actually needed, drop everything else.Christoph Egger2011-05-201-2/+1
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* hvm: vpmu: Enable HVM VPMU for AMD Family 12h and 14h processorsJacob Shin2011-05-121-0/+2
| | | | | | | HVM VPMU support can be enabled for AMD Family 12h and 14h processors by taking the same code path as 10h. Signed-off-by: Jacob Shin <jacob.shin@amd.com>
* hvm: vpmu: Add support for AMD Family 15h processorsJacob Shin2011-05-091-0/+1
| | | | | | | | AMD Family 15h CPU mirrors legacy K7 performance monitor counters to a new location, and adds 2 new counters. This patch updates HVM VPMU to take advantage of the new counters. Signed-off-by: Jacob Shin <jacob.shin@amd.com>
* Use bool_t for various boolean variablesKeir Fraser2010-12-241-1/+1
| | | | | | | | | | | ... decreasing cache footprint. As a prerequisite this requires making cmdline_parse() a little more flexible. Also remove a few variables altogether, and adjust sections annotations for several others. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xen.org>
* VPMU: Add the Intel CPU X7542 to the list of supported prcocessorsKeir Fraser2010-11-191-0/+1
| | | | Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
* x86 hvm vpmu: Print error if VPMU cannot be init'ed on this CPU.Keir Fraser2010-11-161-27/+27
| | | | | Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Signed-off-by: Keir Fraser <keir@xen.org>
* x86 vpmu: msr-handling cleanupKeir Fraser2010-06-091-4/+4
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* VPMU: Enable vpmu for svmKeir Fraser2010-05-131-8/+43
| | | | Signed-off-by: Wei Wang <wei.wang2@amd.com>
* VPMU: Migrate vpmu files into public foldersKeir Fraser2010-05-131-0/+119
Signed-off-by: Wei Wang <wei.wang2@amd.com>