Skip to contentSkip to conversation

intel cpus: add proper C-states init

PATCH Applied Sergey Senozhatsky 2 participants 2 messages Oct 17, 2013 – Oct 18, 2013

lore
Share & tools
lore

Sergey Senozhatsky

author
#0 lore raw

PATCH 1/1 intel cpus: add proper C-states init

add missing has_c2c7_res init to nhm_core() .ctor and has_c8c9c10_res/has_c2c7_res init to nhm_package() .ctor.

uninitialised has_c2c7_res/has_c8c9c10_res/has_c2c7_res may be used in core/package measurement_start()/measurement_end().

Signed-off-by Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

---

src/cpu/intel_cpus.cpp | 6 +++++-

 1 file changed, 5 insertions(+), 1 deletion(-)
src/cpu/intel_cpus.cpp +5 -1
index 194dc75..ad80337 100644
@@ -87,6 +87,8 @@ static uint64_t get_msr(int cpu, uint64_t offset)
 
 nhm_core::nhm_core(int model)
 {
+	has_c2c7_res = 0;
+
 	switch(model) {
 		case 0x2A:	/* SNB */
 		case 0x2D:	/* SNB Xeon */
@@ -252,6 +254,9 @@ char * nhm_core::fill_pstate_line(int line_nr, char *buffer)
 
 nhm_package::nhm_package(int model)
 {
+	has_c8c9c10_res = 0;
+	has_c2c7_res = 0;
+
 	switch(model) {
 		case 0x2A:	/* SNB */
 		case 0x2D:	/* SNB Xeon */
@@ -269,7 +274,6 @@ nhm_package::nhm_package(int model)
 	else
 		has_c3_res = 1;
 
-
 	/* Haswell-ULT has C8/9/10*/
 	if (model == 0x45)
 		has_c8c9c10_res = 1;
Applied
#1 lore raw
Quoted 7 lines · On Thu, 17 Oct 2013 23:37:51 +0300 Sergey Senozhatsky…

add missing has_c2c7_res init to nhm_core() .ctor and has_c8c9c10_res/has_c2c7_res init to nhm_package() .ctor.

uninitialised has_c2c7_res/has_c8c9c10_res/has_c2c7_res may be used in core/package measurement_start()/measurement_end().

Signed-off-by Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

Applied, thanks.