diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2014-08-08 07:51:40 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2014-09-08 09:39:18 -0400 |
commit | 169c018de7b6d376f821f9fae0ab23dc5c7bb549 (patch) | |
tree | 8c008b183e64a8512268405fb8fd85a74a26b932 /arch/arm64/kernel/cpuinfo.c | |
parent | 80c517b0ff71a4c874fed9196fd990d2d9e911f3 (diff) |
arm64: don't flag non-aliasing VIPT I-caches as aliasing
VIPT caches are non-aliasing if the index is derived from address bits that
are always equal between VA and PA. Classifying these as aliasing results in
unnecessary flushing which may hurt performance.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/cpuinfo.c')
-rw-r--r-- | arch/arm64/kernel/cpuinfo.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index d8c5a59a5687..504fdaa8367e 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c | |||
@@ -49,8 +49,18 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info) | |||
49 | unsigned int cpu = smp_processor_id(); | 49 | unsigned int cpu = smp_processor_id(); |
50 | u32 l1ip = CTR_L1IP(info->reg_ctr); | 50 | u32 l1ip = CTR_L1IP(info->reg_ctr); |
51 | 51 | ||
52 | if (l1ip != ICACHE_POLICY_PIPT) | 52 | if (l1ip != ICACHE_POLICY_PIPT) { |
53 | set_bit(ICACHEF_ALIASING, &__icache_flags); | 53 | /* |
54 | * VIPT caches are non-aliasing if the VA always equals the PA | ||
55 | * in all bit positions that are covered by the index. This is | ||
56 | * the case if the size of a way (# of sets * line size) does | ||
57 | * not exceed PAGE_SIZE. | ||
58 | */ | ||
59 | u32 waysize = icache_get_numsets() * icache_get_linesize(); | ||
60 | |||
61 | if (l1ip != ICACHE_POLICY_VIPT || waysize > PAGE_SIZE) | ||
62 | set_bit(ICACHEF_ALIASING, &__icache_flags); | ||
63 | } | ||
54 | if (l1ip == ICACHE_POLICY_AIVIVT) | 64 | if (l1ip == ICACHE_POLICY_AIVIVT) |
55 | set_bit(ICACHEF_AIVIVT, &__icache_flags); | 65 | set_bit(ICACHEF_AIVIVT, &__icache_flags); |
56 | 66 | ||