Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3672851pxb; Mon, 1 Feb 2021 01:20:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwCtamYFi/3S0wX5c91o8JAk/mEevXorgtgjLVHnwGk7JwzdbydiSezmuR/Cgy4EiYdEdv X-Received: by 2002:a17:906:1bf2:: with SMTP id t18mr17457678ejg.166.1612171228357; Mon, 01 Feb 2021 01:20:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612171228; cv=none; d=google.com; s=arc-20160816; b=nJCNPk/++8nbRApOz9bSDI+Az6gBjjzeYO6x8Z2LxIwCgaLymewC0Qgu2SQjSaD8wa EYimzUPL4P92EFUUgBRXf1JyhFJjlXv1rzp56b5kuDsT1D8nTJK9g9E6PA2ATYUag7Q0 VuhDUz3B8QhHOG7tOFe93+FSAkeVnza6hT5IMLsR0SpNL5pgo2h/CqIrV44Yppt3IfdW ktmDWNdpMRREGNxxULBzShAq4nra9qvZzgrXQnQrxkz4XdY2aZxrLnqhacEbIHjs6K6E MG3HVDYnA3RSEeWE4Aek4JxVy3b+GEiSVzlX5jKiUznlxIKuLPwAlvexls3NUBzwtfMO KQ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:references:to :from:subject; bh=lGGifbtbiJ4u4XUTSPzXXFK44dQL1ALf+An/LXv6S5c=; b=eirCrNQNzEkxJNwqKq5VrX/3HWarjG9usW5rQdIlGqIDnyn7zjEAskpjxpgNhSRTAn 68Smk5XJqLnV5q2ws7nALSlWpukY9czmwCVya/CV81sS6SAPuf3gm+WSxTzshQhNRqn/ oZPv8+t3NcOThezFzWfrXECgi4Q9bY7DgSpBWJdx32wjp7nSRDfRZ/QnZj1IdBR0Yg0z G3LjSHuoVEgagZo+Vq6QOwXerHZ2kHXmBJoX4OQtBSr7pNAQK5hLi6s3YLaPhuTHzC0A EyxdysHToxYQNeZvBxHoWC/5GIcWsm507tGO9sCSKRQRr8bHD2zc1y+12vjT4RwMvykx jqRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si10715512eju.570.2021.02.01.01.20.04; Mon, 01 Feb 2021 01:20:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232846AbhBAJSi (ORCPT + 99 others); Mon, 1 Feb 2021 04:18:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232785AbhBAJRE (ORCPT ); Mon, 1 Feb 2021 04:17:04 -0500 Received: from cc-smtpout1.netcologne.de (cc-smtpout1.netcologne.de [IPv6:2001:4dd0:100:1062:25:2:0:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F30CEC061574 for ; Mon, 1 Feb 2021 01:06:42 -0800 (PST) Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id C65B813693; Mon, 1 Feb 2021 10:06:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id C2CB311F48; Mon, 1 Feb 2021 10:06:41 +0100 (CET) Received: from [213.196.193.186] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.19.0) (envelope-from ) id 6017c4a1-0254-7f0000012729-7f000001abb8-1 for ; Mon, 01 Feb 2021 10:06:41 +0100 Received: from nas2.garloff.de (xdsl-213-196-193-186.nc.de [213.196.193.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Mon, 1 Feb 2021 10:06:39 +0100 (CET) Received: from [192.168.155.202] (ap4.garloff.de [192.168.155.15]) by nas2.garloff.de (Postfix) with ESMTPSA id 6AEF6B3B13A5; Mon, 1 Feb 2021 10:06:39 +0100 (CET) Subject: [PATCH 1/1]: turbostat: Fix Pkg Power on Zen From: Kurt Garloff To: Len Brown , LKML References: <1f1fb01e-0616-34ea-ede6-dc7dd679c3d4@garloff.de> Message-ID: Date: Mon, 1 Feb 2021 10:06:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 5d399d05df42ffcaa2b3836b580631c4024487a0 Author: Kurt Garloff Date:   Mon Feb 1 09:01:47 2021 +0000     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 & 5000.         Signed-off-by: Kurt Garloff diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 389ea5209a83..cb830e73d899 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; -- Kurt Garloff Cologne, Germany