diff for duplicates of <1534438917118119@kroah.com> diff --git a/a/1.txt b/N1/1.txt index 26fcd82..80ab2ef 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -12,189 +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 785a19f9d1dd8a4ab2d0633be4656653bd3de1fc Mon Sep 17 00:00:00 2001 -From: Chintan Pandya <cpandya@codeaurora.org> -Date: Wed, 27 Jun 2018 08:13:47 -0600 -Subject: ioremap: Update pgtable free interfaces with addr - -From: Chintan Pandya <cpandya@codeaurora.org> - -commit 785a19f9d1dd8a4ab2d0633be4656653bd3de1fc upstream. - -The following kernel panic was observed on ARM64 platform due to a stale -TLB entry. - - 1. ioremap with 4K size, a valid pte page table is set. - 2. iounmap it, its pte entry is set to 0. - 3. ioremap the same address with 2M size, update its pmd entry with - a new value. - 4. CPU may hit an exception because the old pmd entry is still in TLB, - which leads to a kernel panic. - -Commit b6bdb7517c3d ("mm/vmalloc: add interfaces to free unmapped page -table") has addressed this panic by falling to pte mappings in the above -case on ARM64. - -To support pmd mappings in all cases, TLB purge needs to be performed -in this case on ARM64. - -Add a new arg, 'addr', to pud_free_pmd_page() and pmd_free_pte_page() -so that TLB purge can be added later in seprate patches. - -[toshi.kani at hpe.com: merge changes, rewrite patch description] -Fixes: 28ee90fe6048 ("x86/mm: implement free pmd/pte page interfaces") -Signed-off-by: Chintan Pandya <cpandya@codeaurora.org> -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: linux-mm at kvack.org -Cc: linux-arm-kernel at lists.infradead.org -Cc: Will Deacon <will.deacon@arm.com> -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-3-toshi.kani at hpe.com -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> - ---- - arch/arm64/mm/mmu.c | 4 ++-- - arch/x86/mm/pgtable.c | 12 +++++++----- - include/asm-generic/pgtable.h | 8 ++++---- - lib/ioremap.c | 4 ++-- - 4 files changed, 15 insertions(+), 13 deletions(-) - ---- a/arch/arm64/mm/mmu.c -+++ b/arch/arm64/mm/mmu.c -@@ -977,12 +977,12 @@ int pmd_clear_huge(pmd_t *pmdp) - return 1; - } - --int pud_free_pmd_page(pud_t *pud) -+int pud_free_pmd_page(pud_t *pud, unsigned long addr) - { - return pud_none(*pud); - } - --int pmd_free_pte_page(pmd_t *pmd) -+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) - { - return pmd_none(*pmd); - } ---- a/arch/x86/mm/pgtable.c -+++ b/arch/x86/mm/pgtable.c -@@ -723,11 +723,12 @@ int pmd_clear_huge(pmd_t *pmd) - /** - * pud_free_pmd_page - Clear pud entry and free pmd page. - * @pud: Pointer to a PUD. -+ * @addr: Virtual address associated with pud. - * - * Context: The pud range has been unmaped and TLB purged. - * Return: 1 if clearing the entry succeeded. 0 otherwise. - */ --int pud_free_pmd_page(pud_t *pud) -+int pud_free_pmd_page(pud_t *pud, unsigned long addr) - { - pmd_t *pmd; - int i; -@@ -738,7 +739,7 @@ int pud_free_pmd_page(pud_t *pud) - pmd = (pmd_t *)pud_page_vaddr(*pud); - - for (i = 0; i < PTRS_PER_PMD; i++) -- if (!pmd_free_pte_page(&pmd[i])) -+ if (!pmd_free_pte_page(&pmd[i], addr + (i * PMD_SIZE))) - return 0; - - pud_clear(pud); -@@ -750,11 +751,12 @@ int pud_free_pmd_page(pud_t *pud) - /** - * pmd_free_pte_page - Clear pmd entry and free pte page. - * @pmd: Pointer to a PMD. -+ * @addr: Virtual address associated with pmd. - * - * Context: The pmd range has been unmaped and TLB purged. - * Return: 1 if clearing the entry succeeded. 0 otherwise. - */ --int pmd_free_pte_page(pmd_t *pmd) -+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) - { - pte_t *pte; - -@@ -770,7 +772,7 @@ int pmd_free_pte_page(pmd_t *pmd) - - #else /* !CONFIG_X86_64 */ - --int pud_free_pmd_page(pud_t *pud) -+int pud_free_pmd_page(pud_t *pud, unsigned long addr) - { - return pud_none(*pud); - } -@@ -779,7 +781,7 @@ int pud_free_pmd_page(pud_t *pud) - * Disable free page handling on x86-PAE. This assures that ioremap() - * does not update sync'd pmd entries. See vmalloc_sync_one(). - */ --int pmd_free_pte_page(pmd_t *pmd) -+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) - { - return pmd_none(*pmd); - } ---- a/include/asm-generic/pgtable.h -+++ b/include/asm-generic/pgtable.h -@@ -1019,8 +1019,8 @@ int pud_set_huge(pud_t *pud, phys_addr_t - int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot); - int pud_clear_huge(pud_t *pud); - int pmd_clear_huge(pmd_t *pmd); --int pud_free_pmd_page(pud_t *pud); --int pmd_free_pte_page(pmd_t *pmd); -+int pud_free_pmd_page(pud_t *pud, unsigned long addr); -+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr); - #else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ - static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot) - { -@@ -1046,11 +1046,11 @@ static inline int pmd_clear_huge(pmd_t * - { - return 0; - } --static inline int pud_free_pmd_page(pud_t *pud) -+static inline int pud_free_pmd_page(pud_t *pud, unsigned long addr) - { - return 0; - } --static inline int pmd_free_pte_page(pmd_t *pmd) -+static inline int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) - { - return 0; - } ---- a/lib/ioremap.c -+++ b/lib/ioremap.c -@@ -92,7 +92,7 @@ static inline int ioremap_pmd_range(pud_ - if (ioremap_pmd_enabled() && - ((next - addr) == PMD_SIZE) && - IS_ALIGNED(phys_addr + addr, PMD_SIZE) && -- pmd_free_pte_page(pmd)) { -+ pmd_free_pte_page(pmd, addr)) { - if (pmd_set_huge(pmd, phys_addr + addr, prot)) - continue; - } -@@ -119,7 +119,7 @@ static inline int ioremap_pud_range(p4d_ - if (ioremap_pud_enabled() && - ((next - addr) == PUD_SIZE) && - IS_ALIGNED(phys_addr + addr, PUD_SIZE) && -- pud_free_pmd_page(pud)) { -+ pud_free_pmd_page(pud, addr)) { - if (pud_set_huge(pud, phys_addr + addr, prot)) - continue; - } - - -Patches currently in stable-queue which might be from cpandya@codeaurora.org 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 e88b1b7..84dbc81 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,18 @@ - "From\0gregkh@linuxfoundation.org (gregkh at linuxfoundation.org)\0" + "From\0<gregkh@linuxfoundation.org>\0" "Subject\0Patch \"ioremap: Update pgtable free interfaces with addr\" has been added to the 4.18-stable tree\0" "Date\0Thu, 16 Aug 2018 19:01:57 +0200\0" - "To\0linux-arm-kernel@lists.infradead.org\0" + "To\020180627141348.21777-3-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 + " will.deacon@arm.com\0" + "Cc\0stable-commits@vger.kernel.org\0" "\00:1\0" "b\0" "\n" @@ -17,192 +28,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 785a19f9d1dd8a4ab2d0633be4656653bd3de1fc Mon Sep 17 00:00:00 2001\n" - "From: Chintan Pandya <cpandya@codeaurora.org>\n" - "Date: Wed, 27 Jun 2018 08:13:47 -0600\n" - "Subject: ioremap: Update pgtable free interfaces with addr\n" - "\n" - "From: Chintan Pandya <cpandya@codeaurora.org>\n" - "\n" - "commit 785a19f9d1dd8a4ab2d0633be4656653bd3de1fc upstream.\n" - "\n" - "The following kernel panic was observed on ARM64 platform due to a stale\n" - "TLB entry.\n" - "\n" - " 1. ioremap with 4K size, a valid pte page table is set.\n" - " 2. iounmap it, its pte entry is set to 0.\n" - " 3. ioremap the same address with 2M size, update its pmd entry with\n" - " a new value.\n" - " 4. CPU may hit an exception because the old pmd entry is still in TLB,\n" - " which leads to a kernel panic.\n" - "\n" - "Commit b6bdb7517c3d (\"mm/vmalloc: add interfaces to free unmapped page\n" - "table\") has addressed this panic by falling to pte mappings in the above\n" - "case on ARM64.\n" - "\n" - "To support pmd mappings in all cases, TLB purge needs to be performed\n" - "in this case on ARM64.\n" - "\n" - "Add a new arg, 'addr', to pud_free_pmd_page() and pmd_free_pte_page()\n" - "so that TLB purge can be added later in seprate patches.\n" - "\n" - "[toshi.kani at hpe.com: merge changes, rewrite patch description]\n" - "Fixes: 28ee90fe6048 (\"x86/mm: implement free pmd/pte page interfaces\")\n" - "Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>\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: linux-mm at kvack.org\n" - "Cc: linux-arm-kernel at lists.infradead.org\n" - "Cc: Will Deacon <will.deacon@arm.com>\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-3-toshi.kani at hpe.com\n" - "Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n" - "\n" - "---\n" - " arch/arm64/mm/mmu.c | 4 ++--\n" - " arch/x86/mm/pgtable.c | 12 +++++++-----\n" - " include/asm-generic/pgtable.h | 8 ++++----\n" - " lib/ioremap.c | 4 ++--\n" - " 4 files changed, 15 insertions(+), 13 deletions(-)\n" - "\n" - "--- a/arch/arm64/mm/mmu.c\n" - "+++ b/arch/arm64/mm/mmu.c\n" - "@@ -977,12 +977,12 @@ int pmd_clear_huge(pmd_t *pmdp)\n" - " \treturn 1;\n" - " }\n" - " \n" - "-int pud_free_pmd_page(pud_t *pud)\n" - "+int pud_free_pmd_page(pud_t *pud, unsigned long addr)\n" - " {\n" - " \treturn pud_none(*pud);\n" - " }\n" - " \n" - "-int pmd_free_pte_page(pmd_t *pmd)\n" - "+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)\n" - " {\n" - " \treturn pmd_none(*pmd);\n" - " }\n" - "--- a/arch/x86/mm/pgtable.c\n" - "+++ b/arch/x86/mm/pgtable.c\n" - "@@ -723,11 +723,12 @@ int pmd_clear_huge(pmd_t *pmd)\n" - " /**\n" - " * pud_free_pmd_page - Clear pud entry and free pmd page.\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" - " * Return: 1 if clearing the entry succeeded. 0 otherwise.\n" - " */\n" - "-int pud_free_pmd_page(pud_t *pud)\n" - "+int pud_free_pmd_page(pud_t *pud, unsigned long addr)\n" - " {\n" - " \tpmd_t *pmd;\n" - " \tint i;\n" - "@@ -738,7 +739,7 @@ int pud_free_pmd_page(pud_t *pud)\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]))\n" - "+\t\tif (!pmd_free_pte_page(&pmd[i], addr + (i * PMD_SIZE)))\n" - " \t\t\treturn 0;\n" - " \n" - " \tpud_clear(pud);\n" - "@@ -750,11 +751,12 @@ int pud_free_pmd_page(pud_t *pud)\n" - " /**\n" - " * pmd_free_pte_page - Clear pmd entry and free pte page.\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" - " * Return: 1 if clearing the entry succeeded. 0 otherwise.\n" - " */\n" - "-int pmd_free_pte_page(pmd_t *pmd)\n" - "+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)\n" - " {\n" - " \tpte_t *pte;\n" - " \n" - "@@ -770,7 +772,7 @@ int pmd_free_pte_page(pmd_t *pmd)\n" - " \n" - " #else /* !CONFIG_X86_64 */\n" - " \n" - "-int pud_free_pmd_page(pud_t *pud)\n" - "+int pud_free_pmd_page(pud_t *pud, unsigned long addr)\n" - " {\n" - " \treturn pud_none(*pud);\n" - " }\n" - "@@ -779,7 +781,7 @@ int pud_free_pmd_page(pud_t *pud)\n" - " * Disable free page handling on x86-PAE. This assures that ioremap()\n" - " * does not update sync'd pmd entries. See vmalloc_sync_one().\n" - " */\n" - "-int pmd_free_pte_page(pmd_t *pmd)\n" - "+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)\n" - " {\n" - " \treturn pmd_none(*pmd);\n" - " }\n" - "--- a/include/asm-generic/pgtable.h\n" - "+++ b/include/asm-generic/pgtable.h\n" - "@@ -1019,8 +1019,8 @@ int pud_set_huge(pud_t *pud, phys_addr_t\n" - " int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot);\n" - " int pud_clear_huge(pud_t *pud);\n" - " int pmd_clear_huge(pmd_t *pmd);\n" - "-int pud_free_pmd_page(pud_t *pud);\n" - "-int pmd_free_pte_page(pmd_t *pmd);\n" - "+int pud_free_pmd_page(pud_t *pud, unsigned long addr);\n" - "+int pmd_free_pte_page(pmd_t *pmd, unsigned long addr);\n" - " #else\t/* !CONFIG_HAVE_ARCH_HUGE_VMAP */\n" - " static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)\n" - " {\n" - "@@ -1046,11 +1046,11 @@ static inline int pmd_clear_huge(pmd_t *\n" - " {\n" - " \treturn 0;\n" - " }\n" - "-static inline int pud_free_pmd_page(pud_t *pud)\n" - "+static inline int pud_free_pmd_page(pud_t *pud, unsigned long addr)\n" - " {\n" - " \treturn 0;\n" - " }\n" - "-static inline int pmd_free_pte_page(pmd_t *pmd)\n" - "+static inline int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)\n" - " {\n" - " \treturn 0;\n" - " }\n" - "--- a/lib/ioremap.c\n" - "+++ b/lib/ioremap.c\n" - "@@ -92,7 +92,7 @@ static inline int ioremap_pmd_range(pud_\n" - " \t\tif (ioremap_pmd_enabled() &&\n" - " \t\t ((next - addr) == PMD_SIZE) &&\n" - " \t\t IS_ALIGNED(phys_addr + addr, PMD_SIZE) &&\n" - "-\t\t pmd_free_pte_page(pmd)) {\n" - "+\t\t pmd_free_pte_page(pmd, addr)) {\n" - " \t\t\tif (pmd_set_huge(pmd, phys_addr + addr, prot))\n" - " \t\t\t\tcontinue;\n" - " \t\t}\n" - "@@ -119,7 +119,7 @@ static inline int ioremap_pud_range(p4d_\n" - " \t\tif (ioremap_pud_enabled() &&\n" - " \t\t ((next - addr) == PUD_SIZE) &&\n" - " \t\t IS_ALIGNED(phys_addr + addr, PUD_SIZE) &&\n" - "-\t\t pud_free_pmd_page(pud)) {\n" - "+\t\t pud_free_pmd_page(pud, addr)) {\n" - " \t\t\tif (pud_set_huge(pud, phys_addr + addr, prot))\n" - " \t\t\t\tcontinue;\n" - " \t\t}\n" - "\n" - "\n" - "Patches currently in stable-queue which might be from cpandya@codeaurora.org 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. -facff35b08dd56e5c0a62ff1cc68ebaea454d7fa95246bd787bab18f36186757 +00891ccb35f58130ae010b12f912739c1a6a7922dc402048f3e7c589d0f8cd36
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.