Skip to content

Commit 155433c

Browse files
wildea01ctmarinas
authored andcommitted
arm64: cache: Remove support for ASID-tagged VIVT I-caches
As a recent change to ARMv8, ASID-tagged VIVT I-caches are removed retrospectively from the architecture. Consequently, we don't need to support them in Linux either. Acked-by: Mark Rutland <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent a8d4636 commit 155433c

File tree

6 files changed

+6
-22
lines changed

6 files changed

+6
-22
lines changed

arch/arm64/include/asm/cachetype.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#define CTR_CWG_SHIFT 24
2424
#define CTR_CWG_MASK 15
2525

26-
#define ICACHE_POLICY_RESERVED 0
27-
#define ICACHE_POLICY_AIVIVT 1
2826
#define ICACHE_POLICY_VIPT 2
2927
#define ICACHE_POLICY_PIPT 3
3028

@@ -35,7 +33,6 @@
3533
#define CTR_L1IP(ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK)
3634

3735
#define ICACHEF_ALIASING 0
38-
#define ICACHEF_AIVIVT 1
3936

4037
extern unsigned long __icache_flags;
4138

@@ -48,11 +45,6 @@ static inline int icache_is_aliasing(void)
4845
return test_bit(ICACHEF_ALIASING, &__icache_flags);
4946
}
5047

51-
static inline int icache_is_aivivt(void)
52-
{
53-
return test_bit(ICACHEF_AIVIVT, &__icache_flags);
54-
}
55-
5648
static inline u32 cache_type_cwg(void)
5749
{
5850
return (read_cpuid_cachetype() >> CTR_CWG_SHIFT) & CTR_CWG_MASK;

arch/arm64/include/asm/kvm_mmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static inline void __coherent_cache_guest_page(struct kvm_vcpu *vcpu,
245245
if (!icache_is_aliasing()) { /* PIPT */
246246
flush_icache_range((unsigned long)va,
247247
(unsigned long)va + size);
248-
} else if (!icache_is_aivivt()) { /* non ASID-tagged VIVT */
248+
} else {
249249
/* any kind of VIPT cache */
250250
__flush_icache_all();
251251
}

arch/arm64/kernel/cpufeature.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ static const struct arm64_ftr_bits ftr_ctr[] = {
153153
/*
154154
* Linux can handle differing I-cache policies. Userspace JITs will
155155
* make use of *minLine.
156-
* If we have differing I-cache policies, report it as the weakest - AIVIVT.
156+
* If we have differing I-cache policies, report it as the weakest - VIPT.
157157
*/
158-
ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, 14, 2, ICACHE_POLICY_AIVIVT), /* L1Ip */
158+
ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, 14, 2, ICACHE_POLICY_VIPT), /* L1Ip */
159159
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 0, 4, 0), /* IminLine */
160160
ARM64_FTR_END,
161161
};

arch/arm64/kernel/cpuinfo.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ DEFINE_PER_CPU(struct cpuinfo_arm64, cpu_data);
4343
static struct cpuinfo_arm64 boot_cpu_data;
4444

4545
static char *icache_policy_str[] = {
46-
[ICACHE_POLICY_RESERVED] = "RESERVED/UNKNOWN",
47-
[ICACHE_POLICY_AIVIVT] = "AIVIVT",
48-
[ICACHE_POLICY_VIPT] = "VIPT",
49-
[ICACHE_POLICY_PIPT] = "PIPT",
46+
[0 ... ICACHE_POLICY_PIPT] = "RESERVED/UNKNOWN",
47+
[ICACHE_POLICY_VIPT] = "VIPT",
48+
[ICACHE_POLICY_PIPT] = "PIPT",
5049
};
5150

5251
unsigned long __icache_flags;
@@ -293,8 +292,6 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)
293292
case ICACHE_POLICY_PIPT:
294293
break;
295294
default:
296-
case ICACHE_POLICY_AIVIVT:
297-
set_bit(ICACHEF_AIVIVT, &__icache_flags);
298295
/* Fallthrough */
299296
case ICACHE_POLICY_VIPT:
300297
/* Assume aliasing */

arch/arm64/mm/context.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@ static void flush_context(unsigned int cpu)
119119

120120
/* Queue a TLB invalidate and flush the I-cache if necessary. */
121121
cpumask_setall(&tlb_flush_pending);
122-
123-
if (icache_is_aivivt())
124-
__flush_icache_all();
125122
}
126123

127124
static bool check_update_reserved_asid(u64 asid, u64 newasid)

arch/arm64/mm/flush.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ void __sync_icache_dcache(pte_t pte, unsigned long addr)
6565
if (!test_and_set_bit(PG_dcache_clean, &page->flags))
6666
sync_icache_aliases(page_address(page),
6767
PAGE_SIZE << compound_order(page));
68-
else if (icache_is_aivivt())
69-
__flush_icache_all();
7068
}
7169

7270
/*

0 commit comments

Comments
 (0)