Merge tag 'linux-kselftest-kunit-5.15-rc1' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-microblaze.git] / arch / arm64 / include / asm / tlbflush.h
index cc3f5a3..412a3b9 100644 (file)
@@ -245,9 +245,10 @@ static inline void flush_tlb_all(void)
 
 static inline void flush_tlb_mm(struct mm_struct *mm)
 {
-       unsigned long asid = __TLBI_VADDR(0, ASID(mm));
+       unsigned long asid;
 
        dsb(ishst);
+       asid = __TLBI_VADDR(0, ASID(mm));
        __tlbi(aside1is, asid);
        __tlbi_user(aside1is, asid);
        dsb(ish);
@@ -256,9 +257,10 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 static inline void flush_tlb_page_nosync(struct vm_area_struct *vma,
                                         unsigned long uaddr)
 {
-       unsigned long addr = __TLBI_VADDR(uaddr, ASID(vma->vm_mm));
+       unsigned long addr;
 
        dsb(ishst);
+       addr = __TLBI_VADDR(uaddr, ASID(vma->vm_mm));
        __tlbi(vale1is, addr);
        __tlbi_user(vale1is, addr);
 }
@@ -283,9 +285,7 @@ static inline void __flush_tlb_range(struct vm_area_struct *vma,
 {
        int num = 0;
        int scale = 0;
-       unsigned long asid = ASID(vma->vm_mm);
-       unsigned long addr;
-       unsigned long pages;
+       unsigned long asid, addr, pages;
 
        start = round_down(start, stride);
        end = round_up(end, stride);
@@ -305,10 +305,11 @@ static inline void __flush_tlb_range(struct vm_area_struct *vma,
        }
 
        dsb(ishst);
+       asid = ASID(vma->vm_mm);
 
        /*
         * When the CPU does not support TLB range operations, flush the TLB
-        * entries one by one at the granularity of 'stride'. If the the TLB
+        * entries one by one at the granularity of 'stride'. If the TLB
         * range ops are supported, then:
         *
         * 1. If 'pages' is odd, flush the first page through non-range