cpu: allow for more package than core cstates

Change reporting code to walk package, then core, the cpu to determine max
number of cstate vs. just walking the logical cpus.

change display function to obtain max cstate num the same way.
cpu: add support for new package states

The next generation Intel cpu supports package states c8/c9/c10.
Add the code to read the relevant MSR counters.
Common read/write MSR API

Added two new interfaces:
extern int read_msr(int cpu, uint64_t offset, uint64_t *value);
extern int write_msr(int cpu, uint64_t offset, uint64_t value);

This way all MSR interface can use this instead of reimplementing.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Use MSR Lib MSR functions

MSR read is implemented in lib.c. Use this API instead.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
RAPL Interface

Added RAPL interface class. This provides methods to get the status
of RAPL domains and get energy and power status.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
cpu device as parent class

Added members and methods so that it can have children. Other cpu type
device can inherit and overide functionality.
If there are children, the power_usage method will not include the
power reported by children, as they will be reporting as its own device.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Interface to get first cpu

Added get interface to get the first cpu number for this
cpu device.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Added PP0 RAPL domain for CPU

Added PP0 RAPL domain as core CPU power. This will display as
"cpu core" in the device stats.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Add RAPL DRAM domain

Added DRAM RAPL domain as core CPU power. This will display as
"DRAM" in the device stats, if present.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Add RAPL PP1 domain for GPU

Added RAPL PP1 domain as GPU core power. This will show "GPU misc" and
"GPU core" in device stats, if PP1 domain is present.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Add new patch which allows us to report devslp residency
Add devslp support to PowerTOP AHCI monitoring

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Merge git://github.com/fenrus75/powertop