From patchwork Wed Aug 8 13:03:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prarit Bhargava X-Patchwork-Id: 10559993 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-2.web.codeaurora.org (Postfix) with ESMTP id 2E8F7174A for ; Wed, 8 Aug 2018 13:03:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D30728965 for ; Wed, 8 Aug 2018 13:03:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 115AA28CE6; Wed, 8 Aug 2018 13:03:17 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 E799128965 for ; Wed, 8 Aug 2018 13:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727247AbeHHPWu (ORCPT ); Wed, 8 Aug 2018 11:22:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59254 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727005AbeHHPWu (ORCPT ); Wed, 8 Aug 2018 11:22:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F169E81663CF for ; Wed, 8 Aug 2018 13:03:13 +0000 (UTC) Received: from prarit.bos.redhat.com (prarit-guest.khw.lab.eng.bos.redhat.com [10.16.186.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5ADF104083A; Wed, 8 Aug 2018 13:03:13 +0000 (UTC) From: Prarit Bhargava To: linux-pm@vger.kernel.org Cc: Prarit Bhargava Subject: [PATCH] tools/power turbostat: Get APIC ID for all processors Date: Wed, 8 Aug 2018 09:03:06 -0400 Message-Id: <20180808130306.32483-1-prarit@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 08 Aug 2018 13:03:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 08 Aug 2018 13:03:13 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'prarit@redhat.com' RCPT:'' 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 FWIW the kernel does the same thing on arch/x86/kernel/cpu/common.c:1194. P. ---8<--- turbostat shows apicid = 0 for all non-Intel processors. The APIC ID code can be run on all processors and must read bits 20-27. Signed-off-by: Prarit Bhargava --- tools/power/x86/turbostat/turbostat.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 980bd9d20646..2dc212b88651 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -1671,13 +1671,10 @@ void get_apic_id(struct thread_data *t) eax = ebx = ecx = edx = 0; - if (!genuine_intel) - return; - __cpuid(0, max_level, ebx, ecx, edx); __cpuid(1, eax, ebx, ecx, edx); - t->apic_id = (ebx >> 24) & 0xf; + t->apic_id = (ebx >> 24) & 0xff; if (max_level < 0xb) return;