diff for duplicates of <15344389188812@kroah.com> diff --git a/a/1.txt b/N1/1.txt index fe4106c..9173b82 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -12,136 +12,3 @@ and it can be found in the queue-4.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@vger.kernel.org> know about it. - - ->From 5e0fb5df2ee871b841f96f9cb6a7f2784e96aa4e Mon Sep 17 00:00:00 2001 -From: Toshi Kani <toshi.kani@hpe.com> -Date: Wed, 27 Jun 2018 08:13:48 -0600 -Subject: x86/mm: Add TLB purge to free pmd/pte page interfaces - -From: Toshi Kani <toshi.kani@hpe.com> - -commit 5e0fb5df2ee871b841f96f9cb6a7f2784e96aa4e upstream. - -ioremap() calls pud_free_pmd_page() / pmd_free_pte_page() when it creates -a pud / pmd map. The following preconditions are met at their entry. - - All pte entries for a target pud/pmd address range have been cleared. - - System-wide TLB purges have been peformed for a target pud/pmd address - range. - -The preconditions assure that there is no stale TLB entry for the range. -Speculation may not cache TLB entries since it requires all levels of page -entries, including ptes, to have P & A-bits set for an associated address. -However, speculation may cache pud/pmd entries (paging-structure caches) -when they have P-bit set. - -Add a system-wide TLB purge (INVLPG) to a single page after clearing -pud/pmd entry's P-bit. - -SDM 4.10.4.1, Operation that Invalidate TLBs and Paging-Structure Caches, -states that: - INVLPG invalidates all paging-structure caches associated with the - current PCID regardless of the liner addresses to which they correspond. - -Fixes: 28ee90fe6048 ("x86/mm: implement free pmd/pte page interfaces") -Signed-off-by: Toshi Kani <toshi.kani@hpe.com> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Cc: mhocko at suse.com -Cc: akpm at linux-foundation.org -Cc: hpa at zytor.com -Cc: cpandya at codeaurora.org -Cc: linux-mm at kvack.org -Cc: linux-arm-kernel at lists.infradead.org -Cc: Joerg Roedel <joro@8bytes.org> -Cc: stable at vger.kernel.org -Cc: Andrew Morton <akpm@linux-foundation.org> -Cc: Michal Hocko <mhocko@suse.com> -Cc: "H. Peter Anvin" <hpa@zytor.com> -Cc: <stable@vger.kernel.org> -Link: https://lkml.kernel.org/r/20180627141348.21777-4-toshi.kani at hpe.com -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> - ---- - arch/x86/mm/pgtable.c | 38 +++++++++++++++++++++++++++++++------- - 1 file changed, 31 insertions(+), 7 deletions(-) - ---- a/arch/x86/mm/pgtable.c -+++ b/arch/x86/mm/pgtable.c -@@ -725,24 +725,44 @@ int pmd_clear_huge(pmd_t *pmd) - * @pud: Pointer to a PUD. - * @addr: Virtual address associated with pud. - * -- * Context: The pud range has been unmaped and TLB purged. -+ * Context: The pud range has been unmapped and TLB purged. - * Return: 1 if clearing the entry succeeded. 0 otherwise. -+ * -+ * NOTE: Callers must allow a single page allocation. - */ - int pud_free_pmd_page(pud_t *pud, unsigned long addr) - { -- pmd_t *pmd; -+ pmd_t *pmd, *pmd_sv; -+ pte_t *pte; - int i; - - if (pud_none(*pud)) - return 1; - - pmd = (pmd_t *)pud_page_vaddr(*pud); -- -- for (i = 0; i < PTRS_PER_PMD; i++) -- if (!pmd_free_pte_page(&pmd[i], addr + (i * PMD_SIZE))) -- return 0; -+ pmd_sv = (pmd_t *)__get_free_page(GFP_KERNEL); -+ if (!pmd_sv) -+ return 0; -+ -+ for (i = 0; i < PTRS_PER_PMD; i++) { -+ pmd_sv[i] = pmd[i]; -+ if (!pmd_none(pmd[i])) -+ pmd_clear(&pmd[i]); -+ } - - pud_clear(pud); -+ -+ /* INVLPG to clear all paging-structure caches */ -+ flush_tlb_kernel_range(addr, addr + PAGE_SIZE-1); -+ -+ for (i = 0; i < PTRS_PER_PMD; i++) { -+ if (!pmd_none(pmd_sv[i])) { -+ pte = (pte_t *)pmd_page_vaddr(pmd_sv[i]); -+ free_page((unsigned long)pte); -+ } -+ } -+ -+ free_page((unsigned long)pmd_sv); - free_page((unsigned long)pmd); - - return 1; -@@ -753,7 +773,7 @@ int pud_free_pmd_page(pud_t *pud, unsign - * @pmd: Pointer to a PMD. - * @addr: Virtual address associated with pmd. - * -- * Context: The pmd range has been unmaped and TLB purged. -+ * Context: The pmd range has been unmapped and TLB purged. - * Return: 1 if clearing the entry succeeded. 0 otherwise. - */ - int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) -@@ -765,6 +785,10 @@ int pmd_free_pte_page(pmd_t *pmd, unsign - - pte = (pte_t *)pmd_page_vaddr(*pmd); - pmd_clear(pmd); -+ -+ /* INVLPG to clear all paging-structure caches */ -+ flush_tlb_kernel_range(addr, addr + PAGE_SIZE-1); -+ - free_page((unsigned long)pte); - - return 1; - - -Patches currently in stable-queue which might be from toshi.kani@hpe.com are - -queue-4.18/x86-mm-disable-ioremap-free-page-handling-on-x86-pae.patch -queue-4.18/ioremap-update-pgtable-free-interfaces-with-addr.patch -queue-4.18/x86-mm-add-tlb-purge-to-free-pmd-pte-page-interfaces.patch diff --git a/a/content_digest b/N1/content_digest index f040cc0..deb765d 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,17 @@ - "From\0gregkh@linuxfoundation.org (gregkh at linuxfoundation.org)\0" + "From\0<gregkh@linuxfoundation.org>\0" "Subject\0Patch \"x86/mm: Add TLB purge to free pmd/pte page interfaces\" has been added to the 4.18-stable tree\0" "Date\0Thu, 16 Aug 2018 19:01:58 +0200\0" - "To\0linux-arm-kernel@lists.infradead.org\0" + "To\020180627141348.21777-4-toshi.kani@hpe.com" + akpm@linux-foundation.org + cpandya@codeaurora.org + gregkh@linuxfoundation.org + hpa@zytor.com + joro@8bytes.org + linux-arm-kernel@lists.infradead.org + linux-mm@kvack.org + mhocko@suse.com + " tglx@linutronix.detoshi.kani@hpe.com\0" + "Cc\0stable-commits@vger.kernel.org\0" "\00:1\0" "b\0" "\n" @@ -17,139 +27,6 @@ "and it can be found in the queue-4.18 subdirectory.\n" "\n" "If you, or anyone else, feels it should not be added to the stable tree,\n" - "please let <stable@vger.kernel.org> know about it.\n" - "\n" - "\n" - ">From 5e0fb5df2ee871b841f96f9cb6a7f2784e96aa4e Mon Sep 17 00:00:00 2001\n" - "From: Toshi Kani <toshi.kani@hpe.com>\n" - "Date: Wed, 27 Jun 2018 08:13:48 -0600\n" - "Subject: x86/mm: Add TLB purge to free pmd/pte page interfaces\n" - "\n" - "From: Toshi Kani <toshi.kani@hpe.com>\n" - "\n" - "commit 5e0fb5df2ee871b841f96f9cb6a7f2784e96aa4e upstream.\n" - "\n" - "ioremap() calls pud_free_pmd_page() / pmd_free_pte_page() when it creates\n" - "a pud / pmd map. The following preconditions are met at their entry.\n" - " - All pte entries for a target pud/pmd address range have been cleared.\n" - " - System-wide TLB purges have been peformed for a target pud/pmd address\n" - " range.\n" - "\n" - "The preconditions assure that there is no stale TLB entry for the range.\n" - "Speculation may not cache TLB entries since it requires all levels of page\n" - "entries, including ptes, to have P & A-bits set for an associated address.\n" - "However, speculation may cache pud/pmd entries (paging-structure caches)\n" - "when they have P-bit set.\n" - "\n" - "Add a system-wide TLB purge (INVLPG) to a single page after clearing\n" - "pud/pmd entry's P-bit.\n" - "\n" - "SDM 4.10.4.1, Operation that Invalidate TLBs and Paging-Structure Caches,\n" - "states that:\n" - " INVLPG invalidates all paging-structure caches associated with the\n" - " current PCID regardless of the liner addresses to which they correspond.\n" - "\n" - "Fixes: 28ee90fe6048 (\"x86/mm: implement free pmd/pte page interfaces\")\n" - "Signed-off-by: Toshi Kani <toshi.kani@hpe.com>\n" - "Signed-off-by: Thomas Gleixner <tglx@linutronix.de>\n" - "Cc: mhocko at suse.com\n" - "Cc: akpm at linux-foundation.org\n" - "Cc: hpa at zytor.com\n" - "Cc: cpandya at codeaurora.org\n" - "Cc: linux-mm at kvack.org\n" - "Cc: linux-arm-kernel at lists.infradead.org\n" - "Cc: Joerg Roedel <joro@8bytes.org>\n" - "Cc: stable at vger.kernel.org\n" - "Cc: Andrew Morton <akpm@linux-foundation.org>\n" - "Cc: Michal Hocko <mhocko@suse.com>\n" - "Cc: \"H. Peter Anvin\" <hpa@zytor.com>\n" - "Cc: <stable@vger.kernel.org>\n" - "Link: https://lkml.kernel.org/r/20180627141348.21777-4-toshi.kani at hpe.com\n" - "Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n" - "\n" - "---\n" - " arch/x86/mm/pgtable.c | 38 +++++++++++++++++++++++++++++++-------\n" - " 1 file changed, 31 insertions(+), 7 deletions(-)\n" - "\n" - "--- a/arch/x86/mm/pgtable.c\n" - "+++ b/arch/x86/mm/pgtable.c\n" - "@@ -725,24 +725,44 @@ int pmd_clear_huge(pmd_t *pmd)\n" - " * @pud: Pointer to a PUD.\n" - " * @addr: Virtual address associated with pud.\n" - " *\n" - "- * Context: The pud range has been unmaped and TLB purged.\n" - "+ * Context: The pud range has been unmapped and TLB purged.\n" - " * Return: 1 if clearing the entry succeeded. 0 otherwise.\n" - "+ *\n" - "+ * NOTE: Callers must allow a single page allocation.\n" - " */\n" - " int pud_free_pmd_page(pud_t *pud, unsigned long addr)\n" - " {\n" - "-\tpmd_t *pmd;\n" - "+\tpmd_t *pmd, *pmd_sv;\n" - "+\tpte_t *pte;\n" - " \tint i;\n" - " \n" - " \tif (pud_none(*pud))\n" - " \t\treturn 1;\n" - " \n" - " \tpmd = (pmd_t *)pud_page_vaddr(*pud);\n" - "-\n" - "-\tfor (i = 0; i < PTRS_PER_PMD; i++)\n" - "-\t\tif (!pmd_free_pte_page(&pmd[i], addr + (i * PMD_SIZE)))\n" - "-\t\t\treturn 0;\n" - "+\tpmd_sv = (pmd_t *)__get_free_page(GFP_KERNEL);\n" - "+\tif (!pmd_sv)\n" - "+\t\treturn 0;\n" - "+\n" - "+\tfor (i = 0; i < PTRS_PER_PMD; i++) {\n" - "+\t\tpmd_sv[i] = pmd[i];\n" - "+\t\tif (!pmd_none(pmd[i]))\n" - "+\t\t\tpmd_clear(&pmd[i]);\n" - "+\t}\n" - " \n" - " \tpud_clear(pud);\n" - "+\n" - "+\t/* INVLPG to clear all paging-structure caches */\n" - "+\tflush_tlb_kernel_range(addr, addr + PAGE_SIZE-1);\n" - "+\n" - "+\tfor (i = 0; i < PTRS_PER_PMD; i++) {\n" - "+\t\tif (!pmd_none(pmd_sv[i])) {\n" - "+\t\t\tpte = (pte_t *)pmd_page_vaddr(pmd_sv[i]);\n" - "+\t\t\tfree_page((unsigned long)pte);\n" - "+\t\t}\n" - "+\t}\n" - "+\n" - "+\tfree_page((unsigned long)pmd_sv);\n" - " \tfree_page((unsigned long)pmd);\n" - " \n" - " \treturn 1;\n" - "@@ -753,7 +773,7 @@ int pud_free_pmd_page(pud_t *pud, unsign\n" - " * @pmd: Pointer to a PMD.\n" - " * @addr: Virtual address associated with pmd.\n" - " *\n" - "- * Context: The pmd range has been unmaped and TLB purged.\n" - "+ * Context: The pmd range has been unmapped and TLB purged.\n" - " * Return: 1 if clearing the entry succeeded. 0 otherwise.\n" - " */\n" - " int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)\n" - "@@ -765,6 +785,10 @@ int pmd_free_pte_page(pmd_t *pmd, unsign\n" - " \n" - " \tpte = (pte_t *)pmd_page_vaddr(*pmd);\n" - " \tpmd_clear(pmd);\n" - "+\n" - "+\t/* INVLPG to clear all paging-structure caches */\n" - "+\tflush_tlb_kernel_range(addr, addr + PAGE_SIZE-1);\n" - "+\n" - " \tfree_page((unsigned long)pte);\n" - " \n" - " \treturn 1;\n" - "\n" - "\n" - "Patches currently in stable-queue which might be from toshi.kani@hpe.com are\n" - "\n" - "queue-4.18/x86-mm-disable-ioremap-free-page-handling-on-x86-pae.patch\n" - "queue-4.18/ioremap-update-pgtable-free-interfaces-with-addr.patch\n" - queue-4.18/x86-mm-add-tlb-purge-to-free-pmd-pte-page-interfaces.patch + please let <stable@vger.kernel.org> know about it. -a0bbcd7c079d5f11a06bf0a23c9852e308e36f58c48acf98f66ff79838899fe2 +6220be697d05f205ad57e45f0e7d888947e8c3ab07cf1d78458ddb9a950117d9
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.