Merge tag 'csky-for-linus-5.0-rc6' of git://github.com/c-sky/csky-linux

Pull arch/csky fixes from Guo Ren:
"Here are some fixup patches for 5.0-rc6"

* tag 'csky-for-linus-5.0-rc6' of git://github.com/c-sky/csky-linux:
csky: Fixup dead loop in show_stack
csky: Fixup io-range page attribute for mmap("/dev/mem")
csky: coding convention: Use task_stack_page
csky: Fixup wrong pt_regs size
csky: Fixup _PAGE_GLOBAL bit for 610 tlb entry

Changed files
+31 -6
arch
+7 -2
arch/csky/include/asm/pgtable.h
··· 45 45 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset_t(address)) 46 46 #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) 47 47 #define pte_clear(mm, addr, ptep) set_pte((ptep), \ 48 - (((unsigned int)addr&0x80000000)?__pte(1):__pte(0))) 49 - #define pte_none(pte) (!(pte_val(pte)&0xfffffffe)) 48 + (((unsigned int) addr & PAGE_OFFSET) ? __pte(_PAGE_GLOBAL) : __pte(0))) 49 + #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) 50 50 #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) 51 51 #define pte_pfn(x) ((unsigned long)((x).pte_low >> PAGE_SHIFT)) 52 52 #define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) \ ··· 240 240 #define pgd_offset_k(address) pgd_offset(&init_mm, address) 241 241 242 242 #define pgd_index(address) ((address) >> PGDIR_SHIFT) 243 + 244 + #define __HAVE_PHYS_MEM_ACCESS_PROT 245 + struct file; 246 + extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 247 + unsigned long size, pgprot_t vma_prot); 243 248 244 249 /* 245 250 * Macro to make mark a page protection value as "uncacheable". Note
+2 -2
arch/csky/include/asm/processor.h
··· 49 49 }; 50 50 51 51 #define INIT_THREAD { \ 52 - .ksp = (unsigned long) init_thread_union.stack + THREAD_SIZE, \ 52 + .ksp = sizeof(init_stack) + (unsigned long) &init_stack, \ 53 53 .sr = DEFAULT_PSR_VALUE, \ 54 54 } 55 55 ··· 95 95 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->usp) 96 96 97 97 #define task_pt_regs(p) \ 98 - ((struct pt_regs *)(THREAD_SIZE + p->stack) - 1) 98 + ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1) 99 99 100 100 #define cpu_relax() barrier() 101 101
+4
arch/csky/kernel/dumpstack.c
··· 38 38 if (task) 39 39 stack = (unsigned long *)thread_saved_fp(task); 40 40 else 41 + #ifdef CONFIG_STACKTRACE 42 + asm volatile("mov %0, r8\n":"=r"(stack)::"memory"); 43 + #else 41 44 stack = (unsigned long *)&stack; 45 + #endif 42 46 } 43 47 44 48 show_trace(stack);
+2 -1
arch/csky/kernel/ptrace.c
··· 8 8 #include <linux/ptrace.h> 9 9 #include <linux/regset.h> 10 10 #include <linux/sched.h> 11 + #include <linux/sched/task_stack.h> 11 12 #include <linux/signal.h> 12 13 #include <linux/smp.h> 13 14 #include <linux/uaccess.h> ··· 160 159 static const struct user_regset csky_regsets[] = { 161 160 [REGSET_GPR] = { 162 161 .core_note_type = NT_PRSTATUS, 163 - .n = ELF_NGREG, 162 + .n = sizeof(struct pt_regs) / sizeof(u32), 164 163 .size = sizeof(u32), 165 164 .align = sizeof(u32), 166 165 .get = &gpr_get,
+2 -1
arch/csky/kernel/smp.c
··· 160 160 { 161 161 unsigned long mask = 1 << cpu; 162 162 163 - secondary_stack = (unsigned int)tidle->stack + THREAD_SIZE - 8; 163 + secondary_stack = 164 + (unsigned int) task_stack_page(tidle) + THREAD_SIZE - 8; 164 165 secondary_hint = mfcr("cr31"); 165 166 secondary_ccr = mfcr("cr18"); 166 167
+14
arch/csky/mm/ioremap.c
··· 46 46 vunmap((void *)((unsigned long)addr & PAGE_MASK)); 47 47 } 48 48 EXPORT_SYMBOL(iounmap); 49 + 50 + pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 51 + unsigned long size, pgprot_t vma_prot) 52 + { 53 + if (!pfn_valid(pfn)) { 54 + vma_prot.pgprot |= _PAGE_SO; 55 + return pgprot_noncached(vma_prot); 56 + } else if (file->f_flags & O_SYNC) { 57 + return pgprot_noncached(vma_prot); 58 + } 59 + 60 + return vma_prot; 61 + } 62 + EXPORT_SYMBOL(phys_mem_access_prot);