Re: [PATCH v4] tools/power turbostat: Fix RAPL summary collection on AMD processors

From: Calvin Walton
Date: Fri Apr 16 2021 - 10:50:59 EST


On Fri, 2021-04-16 at 06:42 -0500, Terry Bowman wrote:
>
> Hi Calvin,
>
> Thanks for the feedback. I'll begin making the change and testing.
> I'll
> respond with V2 patch in this thread.
>
> Regards,
> Terry

It looks like there might already be a patch in the pipeline for this
issue; see Chen Yu's response to my patch here:
https://lkml.org/lkml/2021/4/14/1322
I'm hoping we get some clarification of the status soon.

While you're respinning your patch, there's one other issue that I
noticed - all the idx/offset-related functions pass the offset value in
a variable of type "int" (32bit signed integer), but the offset of the
AMD MSR_CORE_ENERGY_STAT MSR is 0xC001029A, which exceeds INT_MAX. The
offsets should all use "off_t" to get a 64bit type and avoid wrapping
or sign extension issues.

--
Calvin Walton <calvin.walton@xxxxxxxxxx>