Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1218864
| From | "Suzuki K. Poulose" <Suzuki.Poulose@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/3] arm64/cpufeature.h: Add macros for a cpu features testing |
| Date | 2015-09-04 14:10 +0200 |
| Message-ID | <q4XYB-1B9-1@gated-at.bofh.it> (permalink) |
| References | <q4Hh8-2W4-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 03/09/15 19:11, Alexander Kuleshov wrote: > This patch provides a couple of macros for the testing of processor > features (crypto and FP/SIMD) like support of SHA1, AES instructions, > support for FPU and etc. There is already a couple of places in the > arch/arm64/kernel where these processor features are tested and these > macros are facilitate this. > > Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> > --- > arch/arm64/include/asm/cpufeature.h | 44 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > index c104421..2919455 100644 > --- a/arch/arm64/include/asm/cpufeature.h > +++ b/arch/arm64/include/asm/cpufeature.h > @@ -28,7 +28,50 @@ > > #define ARM64_NCAPS 4 > > +/* > + * ID_AA64ISAR0_EL1 AES, bits [7:4] > + */ > +#define ID_AA64ISAR0_EL1_AES_MASK 4 > +#define ID_AA64ISAR0_EL1_AES(feature) \ > + (((feature >> ID_AA64ISAR0_EL1_AES_MASK) & 0xf) & 1UL) > +#define ID_AA64ISAR0_EL1_PMULL(feature) \ > + (((feature >> ID_AA64ISAR0_EL1_AES_MASK) & 0xf) & 2UL) > + There is generic CPUID feature helper queued for 4.3, which can extract the feature bits cpuid_feature_extract_field(feature, shift) You might want to use it instead. Btw, I have a patch series(waiting for the merge window, before I post), which changes the way we initialise the HWCAP bits. Thanks Suzuki -- 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/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/3] arm64/cpufeature.h: Add macros for a cpu features testing Alexander Kuleshov <kuleshovmail@gmail.com> - 2015-09-03 20:20 +0200
[PATCH 3/3] arm64/fpsimd: Use ID_AA64PFR0_EL1_.* macros Alexander Kuleshov <kuleshovmail@gmail.com> - 2015-09-03 20:20 +0200
[PATCH 2/3] arm64/setup: Use ID_AA64ISAR0_EL1_.* macros Alexander Kuleshov <kuleshovmail@gmail.com> - 2015-09-03 20:20 +0200
Re: [PATCH 2/3] arm64/setup: Use ID_AA64ISAR0_EL1_.* macros Catalin Marinas <catalin.marinas@arm.com> - 2015-09-04 13:30 +0200
Re: [PATCH 1/3] arm64/cpufeature.h: Add macros for a cpu features testing Catalin Marinas <catalin.marinas@arm.com> - 2015-09-04 13:30 +0200
Re: [PATCH 1/3] arm64/cpufeature.h: Add macros for a cpu features testing "Suzuki K. Poulose" <Suzuki.Poulose@arm.com> - 2015-09-04 14:10 +0200
Re: [PATCH 1/3] arm64/cpufeature.h: Add macros for a cpu features testing Alexander Kuleshov <kuleshovmail@gmail.com> - 2015-09-04 14:20 +0200
csiph-web