aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuzuki K Poulose <suzuki.poulose@arm.com>2016-09-09 09:07:08 -0400
committerWill Deacon <will.deacon@arm.com>2016-09-09 10:03:28 -0400
commitee7bc638f140e0586941002ffb82765743dabb97 (patch)
tree8c2f588bd8e6b24ab99196a8bd1f4eecfab83621
parent7ba5f605f3a0d9495aad539eeb8346d726dfc183 (diff)
arm64: Set the safe value for L1 icache policy
Right now we use 0 as the safe value for CTR_EL0:L1Ip, which is not defined at the moment. The safer value for the L1Ip should be the weakest of the policies, which happens to be AIVIVT. While at it, fix the comment about safe_val. Cc: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm64/include/asm/cpufeature.h2
-rw-r--r--arch/arm64/kernel/cpufeature.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
index 23a76dc5a6cf..bd950b00a575 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@ -65,7 +65,7 @@ struct arm64_ftr_bits {
65 enum ftr_type type; 65 enum ftr_type type;
66 u8 shift; 66 u8 shift;
67 u8 width; 67 u8 width;
68 s64 safe_val; /* safe value for discrete features */ 68 s64 safe_val; /* safe value for FTR_EXACT features */
69}; 69};
70 70
71/* 71/*
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 9128ced913e7..acd374e2d5d8 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -150,9 +150,10 @@ static const struct arm64_ftr_bits ftr_ctr[] = {
150 ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 1), /* DminLine */ 150 ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 1), /* DminLine */
151 /* 151 /*
152 * Linux can handle differing I-cache policies. Userspace JITs will 152 * Linux can handle differing I-cache policies. Userspace JITs will
153 * make use of *minLine 153 * make use of *minLine.
154 * If we have differing I-cache policies, report it as the weakest - AIVIVT.
154 */ 155 */
155 ARM64_FTR_BITS(FTR_NONSTRICT, FTR_EXACT, 14, 2, 0), /* L1Ip */ 156 ARM64_FTR_BITS(FTR_NONSTRICT, FTR_EXACT, 14, 2, ICACHE_POLICY_AIVIVT), /* L1Ip */
156 ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 4, 10, 0), /* RAZ */ 157 ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 4, 10, 0), /* RAZ */
157 ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, 0, 4, 0), /* IminLine */ 158 ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, 0, 4, 0), /* IminLine */
158 ARM64_FTR_END, 159 ARM64_FTR_END,