From patchwork Tue Jan 28 01:23:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Van Brunt X-Patchwork-Id: 3544791 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 311AA9F382 for ; Tue, 28 Jan 2014 01:26:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5941320121 for ; Tue, 28 Jan 2014 01:26:15 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 1C5C62011E for ; Tue, 28 Jan 2014 01:26:14 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7xRJ-00087G-Nd; Tue, 28 Jan 2014 01:26:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7xRH-0007ig-EE; Tue, 28 Jan 2014 01:26:07 +0000 Received: from hqemgate16.nvidia.com ([216.228.121.65]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7xRE-0007iL-98 for linux-arm-kernel@lists.infradead.org; Tue, 28 Jan 2014 01:26:05 +0000 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Mon, 27 Jan 2014 17:26:13 -0800 Received: from hqemhub03.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Mon, 27 Jan 2014 17:24:24 -0800 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Mon, 27 Jan 2014 17:24:24 -0800 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQEMHUB03.nvidia.com (172.20.150.15) with Microsoft SMTP Server id 8.3.327.1; Mon, 27 Jan 2014 17:25:38 -0800 Received: from thelma.nvidia.com (Not Verified[172.16.212.77]) by hqnvemgw02.nvidia.com with MailMarshal (v7,1,2,5326) id ; Mon, 27 Jan 2014 17:25:37 -0800 Received: from dhcp-172-17-186-74.nvidia.com (dhcp-172-17-186-74.nvidia.com [172.17.186.74]) by thelma.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id s0S1PYuJ012307; Mon, 27 Jan 2014 17:25:35 -0800 (PST) Date: Mon, 27 Jan 2014 17:23:41 -0800 From: Alex Van Brunt X-X-Sender: avanbrunt@avanbrunt-dt To: Will Deacon , Catalin Marinas , Linux ARM Kernel Subject: [PATCH] arm64: setup: report non-optional CPU features Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) X-NVConfidentiality: public MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140127_202604_399537_C7292D12 X-CRM114-Status: GOOD ( 14.87 ) X-Spam-Score: -2.4 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 There are a large number of popular applications compiled for ARMv7-A that read /proc/cpuinfo to find out what features the CPU has. But, when they are run on an arm64 kernel, they fail to run. This is because features that were optional on ARMv7 or earlier but are not optional on ARMv8-A like Thumb are not listed as a CPU feature using the arm64 kernel. To make those applications run, the kernel still needs to print the features in the list. This patch changes "cat /proc/cpuinfo" from printing: Features : fp asimd To printing: Features : fp asimd wp half thumb fastmult vfp edsp neon vfpv3d16 tlsi vfpv4 idiva idivt Subject: [PATCH] arm64: setup: report non-optional CPU features Many ARM applications read the CPU features list provided by the kernel in /proc/cpuinfo to determine which features to use. If a feature is not listed, the application with either run slower or will not run at all. CPU features that are no longer optional in ARMv8-A, but were optional in previous architectures still need to be printed. To achieve this, always report these features. Change-Id: I0a8092ee07926ae5410d7863a270a76fa224297d Signed-off-by: Alex Van Brunt --- arch/arm64/kernel/setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index bd9bbd0..7f8e9bd 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -302,6 +302,8 @@ static int c_show(struct seq_file *m, void *v) for (i = 0; hwcap_str[i]; i++) if (elf_hwcap & (1 << i)) seq_printf(m, "%s ", hwcap_str[i]); + /* Print non-optional features in ARMv8 */ + seq_printf(m, "half thumb fastmult vfp neon vfpv3 vfpv4 idiva"); seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24); seq_printf(m, "CPU architecture: AArch64\n");