Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp798076imm; Thu, 26 Jul 2018 12:10:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfQTF7IKmdsthKBf2GFhQeXOE/Uf+jIBQt/WVqm3IjYDr33UBEPeuhGEaTJ7PfW4sOpgyma X-Received: by 2002:a17:902:694a:: with SMTP id k10-v6mr3128797plt.166.1532632233583; Thu, 26 Jul 2018 12:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532632233; cv=none; d=google.com; s=arc-20160816; b=WMD847/Z91MfRVYctXXvFD0HBvJ3RIibHipjHE9CYdFIV63C3DZZA8uANcwFj/pF2T jSYp6X1dKlsD51bLhTkpivnU138bAmrvXdLuXJDi5cYYpqi6f4ezf578B7P9Yi4zcw8v hDYL9VRlGcNOuf3X6TiYNShrmqCe1pcbgW/QBKQprgmqMuyEOOANu8b1CNq4m0Drqe8u Nzlgg//I3iP4nuXbsMrrkwLpRV6Z1YIjQkum4LXEGgYG2W1CpUMbKn/NG6CKC9FwhDMX 0/A4qBVphI62lB+cbQvXA6auF60sF4puchVcaihuhKqMgo60b7hRuy65B3lOA8Ssl+Pv X/2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=tAA1UVt5MmrgMwmr02et0iJgT0r6sJhmsmYeo94XRR4=; b=PIQrdMwjhE1/zrvor4q03fvHktaMllX56foJWLi0aHvUWfNko6d1Z+76U1pysetMdJ BTBepfL3DZD9ItgrdEzJjA1hePYRqZ5ailV3HEKQaNAKfItQZD31/4yCi8E1KBPpVCVP 65uCzy17G+HT9keIMNW/zfVkz3EyQPNlWTvHbIAkvPARjH47azpRN54g3L6qFe4eDmE4 oL20eXdWyKhf4Fi9OXi0ISTmDl+nTcCHMhmLhbBE24iErP1oH1OzHqOMMQAO4FRcNt9R dEmcyWb6D8aYPJRGNi1vW6EhUT2MJMpfpJnecc5+5R+m4+lmHk5WtluOgdkZ6HicT1Vd 4yfQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n61-v6si1754768plb.256.2018.07.26.12.10.19; Thu, 26 Jul 2018 12:10:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731231AbeGZU0o (ORCPT + 99 others); Thu, 26 Jul 2018 16:26:44 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:32852 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730068AbeGZU0n (ORCPT ); Thu, 26 Jul 2018 16:26:43 -0400 Received: by mail-qt0-f196.google.com with SMTP id c15-v6so2690617qtp.0; Thu, 26 Jul 2018 12:08:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tAA1UVt5MmrgMwmr02et0iJgT0r6sJhmsmYeo94XRR4=; b=qm4zC1rPrSrokmUWJeeMguIQsAyRVklaMxzHmpc3olyjlHGJp/UgVLsdBrHu/21+LE 5i62MUSpPoX4fUaqhymS4D+JXgfnPjZvQDV3sUZ8xOmBmYazLUASSMxW0fmEOaYFF11A rGhGcUhUk36dNY9Q0qY7Xae9wAcBWcEUbk7r+GnkEv+wo0pkK9RNpokKKNZEDhp/LX5Y hCc/3OlXypspbyaqeEyTmsSl6qYXE0bYr5dKo1zhFDtnRpPpQZfDjMB+eEuvQNMU1YVJ /g+CpWr6+UT0oUnvVvpETsz6GOqZQLoqi9gVq5fZfB1s6XIiw7JF6AqJ9s+2EPaRT23c ATjw== X-Gm-Message-State: AOUpUlEBgpaGIyDDqhvbV9CObIxTQicSBI50slKnPzTkl2LJNYGWZo1n a59hrYpHN6xYBoQxxFsk3ivlc+L4umlBgTDHrWGreamL X-Received: by 2002:ac8:196c:: with SMTP id g41-v6mr3260169qtk.277.1532632112831; Thu, 26 Jul 2018 12:08:32 -0700 (PDT) MIME-Version: 1.0 References: <20180718222656.11795-1-calvin.walton@kepstin.ca> <20180718222656.11795-2-calvin.walton@kepstin.ca> In-Reply-To: <20180718222656.11795-2-calvin.walton@kepstin.ca> From: Len Brown Date: Thu, 26 Jul 2018 15:08:22 -0400 Message-ID: Subject: Re: [PATCH 1/2] turbostat: Read extended processor family from CPUID To: calvin.walton@kepstin.ca Cc: Linux PM list , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , "Brown, Len" 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 Hi Calvin, Your patch looks correct on both AMD and Intel. Thanks for noticing this, and taking the extra step to fix it! Please re-send your patch with a Signed-off-by: line, so that I can apply it. Note that first running checkpatch.pl on patches before submitting will point out such issues, so they are easily avoided. thanks, -Len On Wed, Jul 18, 2018 at 6:27 PM Calvin Walton wrote: > > 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. > --- > tools/power/x86/turbostat/turbostat.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c > index bd9c6b31a504..f404d67fda92 100644 > --- a/tools/power/x86/turbostat/turbostat.c > +++ b/tools/power/x86/turbostat/turbostat.c > @@ -4031,7 +4031,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 || family >= 0xf) > model += ((fms >> 16) & 0xf) << 4; > > if (!quiet) { > -- > 2.18.0 > -- Len Brown, Intel Open Source Technology Center