From patchwork Wed Jul 18 22:26:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Walton X-Patchwork-Id: 10533383 X-Patchwork-Delegate: lenb@kernel.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5BD88600D0 for ; Wed, 18 Jul 2018 22:27:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F8E52992D for ; Wed, 18 Jul 2018 22:27:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43D69299EB; Wed, 18 Jul 2018 22:27:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED27C2992D for ; Wed, 18 Jul 2018 22:27:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730433AbeGRXHM (ORCPT ); Wed, 18 Jul 2018 19:07:12 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:38862 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730403AbeGRXHM (ORCPT ); Wed, 18 Jul 2018 19:07:12 -0400 Received: by mail-io0-f195.google.com with SMTP id v26-v6so5447458iog.5 for ; Wed, 18 Jul 2018 15:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kepstin.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j0xFaJbwJ/MHER0BQC5OzaLd9qP1rA6+NEyBochapKU=; b=vL/6A65+FcfgWjhcrfJKUP4eBZ7xx2rPEn4hl4PfwbqKUDx3hTK4c7MEcisspkoMGi 7bKLor19rW90a/CxlRIv9znGZhGlX1rur4hjAUGCYwyIBIi2GwNlWk5vUpu1+x552QVq /bz95OeEpMMRyFAYVM9jZ2h/8wshzIAYwYqFs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=j0xFaJbwJ/MHER0BQC5OzaLd9qP1rA6+NEyBochapKU=; b=FidYo2YfgZw8WADKFeOBET9JUnz0ttoZpEQN56nJx1DHAXYwEVyzY9I4IN3aisECzT xtP4IkGoalmayWVdk1RPoL+ZiofeW+DLcQi4wQqBncvu6E7OZYG+n6ESBi8QHd830OhR odsn1J7clFa3w6asP6UWvy785NBONt3cscpeOXNj6Fi3ODe17rBYiSdIGtj5gTQ1H8z7 NjRiyMaJ5ES+Tw0Chf010J/oAMAw/bzwXatEFzlkDwQ1RY4tLi0AGL9fZ1GeKhiHyQAW 2Si1GXfnF5xH5XEnj92Ysq8s9NX289wVuK+AfvACY0K2f3dhDmFleVnGbFew5QlERceW QDgw== X-Gm-Message-State: AOUpUlG4j5v5T/MNr3M+z1AhP4E+SfkY1dqQsmCxqv4JSpCHQfldqh0w g2d/BFGCfCtW+aEyCfji/hyyglVCqIPoFw== X-Google-Smtp-Source: AAOMgpegyBvDy28yUE7FayUu/10goxtH1i5dxWhT6lYGo0Ux3xH3Q5Ksie7hCUr6r25A4jia2w0g6g== X-Received: by 2002:a6b:8265:: with SMTP id e98-v6mr6491657iod.287.1531952831983; Wed, 18 Jul 2018 15:27:11 -0700 (PDT) Received: from fuko.kepstin.ca ([2001:470:b3f4::561]) by smtp.gmail.com with ESMTPSA id j11-v6sm2060803itj.6.2018.07.18.15.27.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 15:27:11 -0700 (PDT) From: Calvin Walton To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Len Brown Cc: Calvin Walton Subject: [PATCH 1/2] turbostat: Read extended processor family from CPUID Date: Wed, 18 Jul 2018 18:26:55 -0400 Message-Id: <20180718222656.11795-2-calvin.walton@kepstin.ca> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180718222656.11795-1-calvin.walton@kepstin.ca> References: <20180718222656.11795-1-calvin.walton@kepstin.ca> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) {