]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
xtensa: define update_mmu_tlb function
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 3 Jan 2022 20:08:31 +0000 (12:08 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:56:49 +0000 (11:56 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
commit 1c4664faa38923330d478f046dc743a00c1e2dec upstream.

Before the commit f9ce0be71d1f ("mm: Cleanup faultaround and finish_fault()
codepaths") there was a call to update_mmu_cache in alloc_set_pte that
used to invalidate TLB entry caching invalid PTE that caused a page
fault. That commit removed that call so now invalid TLB entry survives
causing repetitive page faults on the CPU that took the initial fault
until that TLB entry is occasionally evicted. This issue is spotted by
the xtensa TLB sanity checker.

Fix this issue by defining update_mmu_tlb function that flushes TLB entry
for the faulting address.

Cc: stable@vger.kernel.org # 5.12+
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e28bace5e7dca163451d93082ed5a57b8b52c017)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/xtensa/include/asm/pgtable.h
arch/xtensa/mm/tlb.c

index bd5aeb795567512da4463325cc3a093e1e735a51..a63eca1266577eefb6fde239dff1358a16c5dfa6 100644 (file)
@@ -411,6 +411,10 @@ extern  void update_mmu_cache(struct vm_area_struct * vma,
 
 typedef pte_t *pte_addr_t;
 
+void update_mmu_tlb(struct vm_area_struct *vma,
+                   unsigned long address, pte_t *ptep);
+#define __HAVE_ARCH_UPDATE_MMU_TLB
+
 #endif /* !defined (__ASSEMBLY__) */
 
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
index f436cf2efd8b7aa2213d7c2e73496b41ba6d4e3d..27a477dae2322d91aa20a5aba7b7562e03d3f91b 100644 (file)
@@ -162,6 +162,12 @@ void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
        }
 }
 
+void update_mmu_tlb(struct vm_area_struct *vma,
+                   unsigned long address, pte_t *ptep)
+{
+       local_flush_tlb_page(vma, address);
+}
+
 #ifdef CONFIG_DEBUG_TLB_SANITY
 
 static unsigned get_pte_for_vaddr(unsigned vaddr)