]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
arm64: cache: Remove support for ASID-tagged VIVT I-caches
authorWill Deacon <will.deacon@arm.com>
Fri, 10 Mar 2017 20:32:22 +0000 (20:32 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 20 Mar 2017 16:16:57 +0000 (16:16 +0000)
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 <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/cachetype.h
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuinfo.c
arch/arm64/mm/context.c
arch/arm64/mm/flush.c

index 212a0f3d4ecbeff6d178eed6dd68a07b844930d0..fbab37c669a0a751b7a039c832e28c51b1e3e10e 100644 (file)
@@ -23,8 +23,6 @@
 #define CTR_CWG_SHIFT          24
 #define CTR_CWG_MASK           15
 
-#define ICACHE_POLICY_RESERVED 0
-#define ICACHE_POLICY_AIVIVT   1
 #define ICACHE_POLICY_VIPT     2
 #define ICACHE_POLICY_PIPT     3
 
@@ -35,7 +33,6 @@
 #define CTR_L1IP(ctr)  (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK)
 
 #define ICACHEF_ALIASING       0
-#define ICACHEF_AIVIVT         1
 
 extern unsigned long __icache_flags;
 
@@ -48,11 +45,6 @@ static inline int icache_is_aliasing(void)
        return test_bit(ICACHEF_ALIASING, &__icache_flags);
 }
 
-static inline int icache_is_aivivt(void)
-{
-       return test_bit(ICACHEF_AIVIVT, &__icache_flags);
-}
-
 static inline u32 cache_type_cwg(void)
 {
        return (read_cpuid_cachetype() >> CTR_CWG_SHIFT) & CTR_CWG_MASK;
index ed1246014901d00072a9a2568a53202ee79e7cf8..4be5773d46060fbe155522f2a86ce8a65381391c 100644 (file)
@@ -245,7 +245,7 @@ static inline void __coherent_cache_guest_page(struct kvm_vcpu *vcpu,
        if (!icache_is_aliasing()) {            /* PIPT */
                flush_icache_range((unsigned long)va,
                                   (unsigned long)va + size);
-       } else if (!icache_is_aivivt()) {       /* non ASID-tagged VIVT */
+       } else {
                /* any kind of VIPT cache */
                __flush_icache_all();
        }
index abda8e861865779d96087b3de57d60305d26e582..073a6c641730c67068f2265e9fe47b2250acadeb 100644 (file)
@@ -153,9 +153,9 @@ static const struct arm64_ftr_bits ftr_ctr[] = {
        /*
         * Linux can handle differing I-cache policies. Userspace JITs will
         * make use of *minLine.
-        * If we have differing I-cache policies, report it as the weakest - AIVIVT.
+        * If we have differing I-cache policies, report it as the weakest - VIPT.
         */
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, 14, 2, ICACHE_POLICY_AIVIVT),     /* L1Ip */
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, 14, 2, ICACHE_POLICY_VIPT),       /* L1Ip */
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 0, 4, 0),       /* IminLine */
        ARM64_FTR_END,
 };
index 155ddd8ad56a02b8255204747d8d74fb8ab82464..efe74ecc9738ec5534b40d9780139852c55558aa 100644 (file)
@@ -43,10 +43,9 @@ DEFINE_PER_CPU(struct cpuinfo_arm64, cpu_data);
 static struct cpuinfo_arm64 boot_cpu_data;
 
 static char *icache_policy_str[] = {
-       [ICACHE_POLICY_RESERVED] = "RESERVED/UNKNOWN",
-       [ICACHE_POLICY_AIVIVT] = "AIVIVT",
-       [ICACHE_POLICY_VIPT] = "VIPT",
-       [ICACHE_POLICY_PIPT] = "PIPT",
+       [0 ... ICACHE_POLICY_PIPT]      = "RESERVED/UNKNOWN",
+       [ICACHE_POLICY_VIPT]            = "VIPT",
+       [ICACHE_POLICY_PIPT]            = "PIPT",
 };
 
 unsigned long __icache_flags;
@@ -293,8 +292,6 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)
        case ICACHE_POLICY_PIPT:
                break;
        default:
-       case ICACHE_POLICY_AIVIVT:
-               set_bit(ICACHEF_AIVIVT, &__icache_flags);
                /* Fallthrough */
        case ICACHE_POLICY_VIPT:
                /* Assume aliasing */
index 68634c630cddc04d72d30ecf3551d0a0c471bb53..ab9f5f0fb2c7fc6ada0605e31d8f73b0024ae277 100644 (file)
@@ -119,9 +119,6 @@ static void flush_context(unsigned int cpu)
 
        /* Queue a TLB invalidate and flush the I-cache if necessary. */
        cpumask_setall(&tlb_flush_pending);
-
-       if (icache_is_aivivt())
-               __flush_icache_all();
 }
 
 static bool check_update_reserved_asid(u64 asid, u64 newasid)
index 554a2558c12e4e313b2827bf9b29779f9d4f4957..1e968222a54410940ffa286f95d54cc77351c1c8 100644 (file)
@@ -65,8 +65,6 @@ void __sync_icache_dcache(pte_t pte, unsigned long addr)
        if (!test_and_set_bit(PG_dcache_clean, &page->flags))
                sync_icache_aliases(page_address(page),
                                    PAGE_SIZE << compound_order(page));
-       else if (icache_is_aivivt())
-               __flush_icache_all();
 }
 
 /*