Re: [PATCH v2 05/11] powerpc: add hv_gpci interface header

2014-02-25 Thread Cody P Schafer

On 02/24/2014 07:33 PM, Michael Ellerman wrote:

On Fri, 2014-14-02 at 22:02:09 UTC, Cody P Schafer wrote:

H_GetPerformanceCounterInfo (refered to as hv_gpci or just gpci from
here on) is an interface to retrieve specific performance counters and
other data from the hypervisor. All outputs have a fixed format (and
are represented as structs in this patch).


I still see unused stuff in here, can you strip it back to just what we need.
Same goes for the next patch.



Sure, I can remove the unused structures and enum entries (hadn't 
realized you wanted that in the last review).


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 05/11] powerpc: add hv_gpci interface header

2014-02-24 Thread Michael Ellerman
On Fri, 2014-14-02 at 22:02:09 UTC, Cody P Schafer wrote:
 H_GetPerformanceCounterInfo (refered to as hv_gpci or just gpci from
 here on) is an interface to retrieve specific performance counters and
 other data from the hypervisor. All outputs have a fixed format (and
 are represented as structs in this patch).

I still see unused stuff in here, can you strip it back to just what we need.
Same goes for the next patch.

cheers
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 05/11] powerpc: add hv_gpci interface header

2014-02-14 Thread Cody P Schafer
H_GetPerformanceCounterInfo (refered to as hv_gpci or just gpci from
here on) is an interface to retrieve specific performance counters and
other data from the hypervisor. All outputs have a fixed format (and
are represented as structs in this patch).

Signed-off-by: Cody P Schafer c...@linux.vnet.ibm.com
---
 arch/powerpc/perf/hv-gpci.h | 521 
 1 file changed, 521 insertions(+)
 create mode 100644 arch/powerpc/perf/hv-gpci.h

diff --git a/arch/powerpc/perf/hv-gpci.h b/arch/powerpc/perf/hv-gpci.h
new file mode 100644
index 000..d602809
--- /dev/null
+++ b/arch/powerpc/perf/hv-gpci.h
@@ -0,0 +1,521 @@
+#ifndef LINUX_POWERPC_PERF_HV_GPCI_H_
+#define LINUX_POWERPC_PERF_HV_GPCI_H_
+
+#include linux/types.h
+
+/* From the document H_GetPerformanceCounterInfo Interface v1.07 */
+
+/* H_GET_PERF_COUNTER_INFO argument */
+struct hv_get_perf_counter_info_params {
+   __be32 counter_request; /* I */
+   __be32 starting_index;  /* IO */
+   __be16 secondary_index; /* IO */
+   __be16 returned_values; /* O */
+   __be32 detail_rc; /* O, only needed when called via *_norets() */
+
+   /*
+* O, size each of counter_value element in bytes, only set for version
+* = 0x3
+*/
+   __be16 cv_element_size;
+
+   /* I, 0 (zero) for versions  0x3 */
+   __u8 counter_info_version_in;
+
+   /* O, 0 (zero) if version  0x3. Must be set to 0 when making hcall */
+   __u8 counter_info_version_out;
+   __u8 reserved[0xC];
+   __u8 counter_value[];
+} __packed;
+
+/*
+ * counter info version = fw version/reference (spec version)
+ *
+ * 8 = power8 (1.07)
+ * [7 is skipped by spec 1.07]
+ * 6 = TLBIE (1.07)
+ * 5 = v7r7m0.phyp (1.05)
+ * [4 skipped]
+ * 3 = v7r6m0.phyp (?)
+ * [1,2 skipped]
+ * 0 = v7r{2,3,4}m0.phyp (?)
+ */
+#define COUNTER_INFO_VERSION_CURRENT 0x8
+
+/*
+ * These determine the counter_value[] layout and the meaning of starting_index
+ * and secondary_index.
+ *
+ * Unless otherwise noted, @secondary_index is unused and ignored.
+ */
+enum counter_info_requests {
+
+   /* GENERAL */
+
+   /* @starting_index: starting physical processor index or -1 for
+*  current physical processor. Data is only collected
+*  for the processors' primary thread.
+*/
+   CIR_DISPATCH_TIMEBASE_BY_PROCESSOR = 0x10,
+
+   /* @starting_index: starting partition id or -1 for the current logical
+*  partition (virtual machine).
+*/
+   CIR_ENTITLED_CAPPED_UNCAPPED_DONATED_IDLE_TIMEBASE_BY_PARTITION = 0x20,
+
+   /* @starting_index: starting partition id or -1 for the current logical
+*  partition (virtual machine).
+*/
+   CIR_RUN_INSTRUCTIONS_RUN_CYCLES_BY_PARTITION = 0X30,
+
+   /* @starting_index: must be -1 (to refer to the current partition)
+*/
+   CIR_SYSTEM_PERFORMANCE_CAPABILITIES = 0X40,
+
+
+   /* Data from this should only be considered valid if
+* counter_info_version = 0x3
+* @starting_index: starting hardware chip id or -1 for the current hw
+*  chip id
+*/
+   CIR_PROCESSOR_BUS_UTILIZATION_ABC_LINKS = 0X50,
+
+   /* Data from this should only be considered valid if
+* counter_info_version = 0x3
+* @starting_index: starting hardware chip id or -1 for the current hw
+*  chip id
+*/
+   CIR_PROCESSOR_BUS_UTILIZATION_WXYZ_LINKS = 0X60,
+
+   /*
+* EXPANDED - the following are only avaliable if the CV_CM_EXPANDED
+* bit is set from system_performace_capabilities. Enforcement is left
+* to the hypervisor.
+*/
+
+   /* Available if counter_info_version = 0x3
+* @starting_index: starting hardware chip id or -1 for the current hw
+*  chip id
+*/
+   CIR_PROCESSOR_BUS_UTILIZATION_GX_LINKS = 0X70,
+
+   /* Available if counter_info_version = 0x3
+* @starting_index: starting hardware chip id or -1 for the current hw
+*  chip id
+*/
+   CIR_PROCESSOR_BUS_UTILIZATION_MC_LINKS = 0X80,
+
+   /* Available if counter_info_version = 0x3
+* @starting_index: starting physical processor or -1 for the current
+*  physical processor
+*/
+   CIR_PROCESSOR_CONFIG = 0X90,
+
+   /* Available if counter_info_version = 0x3
+* @starting_index: starting physical processor or -1 for the current
+*  physical processor
+*/
+   CIR_CURRENT_PROCESSOR_FREQUENCY = 0X91,
+
+   /* Available if counter_info_version = 0x3 and = 0x7
+* @starting_index: starting physical processor or -1 for the current
+*  physical processor
+*/
+   CIR_PROCESSOR_CORE_UTILIZATION = 0X94,
+
+   /* Available if