Index: sys/dev/intelhfi/intelhfi.c =================================================================== --- sys/dev/intelhfi/intelhfi.c +++ sys/dev/intelhfi/intelhfi.c @@ -177,7 +177,7 @@ struct hmp_pcpu *hp; uint64_t msrval; uint8_t *highperf; - uint8_t maxperf; + uint8_t minperf = 255; int cpu; int ret = 0; @@ -198,16 +198,16 @@ /* Read CPU each core high perf. value from IA32_HWP_CAPABILITIES msr */ smp_rendezvous(NULL, intelhfi_hmp_capacity_read_highperf, NULL, highperf); - /* Search MAX capacity core */ + /* Search MIN capacity core */ for (int c=0; cmaxperf) - maxperf = *(highperf+c); + if (*(highperf+c)capacity = HMP_CAPACITY_NORMAL_FROM(*(highperf+cpu), maxperf); + hp->capacity = HMP_CAPACITY_NORMAL_FROM(*(highperf+cpu), minperf); } free(highperf, M_INTELHFI); @@ -263,10 +263,10 @@ KASSERT(hp != NULL, ("DPCPU area is NULL.")); if (*(capflags+0) & INTELHFI_GH_FLAG_REPORT) - hmp_set_score(hp, HMP_SCORE_PERF, (hmp_score_t)(*(entry+0))); + hmp_set_score(hp, HMP_SCORE_PERF, (((hmp_score_t)(*(entry+0)))<<2)); if (*(capflags+1) & INTELHFI_GH_FLAG_REPORT) - hmp_set_score(hp, HMP_SCORE_EFF, (hmp_score_t)(*(entry+1))); + hmp_set_score(hp, HMP_SCORE_EFF, (((hmp_score_t)(*(entry+1)))<<2)); } } }