Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760381AbbKUXWB (ORCPT ); Sat, 21 Nov 2015 18:22:01 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:56811 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752280AbbKUXV7 convert rfc822-to-8bit (ORCPT ); Sat, 21 Nov 2015 18:21:59 -0500 From: Arnd Bergmann To: =?ISO-8859-1?Q?M=E5ns_Rullg=E5rd?= Cc: linux-arm-kernel@lists.infradead.org, Stephen Boyd , linux-arm-msm@vger.kernel.org, Steven Rostedt , linux-kernel@vger.kernel.org, Nicolas Pitre Subject: Re: [RFC/PATCH 0/3] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions Date: Sun, 22 Nov 2015 00:21:13 +0100 Message-ID: <12750898.0A5czJmNqv@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <4519802.lamVCN5F0B@wuerfel> References: <1448068997-26631-1-git-send-email-sboyd@codeaurora.org> <4519802.lamVCN5F0B@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" X-Provags-ID: V03:K0:/QHSZtQpAltLi5IbjMu7w74Aq/zEKaSMZWQz5DHt7/uVRCdSBpc DOgD6wLBgiuLWU1DSaWU3v4ZQ5k02aYjjwwiGea+G0Uu9dwCDYCkhtOXQEgjsfWUZtqiNMx sCzSKJwxGL3n8I/ioRt4PVLBSxpHxPWEsydPSYCmU4EK4BwgQHvecY8JhEvwB+kaJWHT2F1 QHAKvudmjhsHNYamrGFUg== X-UI-Out-Filterresults: notjunk:1;V01:K0:Xj1BbFBZxyE=:ikgwcA0oEDa8grv/GN+HGX zY4eSwzYJH8kAnvxM2wt1NBDcSL4kz6om5+l6Ku28al7OJcsvYJdRf1WhtqmqBNw4IPdRFPmi 14Ix/zXmIj3gaAnnO95VtYvvjcEl0SvIHrtnzbVkP+w2dDNDVXI1tkcyC/iOAfkmZi0D2pOqt U24x8yhZkDARzpNu8Ufx8BzCZ6HUh1Z/FojqaNi7ivdjNsuOEKBD62XsKAlCqCMF4x74n+e4d YngzEkAqHwzszyCaRUAsDP8DA4EhZq/1pbVqwztdMvIwFrYY5PIMKDwrakR07HDWgHsStOH1D 8/dB4CRM2OCSMI4jNfLHBpKMFp58nPHdzVDMM23GZXffNEDeo296L31KC+pCTetNleltwa04D Lt2wA+HilD3zAx3Er/+j1PS9Z9MTKKprpXsjyh8qXGv7pMHoqXPLytkO9sWg9ImnZhN10Df8y 7bXH52rbPJt8Z3uqCGmuNAxrZl+hEfnTsw7tv57poLK4Z5jDtrd3ADPDA2OKMByPTvlHV7Uj1 17tkYIp3HLzY20KbfOs7E0EDmgA/01pcYxG7aD6SqgPY9eK/QvFGN7l8HeI7QoiXJg557U6nk +qGn7PMJI8EKG2NXwG0WAkvy+whIim3skfgERlEgZBb82uJJ24NVs5sHp+HvTkCytfLvg23eR ZcPEvRbb/RyBX4jQ+7gHaRcJwB7SIvLx1sMH81QDyBBm8SJ0mze57bdElAfeJ00z9NpqDpXhZ O1oOqV/BMlkUKAMY Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3363 Lines: 72 On Sunday 22 November 2015 00:14:14 Arnd Bergmann wrote: > On Saturday 21 November 2015 22:11:36 M?ns Rullg?rd wrote: > > Arnd Bergmann writes: > > > On Saturday 21 November 2015 20:45:38 M?ns Rullg?rd wrote: > > >> On 21 November 2015 20:39:58 GMT+00:00, Arnd Bergmann wrote: > > >> > > >> The ARM ARM says anything with virt has idiv, lpae doesn't matter. > > > > > > Ok, and anything with virt also has lpae by definition. The question is > > > whether we care about using idiv on cores that do not have lpae, or that > > > have neither lpae nor virt. > > > > The question is, are there any such cores? GCC doesn't know of any, but > > then it's missing most non-ARM designs. > > Exactly. Stephen should be able to find out about the Qualcomm cores, > and http://comments.gmane.org/gmane.linux.ports.arm.kernel/426289 has > some information about the others: > * Brahma-B15 supports all three. > * Dove (PJ4) reports idiv only in thumb mode, which I'm tempted to ignore > for the kernel, as it supports neither lpae nor idiva. > * Armada 370/XP (PJ4B) reports support for idiva and idivt, but according to > https://groups.google.com/a/dartlang.org/forum/#!topic/reviews/9wvsJvq0YYY > that may be a lie. > * According to the same source, Krait fails to report idiva and idivt, > but supports both anyway. However, I found reports on the web where > /proc/cpuinfo correctly contains the flags on the same SoC (APQ8064) > that was mentioned there, so maybe they were just running an old > kernel. This has some more information: commit 120ecfafabec382c4feb79ff159ef42a39b6d33b Author: Stepan Moskovchenko Date: Mon Mar 18 19:44:16 2013 +0100 ARM: 7678/1: Work around faulty ISAR0 register in some Krait CPUs Some early versions of the Krait CPU design incorrectly indicate that they only support the UDIV and SDIV instructions in Thumb mode when they actually support them in ARM and Thumb mode. It seems that these CPUs follow the DDI0406B ARM ARM which has two possible values for the divide instructions field, instead of the DDI0406C document which has three possible values. Work around this problem by checking the MIDR against Krait CPUs with this faulty ISAR0 register and force the hwcaps to indicate support in both modes. [sboyd: Rewrote commit text to reflect real reasoning now that we autodetect udiv/sdiv] Signed-off-by: Stepan Moskovchenko Acked-by: Will Deacon Signed-off-by: Stephen Boyd Signed-off-by: Russell King so Krait clearly supports them, and this also explains why some machines misreport it depending on the CPU version and kernel release running on it. Regarding PJ4, it's still unclear whether that has the same problem and it only reports idivt when it actually supports idiva, or whether the lack of idiva support on PJ4 is instead the reason why the ARM ARM was updated to have separate flags. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/