]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 May 2017 18:21:10 +0000 (11:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 May 2017 18:21:10 +0000 (11:21 -0700)
Pull sparc fixes from David Miller:
 "Three sparc bug fixes"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc/ftrace: Fix ftrace graph time measurement
  sparc: Fix -Wstringop-overflow warning
  sparc64: Fix mapping of 64k pages with MAP_FIXED

arch/sparc/include/asm/hugetlb.h
arch/sparc/include/asm/pgtable_32.h
arch/sparc/include/asm/setup.h
arch/sparc/kernel/ftrace.c
arch/sparc/mm/init_32.c

index dcbf985ab243201250222a824fc1146320522e65..d1f837dc77a4d0c975f94e5bbd315b347001d01a 100644 (file)
@@ -24,9 +24,11 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
 static inline int prepare_hugepage_range(struct file *file,
                        unsigned long addr, unsigned long len)
 {
-       if (len & ~HPAGE_MASK)
+       struct hstate *h = hstate_file(file);
+
+       if (len & ~huge_page_mask(h))
                return -EINVAL;
-       if (addr & ~HPAGE_MASK)
+       if (addr & ~huge_page_mask(h))
                return -EINVAL;
        return 0;
 }
index ce6f56980aefd2902bfae849eb90a993295976eb..cf190728360bbfb43621d23a7fb3a22c443a7399 100644 (file)
@@ -91,9 +91,9 @@ extern unsigned long pfn_base;
  * ZERO_PAGE is a global shared page that is always zero: used
  * for zero-mapped memory areas etc..
  */
-extern unsigned long empty_zero_page;
+extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
 
-#define ZERO_PAGE(vaddr) (virt_to_page(&empty_zero_page))
+#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
 
 /*
  * In general all page table modifications should use the V8 atomic
index 478bf6bb4598b345dd7f590beee86f43893e7645..3fae200dd251f094bad756ef145ec39882470d8e 100644 (file)
@@ -16,7 +16,7 @@ extern char reboot_command[];
  */
 extern unsigned char boot_cpu_id;
 
-extern unsigned long empty_zero_page;
+extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
 
 extern int serial_console;
 static inline int con_is_present(void)
index 6bcff698069bf1fa57c1d84df180c1cb67f18a65..cec54dc4ab817e7c9c54c2d9b0532f0fd49bc7d8 100644 (file)
@@ -130,17 +130,16 @@ unsigned long prepare_ftrace_return(unsigned long parent,
        if (unlikely(atomic_read(&current->tracing_graph_pause)))
                return parent + 8UL;
 
-       if (ftrace_push_return_trace(parent, self_addr, &trace.depth,
-                                    frame_pointer, NULL) == -EBUSY)
-               return parent + 8UL;
-
        trace.func = self_addr;
+       trace.depth = current->curr_ret_stack + 1;
 
        /* Only trace if the calling function expects to */
-       if (!ftrace_graph_entry(&trace)) {
-               current->curr_ret_stack--;
+       if (!ftrace_graph_entry(&trace))
+               return parent + 8UL;
+
+       if (ftrace_push_return_trace(parent, self_addr, &trace.depth,
+                                    frame_pointer, NULL) == -EBUSY)
                return parent + 8UL;
-       }
 
        return return_hooker;
 }
index c6afe98de4d9aba5ebad292031735988afd8180d..3bd0d513bddbde7f95275be6e3ae94bd26729c6f 100644 (file)
@@ -290,7 +290,7 @@ void __init mem_init(void)
 
 
        /* Saves us work later. */
-       memset((void *)&empty_zero_page, 0, PAGE_SIZE);
+       memset((void *)empty_zero_page, 0, PAGE_SIZE);
 
        i = last_valid_pfn >> ((20 - PAGE_SHIFT) + 5);
        i += 1;