From: Greg Kroah-Hartman Date: Thu, 20 Apr 2017 19:53:15 +0000 (+0200) Subject: delete queue-3.18/mips-flush-wrong-invalid-ftlb-entry-for-huge-page.patch X-Git-Tag: v4.4.63~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04ae8480548afda0d46e6edd6ed7d41eb2e115fc;p=thirdparty%2Fkernel%2Fstable-queue.git delete queue-3.18/mips-flush-wrong-invalid-ftlb-entry-for-huge-page.patch --- diff --git a/queue-3.18/mips-flush-wrong-invalid-ftlb-entry-for-huge-page.patch b/queue-3.18/mips-flush-wrong-invalid-ftlb-entry-for-huge-page.patch deleted file mode 100644 index 3220a15a67b..00000000000 --- a/queue-3.18/mips-flush-wrong-invalid-ftlb-entry-for-huge-page.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 0115f6cbf26663c86496bc56eeea293f85b77897 Mon Sep 17 00:00:00 2001 -From: Huacai Chen -Date: Thu, 16 Mar 2017 21:00:27 +0800 -Subject: MIPS: Flush wrong invalid FTLB entry for huge page - -From: Huacai Chen - -commit 0115f6cbf26663c86496bc56eeea293f85b77897 upstream. - -On VTLB+FTLB platforms (such as Loongson-3A R2), FTLB's pagesize is -usually configured the same as PAGE_SIZE. In such a case, Huge page -entry is not suitable to write in FTLB. - -Unfortunately, when a huge page is created, its page table entries -haven't created immediately. Then the TLB refill handler will fetch an -invalid page table entry which has no "HUGE" bit, and this entry may be -written to FTLB. Since it is invalid, TLB load/store handler will then -use tlbwi to write the valid entry at the same place. However, the -valid entry is a huge page entry which isn't suitable for FTLB. - -Our solution is to modify build_huge_handler_tail. Flush the invalid -old entry (whether it is in FTLB or VTLB, this is in order to reduce -branches) and use tlbwr to write the valid new entry. - -Signed-off-by: Rui Wang -Signed-off-by: Huacai Chen -Cc: John Crispin -Cc: Steven J . Hill -Cc: Fuxin Zhang -Cc: Zhangjin Wu -Cc: Huacai Chen -Cc: linux-mips@linux-mips.org -Patchwork: https://patchwork.linux-mips.org/patch/15754/ -Signed-off-by: Ralf Baechle -Signed-off-by: Greg Kroah-Hartman - ---- - arch/mips/mm/tlbex.c | 25 +++++++++++++++++++++---- - 1 file changed, 21 insertions(+), 4 deletions(-) - ---- a/arch/mips/mm/tlbex.c -+++ b/arch/mips/mm/tlbex.c -@@ -754,7 +754,8 @@ static void build_huge_update_entries(u3 - static void build_huge_handler_tail(u32 **p, struct uasm_reloc **r, - struct uasm_label **l, - unsigned int pte, -- unsigned int ptr) -+ unsigned int ptr, -+ unsigned int flush) - { - #ifdef CONFIG_SMP - UASM_i_SC(p, pte, 0, ptr); -@@ -763,6 +764,22 @@ static void build_huge_handler_tail(u32 - #else - UASM_i_SW(p, pte, 0, ptr); - #endif -+ if (cpu_has_ftlb && flush) { -+ BUG_ON(!cpu_has_tlbinv); -+ -+ UASM_i_MFC0(p, ptr, C0_ENTRYHI); -+ uasm_i_ori(p, ptr, ptr, MIPS_ENTRYHI_EHINV); -+ UASM_i_MTC0(p, ptr, C0_ENTRYHI); -+ build_tlb_write_entry(p, l, r, tlb_indexed); -+ -+ uasm_i_xori(p, ptr, ptr, MIPS_ENTRYHI_EHINV); -+ UASM_i_MTC0(p, ptr, C0_ENTRYHI); -+ build_huge_update_entries(p, pte, ptr); -+ build_huge_tlb_write_entry(p, l, r, pte, tlb_random, 0); -+ -+ return; -+ } -+ - build_huge_update_entries(p, pte, ptr); - build_huge_tlb_write_entry(p, l, r, pte, tlb_indexed, 0); - } -@@ -2061,7 +2078,7 @@ static void build_r4000_tlb_load_handler - uasm_l_tlbl_goaround2(&l, p); - } - uasm_i_ori(&p, wr.r1, wr.r1, (_PAGE_ACCESSED | _PAGE_VALID)); -- build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2); -+ build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2, 1); - #endif - - uasm_l_nopage_tlbl(&l, p); -@@ -2116,7 +2133,7 @@ static void build_r4000_tlb_store_handle - build_tlb_probe_entry(&p); - uasm_i_ori(&p, wr.r1, wr.r1, - _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY); -- build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2); -+ build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2, 1); - #endif - - uasm_l_nopage_tlbs(&l, p); -@@ -2172,7 +2189,7 @@ static void build_r4000_tlb_modify_handl - build_tlb_probe_entry(&p); - uasm_i_ori(&p, wr.r1, wr.r1, - _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY); -- build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2); -+ build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2, 0); - #endif - - uasm_l_nopage_tlbm(&l, p); diff --git a/queue-3.18/series b/queue-3.18/series index 45e402fb218..bdb35e129cc 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -113,7 +113,6 @@ mm-hugetlb-use-pte_present-instead-of-pmd_present-in-follow_huge_pmd.patch mtd-bcm47xxpart-fix-parsing-first-block-after-aligned-trx.patch mm-mempolicy.c-fix-error-handling-in-set_mempolicy-and-mbind.patch ring-buffer-fix-return-value-check-in-test_ringbuffer.patch -mips-flush-wrong-invalid-ftlb-entry-for-huge-page.patch metag-usercopy-drop-unused-macros.patch metag-usercopy-fix-alignment-error-checking.patch metag-usercopy-add-early-abort-to-copy_to_user.patch