diff options
| author | Catalin Marinas <catalin.marinas@arm.com> | 2016-11-03 14:34:34 -0400 |
|---|---|---|
| committer | Will Deacon <will.deacon@arm.com> | 2016-11-05 16:59:06 -0400 |
| commit | 272d01bd790fdf3f1b16372fe28136e27756756f (patch) | |
| tree | f55d134f721d4b4f97b563cfbeb0fcc208dad2e4 | |
| parent | a909d3e636995ba7c349e2ca5dbb528154d4ac30 (diff) | |
arm64: Fix circular include of asm/lse.h through linux/jump_label.h
Commit efd9e03facd0 ("arm64: Use static keys for CPU features")
introduced support for static keys in asm/cpufeature.h, including
linux/jump_label.h. When CC_HAVE_ASM_GOTO is not defined, this causes a
circular dependency via linux/atomic.h, asm/lse.h and asm/cpufeature.h.
This patch moves the capability macros out out of asm/cpufeature.h into
a separate asm/cpucaps.h and modifies some of the #includes accordingly.
Fixes: efd9e03facd0 ("arm64: Use static keys for CPU features")
Reported-by: Artem Savkov <asavkov@redhat.com>
Tested-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
| -rw-r--r-- | arch/arm64/include/asm/alternative.h | 2 | ||||
| -rw-r--r-- | arch/arm64/include/asm/cpucaps.h | 40 | ||||
| -rw-r--r-- | arch/arm64/include/asm/cpufeature.h | 20 | ||||
| -rw-r--r-- | arch/arm64/include/asm/lse.h | 1 |
4 files changed, 42 insertions, 21 deletions
diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h index 39feb85a6931..6e1cb8c5af4d 100644 --- a/arch/arm64/include/asm/alternative.h +++ b/arch/arm64/include/asm/alternative.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef __ASM_ALTERNATIVE_H | 1 | #ifndef __ASM_ALTERNATIVE_H |
| 2 | #define __ASM_ALTERNATIVE_H | 2 | #define __ASM_ALTERNATIVE_H |
| 3 | 3 | ||
| 4 | #include <asm/cpufeature.h> | 4 | #include <asm/cpucaps.h> |
| 5 | #include <asm/insn.h> | 5 | #include <asm/insn.h> |
| 6 | 6 | ||
| 7 | #ifndef __ASSEMBLY__ | 7 | #ifndef __ASSEMBLY__ |
diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h new file mode 100644 index 000000000000..87b446535185 --- /dev/null +++ b/arch/arm64/include/asm/cpucaps.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm64/include/asm/cpucaps.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2016 ARM Ltd. | ||
| 5 | * | ||
| 6 | * This program is free software: you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | #ifndef __ASM_CPUCAPS_H | ||
| 19 | #define __ASM_CPUCAPS_H | ||
| 20 | |||
| 21 | #define ARM64_WORKAROUND_CLEAN_CACHE 0 | ||
| 22 | #define ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE 1 | ||
| 23 | #define ARM64_WORKAROUND_845719 2 | ||
| 24 | #define ARM64_HAS_SYSREG_GIC_CPUIF 3 | ||
| 25 | #define ARM64_HAS_PAN 4 | ||
| 26 | #define ARM64_HAS_LSE_ATOMICS 5 | ||
| 27 | #define ARM64_WORKAROUND_CAVIUM_23154 6 | ||
| 28 | #define ARM64_WORKAROUND_834220 7 | ||
| 29 | #define ARM64_HAS_NO_HW_PREFETCH 8 | ||
| 30 | #define ARM64_HAS_UAO 9 | ||
| 31 | #define ARM64_ALT_PAN_NOT_UAO 10 | ||
| 32 | #define ARM64_HAS_VIRT_HOST_EXTN 11 | ||
| 33 | #define ARM64_WORKAROUND_CAVIUM_27456 12 | ||
| 34 | #define ARM64_HAS_32BIT_EL0 13 | ||
| 35 | #define ARM64_HYP_OFFSET_LOW 14 | ||
| 36 | #define ARM64_MISMATCHED_CACHE_LINE_SIZE 15 | ||
| 37 | |||
| 38 | #define ARM64_NCAPS 16 | ||
| 39 | |||
| 40 | #endif /* __ASM_CPUCAPS_H */ | ||
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index a27c3245ba21..0bc0b1de90c4 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/jump_label.h> | 12 | #include <linux/jump_label.h> |
| 13 | 13 | ||
| 14 | #include <asm/cpucaps.h> | ||
| 14 | #include <asm/hwcap.h> | 15 | #include <asm/hwcap.h> |
| 15 | #include <asm/sysreg.h> | 16 | #include <asm/sysreg.h> |
| 16 | 17 | ||
| @@ -24,25 +25,6 @@ | |||
| 24 | #define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap)) | 25 | #define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap)) |
| 25 | #define cpu_feature(x) ilog2(HWCAP_ ## x) | 26 | #define cpu_feature(x) ilog2(HWCAP_ ## x) |
| 26 | 27 | ||
| 27 | #define ARM64_WORKAROUND_CLEAN_CACHE 0 | ||
| 28 | #define ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE 1 | ||
| 29 | #define ARM64_WORKAROUND_845719 2 | ||
| 30 | #define ARM64_HAS_SYSREG_GIC_CPUIF 3 | ||
| 31 | #define ARM64_HAS_PAN 4 | ||
| 32 | #define ARM64_HAS_LSE_ATOMICS 5 | ||
| 33 | #define ARM64_WORKAROUND_CAVIUM_23154 6 | ||
| 34 | #define ARM64_WORKAROUND_834220 7 | ||
| 35 | #define ARM64_HAS_NO_HW_PREFETCH 8 | ||
| 36 | #define ARM64_HAS_UAO 9 | ||
| 37 | #define ARM64_ALT_PAN_NOT_UAO 10 | ||
| 38 | #define ARM64_HAS_VIRT_HOST_EXTN 11 | ||
| 39 | #define ARM64_WORKAROUND_CAVIUM_27456 12 | ||
| 40 | #define ARM64_HAS_32BIT_EL0 13 | ||
| 41 | #define ARM64_HYP_OFFSET_LOW 14 | ||
| 42 | #define ARM64_MISMATCHED_CACHE_LINE_SIZE 15 | ||
| 43 | |||
| 44 | #define ARM64_NCAPS 16 | ||
| 45 | |||
| 46 | #ifndef __ASSEMBLY__ | 28 | #ifndef __ASSEMBLY__ |
| 47 | 29 | ||
| 48 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h index 23acc00be32d..fc756e22c84c 100644 --- a/arch/arm64/include/asm/lse.h +++ b/arch/arm64/include/asm/lse.h | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/stringify.h> | 6 | #include <linux/stringify.h> |
| 7 | #include <asm/alternative.h> | 7 | #include <asm/alternative.h> |
| 8 | #include <asm/cpufeature.h> | ||
| 9 | 8 | ||
| 10 | #ifdef __ASSEMBLER__ | 9 | #ifdef __ASSEMBLER__ |
| 11 | 10 | ||
