Re: [PATCH v4 1/3] arm64: cpufeature: introduce helper cpu_has_hw_af()
From: Matthew Wilcox <willy@infradead.org>
Date: 2019-09-18 14:20:23
Also in:
linux-mm, lkml
From: Matthew Wilcox <willy@infradead.org>
Date: 2019-09-18 14:20:23
Also in:
linux-mm, lkml
On Wed, Sep 18, 2019 at 09:19:12PM +0800, Jia He wrote:
+/* Decouple AF from AFDBM. */
+bool cpu_has_hw_af(void)
+{
+ return (read_cpuid(ID_AA64MMFR1_EL1) & 0xf);
+}
+Do you really want to call read_cpuid() every time? I would have thought you'd want to use the static branch mechanism to do the right thing at boot time. See Documentation/static-keys.txt. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel