From patchwork Sat Jun 28 01:12:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 4439131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 581FC9F440 for ; Sat, 28 Jun 2014 01:14:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 906B0203B0 for ; Sat, 28 Jun 2014 01:14:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 42ED020397 for ; Sat, 28 Jun 2014 01:14:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X0hCB-0001Ao-Dm; Sat, 28 Jun 2014 01:12:47 +0000 Received: from mail-ie0-x231.google.com ([2607:f8b0:4001:c03::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X0hC0-00014L-Fv for linux-arm-kernel@lists.infradead.org; Sat, 28 Jun 2014 01:12:36 +0000 Received: by mail-ie0-f177.google.com with SMTP id tp5so5044116ieb.22 for ; Fri, 27 Jun 2014 18:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=zFysZQ9YBFi6JNwTDjR/WloOqL+fxqlNEBehKOk6sOM=; b=NbO/S1mOLLSRLSdsMyNJAEvnRc920H7GtALHFM4gUroOIat/6loCQhoB+6PrnZ7GP2 W0TuYQvptDAjWNknazd7xNhmX78iMos4Ga7JYNFO1qFpjDrgyigphm+3c8XAsbRoShzr E/TcN9YiKdIiJ92hROeRE43Iw+GMehYiprP5H+M0jCUeBNO6WRwkocGPkxtqCMuE/K/O AhOpN1uV68OJGyehMVhLT4WPE3S5S/WfpsFWdgvKagTRX8VvkE7uE6l9nY0XLLCA7cvE Yqu5YhXo5KM92Z3Ru9QJesU/BS+RxD3BAAndXoZezIyi5txj5hP3sJhQ52Qg2smK+QFn 8gzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=zFysZQ9YBFi6JNwTDjR/WloOqL+fxqlNEBehKOk6sOM=; b=UFJIFWQ56k8x9LEMZfgSN9Q8R2Wko50yt2tn602USJ0GkVZMJPL6KUFUyDqAlkOKiS DqZ0wj2TmFiu6HtbxT8kCz999+Ug7n+JhmhCooAJGLJIZcu9hUiEQhQF90lKEj6XFJmD 0898uEL5wUufTswhDyodJnT/NsKi9f4BwRBPsqfQ6cMw172po1P7HdxWmHIUO6ihfzxs 217ndm7Dp9GjmMsqGr4meBR4MM7TzPfN9xWI2lwS9JCAmSxzh7O4LxLRCAIVk4H/w6Rb IURIQh4wooomvveBFyLKDQgbiY1IPr8FvFu+whhvElcA/iJ9jW8cHuFYGm4dk9j4j1W0 O/yw== X-Gm-Message-State: ALoCoQnZp53zSzVL81baiu/FT2bEuDBNCdqv4uHXDZLVHHadXQlQS6+IwOv5RyAihinKoibGUi1Y X-Received: by 10.51.17.97 with SMTP id gd1mr16755904igd.18.1403917935368; Fri, 27 Jun 2014 18:12:15 -0700 (PDT) Received: from localhost ([172.16.48.235]) by mx.google.com with ESMTPSA id u10sm2055879igz.21.2014.06.27.18.12.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Jun 2014 18:12:14 -0700 (PDT) Subject: [PATCH 2/2] arm64: kernel: update cpuinfo to print all online CPUs features To: Catalin Marinas , Will Deacon From: Bjorn Helgaas Date: Fri, 27 Jun 2014 19:12:14 -0600 Message-ID: <20140628011214.9839.32281.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140628010440.9839.9366.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140628010440.9839.9366.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140627_181236_578621_A87A4961 X-CRM114-Status: GOOD ( 13.90 ) X-Spam-Score: -0.1 (/) Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update the /proc/cpuinfo show function so that it shows the CPU ID of each CPU instead of using the ID of the CPU that happens to be running the code. Based on b4b8f770eb10 ("ARM: kernel: update cpuinfo to print all online CPUs features"). Signed-off-by: Bjorn Helgaas --- arch/arm64/kernel/setup.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 37cc2bb9f3ae..dd301ceaa655 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -448,10 +448,8 @@ static const char *hwcap_str[] = { static int c_show(struct seq_file *m, void *v) { - int i; - - seq_printf(m, "Processor\t: %s rev %d (%s)\n", - cpu_name, read_cpuid_id() & 15, ELF_PLATFORM); + int i, j; + u32 cpuid; for_each_online_cpu(i) { /* @@ -461,23 +459,24 @@ static int c_show(struct seq_file *m, void *v) */ #ifdef CONFIG_SMP seq_printf(m, "processor\t: %d\n", i); + cpuid = per_cpu(cpu_data, i).cpuid; +#else + cpuid = read_cpuid_id(); #endif - } - /* dump out the processor features */ - seq_puts(m, "Features\t: "); + /* dump out the processor features */ + seq_puts(m, "Features\t: "); - for (i = 0; hwcap_str[i]; i++) - if (elf_hwcap & (1 << i)) - seq_printf(m, "%s ", hwcap_str[i]); + for (i = 0; hwcap_str[i]; i++) + if (elf_hwcap & (1 << i)) + seq_printf(m, "%s ", hwcap_str[i]); - seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24); - seq_printf(m, "CPU architecture: AArch64\n"); - seq_printf(m, "CPU variant\t: 0x%x\n", (read_cpuid_id() >> 20) & 15); - seq_printf(m, "CPU part\t: 0x%03x\n", (read_cpuid_id() >> 4) & 0xfff); - seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15); - - seq_puts(m, "\n"); + seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24); + seq_printf(m, "CPU architecture: AArch64\n"); + seq_printf(m, "CPU variant\t: 0x%x\n", (cpuid >> 20) & 15); + seq_printf(m, "CPU part\t: 0x%03x\n", (cpuid >> 4) & 0xfff); + seq_printf(m, "CPU revision\t: %d\n\n", cpuid & 15); + } seq_printf(m, "Hardware\t: %s\n", machine_name);