Bug#985681: linux-cpupower: Fix Pkg Power tracking on Zen

2021-05-07 Thread Salvatore Bonaccorso
Hi,

On Fri, May 07, 2021 at 10:47:56AM +0200, Christian Kastner wrote:
> Hi,
> 
> On 05.05.21 23:04, Salvatore Bonaccorso wrote:
> > This has now been fixed upstream with 
> > https://git.kernel.org/linus/301b1d3a9104f4f3a8ab4171cf88d0f55d632b41
> 
> Great :-)
> 
> > I'm going probably to cherry-pick the commit, but in case you can/want
> > to double check (again I know, but there was some followup) the issue
> > for you that would be great.
> 
> I gave it a try on an 3900X, it worked fine.
> 
> Thank you for your help!

Welcome and thanks for your re-confirming! I picked it for the next
upload:

https://salsa.debian.org/kernel-team/linux/-/commit/ccf10f6987743972139d19a6288240610b78ba2e

Regards,
Salvatore



Bug#985681: linux-cpupower: Fix Pkg Power tracking on Zen

2021-05-07 Thread Christian Kastner
Hi,

On 05.05.21 23:04, Salvatore Bonaccorso wrote:
> This has now been fixed upstream with 
> https://git.kernel.org/linus/301b1d3a9104f4f3a8ab4171cf88d0f55d632b41

Great :-)

> I'm going probably to cherry-pick the commit, but in case you can/want
> to double check (again I know, but there was some followup) the issue
> for you that would be great.

I gave it a try on an 3900X, it worked fine.

Thank you for your help!

Best,
Christian



Bug#985681: linux-cpupower: Fix Pkg Power tracking on Zen

2021-05-05 Thread Salvatore Bonaccorso
Hi

This has now been fixed upstream with 
https://git.kernel.org/linus/301b1d3a9104f4f3a8ab4171cf88d0f55d632b41

I'm going probably to cherry-pick the commit, but in case you can/want
to double check (again I know, but there was some followup) the issue
for you that would be great.

Regards,
Salvatore



Bug#985681: linux-cpupower: Fix Pkg Power tracking on Zen

2021-03-21 Thread Christian Kastner
Package: linux-cpupower
Version: 5.10.24-1
Severity: normal
Tags: patch

turbostat no longer works with at least some Zen-based systems, it exits
early with code 243.

A trivial fix has been proposed that reportedly works at least for Zen 2
and 3.

I myself have successfully tested it with Zen 2.

The patch has not yet been included upstream (there has been no reply to
it in quite a while), but since it's so trivial, perhaps it could be
included in our package, so that we may get back power statistics for
Zen CPUs.

(This may or may not warrant a higher severity. If Zen 2 belongs to the
officially supported platforms, that it should probably be more severe.)
Author: Kurt Garloff 
Date:   Sat Dec 26 13:00:15 2020 +0100

turbostat: Fix Pkg Power tracking on Zen

AMD Zen processors use a different MSR (MSR_PKG_ENERGY_STAT) than intel
(MSR_PKG_ENERGY_STATUS) to track package power; however we want to record
it at the same offset in our package_data.
offset_to_idx() however only recognized the intel MSR, erroring
out with -13 on Zen.

With this fix, it will support the Zen MSR.
Tested successfully on Ryzen 3000.

Signed-off-by: Kurt Garloff 

Origin: https://lore.kernel.org/lkml/f6143d7a-079d-3f3c-c947-47fc9858a...@debian.org/T/#t

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index f3a1746f7f45..eb845421f492 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -325,6 +325,7 @@ int offset_to_idx(int offset)
 	int idx;
 
 	switch (offset) {
+	case MSR_PKG_ENERGY_STAT:
 	case MSR_PKG_ENERGY_STATUS:
 		idx = IDX_PKG_ENERGY;
 		break;