Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1831017imm; Mon, 3 Sep 2018 10:32:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZarJm3eIdkdbgfiVcu78xrVIG3YhkQwF3ipgsvwjh9jDvtYAzuak0cneXf6LI4z7KJOPt0 X-Received: by 2002:a62:63c2:: with SMTP id x185-v6mr30532207pfb.13.1535995967810; Mon, 03 Sep 2018 10:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995967; cv=none; d=google.com; s=arc-20160816; b=y9oNrnsiSpuGCES6IJ19LwkqY91HTyvqTx66HcpqW7B3QAgO789MxcTNCL7BNzEvzn IngYYJQ1phvBv1V/37mXRZ6uKqktz3TNkYpDzq3GIWl0QlYv6sSCFjceed9AYtPcWvDa kI+Xhwu6fDzpv9LbE4+fsk36g+9dpBitguSIJhS3cOPdMqYyYWMCXSJYX/zHLQvQD6jA 2Oj+UJUT8BGJXYGE0x5JMFSi/rn0GIE1kJh7RKIQ+IL5VQKtAsJ0hzcgDc5SFwyZL5b5 OxCF86nQEk0i+298i7nlat5JijKzYTRe3l+oy8UllF1lOa31S6yvP3QHarBny6LT0Wk9 t+CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=5XUWlTYqffQuJIoiUxfCkDAU8NUuMZMrfVgyoOebFY4=; b=o/4JCYJshrbgd7NU16qGvThohwcWHt9H9nwnagQQ8ATtAKOchfSL6EV0s4caXh55Qp yfMxusfGnpaUxTyzO7bU0HPfw38eIr89t7pRPcDZ7XKC76Mzc/mMBMhM2dEQjKF4jEO8 hvWkyYwghpgQE4KOJR8Uye7PptTx1aM/IvjCzu1GcsI16Ge8OW/eJxNclPIm1j/vIxa+ 9K/lpUshXK10W1hqvaa/iBUapt/CSnPb/WIKiFRW1GnbhMdHJaA1pnCNL0mimWo2plwy pqu8c2tk8UOsuY8CQ/UklU6MWAkCnfj/1e+qEDBnUIFZoQrHXeDBjg371m8DOd3PGdLk OpXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6-v6si20062207pls.150.2018.09.03.10.32.31; Mon, 03 Sep 2018 10:32:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730933AbeICVsR (ORCPT + 99 others); Mon, 3 Sep 2018 17:48:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45994 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730921AbeICVsQ (ORCPT ); Mon, 3 Sep 2018 17:48:16 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C78A6D19; Mon, 3 Sep 2018 17:19:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Calvin Walton , Len Brown , Sasha Levin Subject: [PATCH 4.14 058/165] tools/power turbostat: Read extended processor family from CPUID Date: Mon, 3 Sep 2018 18:55:44 +0200 Message-Id: <20180903165658.038173908@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Calvin Walton [ Upstream commit 5aa3d1a20a233d4a5f1ec3d62da3f19d9afea682 ] This fixes the reported family on modern AMD processors (e.g. Ryzen, which is family 0x17). Previously these processors all showed up as family 0xf. See the document https://support.amd.com/TechDocs/56255_OSRR.pdf section CPUID_Fn00000001_EAX for how to calculate the family from the BaseFamily and ExtFamily values. This matches the code in arch/x86/lib/cpu.c Signed-off-by: Calvin Walton Signed-off-by: Len Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/power/x86/turbostat/turbostat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -4029,7 +4029,9 @@ void process_cpuid() family = (fms >> 8) & 0xf; model = (fms >> 4) & 0xf; stepping = fms & 0xf; - if (family == 6 || family == 0xf) + if (family == 0xf) + family += (fms >> 20) & 0xff; + if (family >= 6) model += ((fms >> 16) & 0xf) << 4; if (!quiet) {