]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Jul 2016 23:34:08 +0000 (16:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Jul 2016 23:34:08 +0000 (16:34 -0700)
added patches:
arm-8578-1-mm-ensure-pmd_present-only-checks-the-valid-bit.patch
ubifs-implement-migratepage.patch

queue-3.14/arm-8578-1-mm-ensure-pmd_present-only-checks-the-valid-bit.patch [new file with mode: 0644]
queue-3.14/series
queue-3.14/ubifs-implement-migratepage.patch [new file with mode: 0644]

diff --git a/queue-3.14/arm-8578-1-mm-ensure-pmd_present-only-checks-the-valid-bit.patch b/queue-3.14/arm-8578-1-mm-ensure-pmd_present-only-checks-the-valid-bit.patch
new file mode 100644 (file)
index 0000000..7672d6a
--- /dev/null
@@ -0,0 +1,66 @@
+From 624531886987f0f1b5d01fb598034d039198e090 Mon Sep 17 00:00:00 2001
+From: Will Deacon <will.deacon@arm.com>
+Date: Tue, 7 Jun 2016 17:57:54 +0100
+Subject: ARM: 8578/1: mm: ensure pmd_present only checks the valid bit
+
+From: Will Deacon <will.deacon@arm.com>
+
+commit 624531886987f0f1b5d01fb598034d039198e090 upstream.
+
+In a subsequent patch, pmd_mknotpresent will clear the valid bit of the
+pmd entry, resulting in a not-present entry from the hardware's
+perspective. Unfortunately, pmd_present simply checks for a non-zero pmd
+value and will therefore continue to return true even after a
+pmd_mknotpresent operation. Since pmd_mknotpresent is only used for
+managing huge entries, this is only an issue for the 3-level case.
+
+This patch fixes the 3-level pmd_present implementation to take into
+account the valid bit. For bisectability, the change is made before the
+fix to pmd_mknotpresent.
+
+[catalin.marinas@arm.com: comment update regarding pmd_mknotpresent patch]
+
+Fixes: 8d9625070073 ("ARM: mm: Transparent huge page support for LPAE systems.")
+Cc: Russell King <linux@armlinux.org.uk>
+Cc: Steve Capper <Steve.Capper@arm.com>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/include/asm/pgtable-2level.h |    1 +
+ arch/arm/include/asm/pgtable-3level.h |    1 +
+ arch/arm/include/asm/pgtable.h        |    1 -
+ 3 files changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/include/asm/pgtable-2level.h
++++ b/arch/arm/include/asm/pgtable-2level.h
+@@ -163,6 +163,7 @@ static inline pmd_t *pmd_offset(pud_t *p
+ #define pmd_large(pmd)                (pmd_val(pmd) & 2)
+ #define pmd_bad(pmd)          (pmd_val(pmd) & 2)
++#define pmd_present(pmd)      (pmd_val(pmd))
+ #define copy_pmd(pmdpd,pmdps)         \
+       do {                            \
+--- a/arch/arm/include/asm/pgtable-3level.h
++++ b/arch/arm/include/asm/pgtable-3level.h
+@@ -212,6 +212,7 @@ static inline pmd_t *pmd_offset(pud_t *p
+                                               : !!(pmd_val(pmd) & (val)))
+ #define pmd_isclear(pmd, val) (!(pmd_val(pmd) & (val)))
++#define pmd_present(pmd)      (pmd_isset((pmd), L_PMD_SECT_VALID))
+ #define pmd_young(pmd)                (pmd_isset((pmd), PMD_SECT_AF))
+ #define __HAVE_ARCH_PMD_WRITE
+--- a/arch/arm/include/asm/pgtable.h
++++ b/arch/arm/include/asm/pgtable.h
+@@ -182,7 +182,6 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD
+ #define pgd_offset_k(addr)    pgd_offset(&init_mm, addr)
+ #define pmd_none(pmd)         (!pmd_val(pmd))
+-#define pmd_present(pmd)      (pmd_val(pmd))
+ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
+ {
index 2f22973535ee24f039bdfa3395b60f14bf989fc0..ad9f3e2e8f6bef263d86608db441cfdb92906371 100644 (file)
@@ -19,3 +19,5 @@ kprobes-x86-clear-tf-bit-in-fault-on-single-stepping.patch
 x86-amd_nb-fix-boot-crash-on-non-amd-systems.patch
 make-nfs_atomic_open-call-d_drop-on-all-open_context-errors.patch
 nfs-fix-another-open_downgrade-bug.patch
+arm-8578-1-mm-ensure-pmd_present-only-checks-the-valid-bit.patch
+ubifs-implement-migratepage.patch
diff --git a/queue-3.14/ubifs-implement-migratepage.patch b/queue-3.14/ubifs-implement-migratepage.patch
new file mode 100644 (file)
index 0000000..476adad
--- /dev/null
@@ -0,0 +1,98 @@
+From 4ac1c17b2044a1b4b2fbed74451947e905fc2992 Mon Sep 17 00:00:00 2001
+From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
+Date: Thu, 16 Jun 2016 23:26:15 +0200
+Subject: UBIFS: Implement ->migratepage()
+
+From: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
+
+commit 4ac1c17b2044a1b4b2fbed74451947e905fc2992 upstream.
+
+During page migrations UBIFS might get confused
+and the following assert triggers:
+[  213.480000] UBIFS assert failed in ubifs_set_page_dirty at 1451 (pid 436)
+[  213.490000] CPU: 0 PID: 436 Comm: drm-stress-test Not tainted 4.4.4-00176-geaa802524636-dirty #1008
+[  213.490000] Hardware name: Allwinner sun4i/sun5i Families
+[  213.490000] [<c0015e70>] (unwind_backtrace) from [<c0012cdc>] (show_stack+0x10/0x14)
+[  213.490000] [<c0012cdc>] (show_stack) from [<c02ad834>] (dump_stack+0x8c/0xa0)
+[  213.490000] [<c02ad834>] (dump_stack) from [<c0236ee8>] (ubifs_set_page_dirty+0x44/0x50)
+[  213.490000] [<c0236ee8>] (ubifs_set_page_dirty) from [<c00fa0bc>] (try_to_unmap_one+0x10c/0x3a8)
+[  213.490000] [<c00fa0bc>] (try_to_unmap_one) from [<c00fadb4>] (rmap_walk+0xb4/0x290)
+[  213.490000] [<c00fadb4>] (rmap_walk) from [<c00fb1bc>] (try_to_unmap+0x64/0x80)
+[  213.490000] [<c00fb1bc>] (try_to_unmap) from [<c010dc28>] (migrate_pages+0x328/0x7a0)
+[  213.490000] [<c010dc28>] (migrate_pages) from [<c00d0cb0>] (alloc_contig_range+0x168/0x2f4)
+[  213.490000] [<c00d0cb0>] (alloc_contig_range) from [<c010ec00>] (cma_alloc+0x170/0x2c0)
+[  213.490000] [<c010ec00>] (cma_alloc) from [<c001a958>] (__alloc_from_contiguous+0x38/0xd8)
+[  213.490000] [<c001a958>] (__alloc_from_contiguous) from [<c001ad44>] (__dma_alloc+0x23c/0x274)
+[  213.490000] [<c001ad44>] (__dma_alloc) from [<c001ae08>] (arm_dma_alloc+0x54/0x5c)
+[  213.490000] [<c001ae08>] (arm_dma_alloc) from [<c035cecc>] (drm_gem_cma_create+0xb8/0xf0)
+[  213.490000] [<c035cecc>] (drm_gem_cma_create) from [<c035cf20>] (drm_gem_cma_create_with_handle+0x1c/0xe8)
+[  213.490000] [<c035cf20>] (drm_gem_cma_create_with_handle) from [<c035d088>] (drm_gem_cma_dumb_create+0x3c/0x48)
+[  213.490000] [<c035d088>] (drm_gem_cma_dumb_create) from [<c0341ed8>] (drm_ioctl+0x12c/0x444)
+[  213.490000] [<c0341ed8>] (drm_ioctl) from [<c0121adc>] (do_vfs_ioctl+0x3f4/0x614)
+[  213.490000] [<c0121adc>] (do_vfs_ioctl) from [<c0121d30>] (SyS_ioctl+0x34/0x5c)
+[  213.490000] [<c0121d30>] (SyS_ioctl) from [<c000f2c0>] (ret_fast_syscall+0x0/0x34)
+
+UBIFS is using PagePrivate() which can have different meanings across
+filesystems. Therefore the generic page migration code cannot handle this
+case correctly.
+We have to implement our own migration function which basically does a
+plain copy but also duplicates the page private flag.
+UBIFS is not a block device filesystem and cannot use buffer_migrate_page().
+
+Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
+[rw: Massaged changelog, build fixes, etc...]
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Acked-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ubifs/file.c |   24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+--- a/fs/ubifs/file.c
++++ b/fs/ubifs/file.c
+@@ -54,6 +54,7 @@
+ #include <linux/mount.h>
+ #include <linux/namei.h>
+ #include <linux/slab.h>
++#include <linux/migrate.h>
+ static int read_block(struct inode *inode, void *addr, unsigned int block,
+                     struct ubifs_data_node *dn)
+@@ -1423,6 +1424,26 @@ static int ubifs_set_page_dirty(struct p
+       return ret;
+ }
++#ifdef CONFIG_MIGRATION
++static int ubifs_migrate_page(struct address_space *mapping,
++              struct page *newpage, struct page *page, enum migrate_mode mode)
++{
++      int rc;
++
++      rc = migrate_page_move_mapping(mapping, newpage, page, NULL, mode, 0);
++      if (rc != MIGRATEPAGE_SUCCESS)
++              return rc;
++
++      if (PagePrivate(page)) {
++              ClearPagePrivate(page);
++              SetPagePrivate(newpage);
++      }
++
++      migrate_page_copy(newpage, page);
++      return MIGRATEPAGE_SUCCESS;
++}
++#endif
++
+ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
+ {
+       /*
+@@ -1559,6 +1580,9 @@ const struct address_space_operations ub
+       .write_end      = ubifs_write_end,
+       .invalidatepage = ubifs_invalidatepage,
+       .set_page_dirty = ubifs_set_page_dirty,
++#ifdef CONFIG_MIGRATION
++      .migratepage    = ubifs_migrate_page,
++#endif
+       .releasepage    = ubifs_releasepage,
+ };