From patchwork Tue Sep 26 22:23:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 9972801 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 7C4D560393 for ; Tue, 26 Sep 2017 22:25:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EB6528FA6 for ; Tue, 26 Sep 2017 22:25:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6221228FA7; Tue, 26 Sep 2017 22:25:01 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9470628FBB for ; Tue, 26 Sep 2017 22:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jX8uHWLikt2SgukGOTE3ptKdRzr/eLNXUkJ/sqsW67A=; b=beGMyA0mULnFQD0/zrT9bkxAIP Ac/oZUY7h3tti0eMU1bd2gXqINMybBa8GYydUGZjgxjEo1KM6AV6+l908tgmfShJPW2Qb50reEdyy M90h+VNwIdUHd6p+nOO+UGEZgQCnu45P8RQg/ViudNk1i6ARiStTXIJU2PpnfTlYimEMIknEnP7Sg OMGuXJwvchR5TY9yHKN1AZF1sZHj9MBnMwb0wo0yspN5Q2klpbR6tApvULFIXtuKReZANkVXq1t7w N+86pfCBulBlX6qrU5sHm0pU3FdmdnEvcu5UrEKzoRoS/ei2y1XztLi08K4s1U7Zr3Bw8pCjDSAAs YYRElgnA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dwyGs-00064k-2I; Tue, 26 Sep 2017 22:24:06 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dwyGo-0005nI-Kt for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2017 22:24:04 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8F134E4C3; Tue, 26 Sep 2017 22:23:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E8F134E4C3 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ahs3@redhat.com Received: from fidelio.ahs3 (ovpn-116-41.phx2.redhat.com [10.3.116.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E6CA784B0; Tue, 26 Sep 2017 22:23:41 +0000 (UTC) From: Al Stone To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] arm64: cpuinfo: add MPIDR value to /proc/cpuinfo Date: Tue, 26 Sep 2017 16:23:22 -0600 Message-Id: <20170926222324.17409-2-ahs3@redhat.com> In-Reply-To: <20170926222324.17409-1-ahs3@redhat.com> References: <20170926222324.17409-1-ahs3@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 26 Sep 2017 22:23:42 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170926_152402_751199_4FD98C7A X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , Will Deacon , Al Stone , Suzuki K Poulose MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When displaying cpuinfo on an arm64 system, include the MPIDR register value which can be used to understand the CPU topology on a platform. This can serve as a cross-check to the information provided in sysfs, and has been useful in understanding CPU and NUMA allocation issues. Signed-off-by: Al Stone Cc: Catalin Marinas Cc: Will Deacon Cc: Suzuki K Poulose Cc: Mark Rutland --- arch/arm64/include/asm/cpu.h | 1 + arch/arm64/kernel/cpuinfo.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm64/include/asm/cpu.h b/arch/arm64/include/asm/cpu.h index 889226b4c6e1..ac40894df247 100644 --- a/arch/arm64/include/asm/cpu.h +++ b/arch/arm64/include/asm/cpu.h @@ -32,6 +32,7 @@ struct cpuinfo_arm64 { u32 reg_midr; u32 reg_revidr; + u64 reg_id_aa64mpidr; u64 reg_id_aa64dfr0; u64 reg_id_aa64dfr1; u64 reg_id_aa64isar0; diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 4a6f875ac854..e505007138eb 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -120,6 +120,7 @@ static int c_show(struct seq_file *m, void *v) for_each_online_cpu(i) { struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i); u32 midr = cpuinfo->reg_midr; + u64 mpidr = cpuinfo->reg_id_aa64mpidr; /* * glibc reads /proc/cpuinfo to determine the number of @@ -159,6 +160,12 @@ static int c_show(struct seq_file *m, void *v) } seq_puts(m, "\n"); + seq_printf(m, "CPU MPIDR\t: 0x%016llx ", mpidr); + seq_printf(m, "(Aff3 %d Aff2 %d Aff1 %d Aff0 %d)\n", + (u8) MPIDR_AFFINITY_LEVEL(mpidr, 3), + (u8) MPIDR_AFFINITY_LEVEL(mpidr, 2), + (u8) MPIDR_AFFINITY_LEVEL(mpidr, 1), + (u8) MPIDR_AFFINITY_LEVEL(mpidr, 0)); seq_printf(m, "CPU implementer\t: 0x%02x\n", MIDR_IMPLEMENTOR(midr)); seq_printf(m, "CPU architecture: 8\n"); @@ -372,6 +379,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info) info->reg_midr = read_cpuid_id(); info->reg_revidr = read_cpuid(REVIDR_EL1); + info->reg_id_aa64mpidr = read_cpuid_mpidr(); info->reg_id_aa64dfr0 = read_cpuid(ID_AA64DFR0_EL1); info->reg_id_aa64dfr1 = read_cpuid(ID_AA64DFR1_EL1); info->reg_id_aa64isar0 = read_cpuid(ID_AA64ISAR0_EL1);