ARM64: dts: rk3368-tb-sheep: add grf offset property for dwc-control-usb
[firefly-linux-kernel-4.4.55.git] / fs / binfmt_elf_fdpic.c
index 20462069e513ea7683616bb80d8b93af116155bf..b1adb92e69de7a8049dd914f3f8bb83d8d8b9c7f 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/elf-fdpic.h>
 #include <linux/elfcore.h>
 #include <linux/coredump.h>
+#include <linux/dax.h>
 
 #include <asm/uaccess.h>
 #include <asm/param.h>
@@ -404,10 +405,7 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
                PAGE_ALIGN(current->mm->start_brk);
 
 #else
-       /* create a stack and brk area big enough for everyone
-        * - the brk heap starts at the bottom and works up
-        * - the stack starts at the top and works down
-        */
+       /* create a stack area and zero-size brk area */
        stack_size = (stack_size + PAGE_SIZE - 1) & PAGE_MASK;
        if (stack_size < PAGE_SIZE * 2)
                stack_size = PAGE_SIZE * 2;
@@ -430,8 +428,6 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
 
        current->mm->brk = current->mm->start_brk;
        current->mm->context.end_brk = current->mm->start_brk;
-       current->mm->context.end_brk +=
-               (stack_size > PAGE_SIZE) ? (stack_size - PAGE_SIZE) : 0;
        current->mm->start_stack = current->mm->start_brk + stack_size;
 #endif
 
@@ -1236,6 +1232,20 @@ static int maydump(struct vm_area_struct *vma, unsigned long mm_flags)
                return 0;
        }
 
+       /* support for DAX */
+       if (vma_is_dax(vma)) {
+               if (vma->vm_flags & VM_SHARED) {
+                       dump_ok = test_bit(MMF_DUMP_DAX_SHARED, &mm_flags);
+                       kdcore("%08lx: %08lx: %s (DAX shared)", vma->vm_start,
+                              vma->vm_flags, dump_ok ? "yes" : "no");
+               } else {
+                       dump_ok = test_bit(MMF_DUMP_DAX_PRIVATE, &mm_flags);
+                       kdcore("%08lx: %08lx: %s (DAX private)", vma->vm_start,
+                              vma->vm_flags, dump_ok ? "yes" : "no");
+               }
+               return dump_ok;
+       }
+
        /* By default, dump shared memory if mapped from an anonymous file. */
        if (vma->vm_flags & VM_SHARED) {
                if (file_inode(vma->vm_file)->i_nlink == 0) {