Skip to content

Commit cd27845

Browse files
committed
Merge tag 'csky-for-linus-5.12-rc1' of git://github.com/c-sky/csky-linux
Pull arch/csky updates from Guo Ren: "Features: - add new memory layout 2.5G(user):1.5G(kernel) - add kmemleak support - reconstruct VDSO framework: add VDSO with GENERIC_GETTIMEOFDAY, GENERIC_TIME_VSYSCALL, HAVE_GENERIC_VDSO - add faulthandler_disabled() check - support (fix) swapon - add (fix) _PAGE_ACCESSED for default pgprot - abort uaccess retries upon fatal signal (from arm) Fixes and optimizations: - fix perf probe failure - fix show_regs doesn't contain regs->usp - remove custom asm/atomic.h implementation - fix barrier design - fix futex SMP implementation - fix asm/cmpxchg.h with correct ordering barrier - cleanup asm/spinlock.h - fix PTE global for 2.5:1.5 virtual memory - remove prologue of page fault handler in entry.S - fix TLB maintenance synchronization problem - add show_tlb for CPU_CK860 debug - fix FAULT_FLAG_XXX param for handle_mm_fault - fix update_mmu_cache called with user io mapping - fix do_page_fault parent irq status - fix a size determination in gpr_get() - pgtable.h: Coding convention - kprobe: Fix code in simulate without 'long' - fix pfn_valid error with wrong max_mapnr - use free_initmem_default() in free_initmem() - fix compile error" * tag 'csky-for-linus-5.12-rc1' of git://github.com/c-sky/csky-linux: (30 commits) csky: Fixup compile error csky: use free_initmem_default() in free_initmem() csky: Fixup pfn_valid error with wrong max_mapnr csky: Add VDSO with GENERIC_GETTIMEOFDAY, GENERIC_TIME_VSYSCALL, HAVE_GENERIC_VDSO csky: kprobe: Fixup code in simulate without 'long' csky: Fixup swapon csky: pgtable.h: Coding convention csky: Fixup _PAGE_ACCESSED for default pgprot csky: remove unused including <linux/version.h> csky: Fix a size determination in gpr_get() csky: Reconstruct VDSO framework csky: mm: abort uaccess retries upon fatal signal csky: Sync riscv mm/fault.c for easy maintenance csky: Fixup do_page_fault parent irq status csky: Add faulthandler_disabled() check csky: Fixup update_mmu_cache called with user io mapping csky: Fixup FAULT_FLAG_XXX param for handle_mm_fault csky: Add show_tlb for CPU_CK860 debug csky: Fix TLB maintenance synchronization problem csky: Add kmemleak support ...
2 parents 7d19ea5 + 6607aa6 commit cd27845

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1347
-992
lines changed

arch/csky/Kconfig

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config CSKY
77
select ARCH_HAS_SYNC_DMA_FOR_CPU
88
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
99
select ARCH_USE_BUILTIN_BSWAP
10-
select ARCH_USE_QUEUED_RWLOCKS if NR_CPUS>2
10+
select ARCH_USE_QUEUED_RWLOCKS
1111
select ARCH_WANT_FRAME_POINTERS if !CPU_CK610
1212
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
1313
select COMMON_CLK
@@ -35,6 +35,9 @@ config CSKY
3535
select GENERIC_IRQ_MULTI_HANDLER
3636
select GENERIC_SCHED_CLOCK
3737
select GENERIC_SMP_IDLE_THREAD
38+
select GENERIC_TIME_VSYSCALL
39+
select GENERIC_VDSO_32
40+
select GENERIC_GETTIMEOFDAY
3841
select GX6605S_TIMER if CPU_CK610
3942
select HAVE_ARCH_TRACEHOOK
4043
select HAVE_ARCH_AUDITSYSCALL
@@ -43,11 +46,14 @@ config CSKY
4346
select HAVE_CONTEXT_TRACKING
4447
select HAVE_VIRT_CPU_ACCOUNTING_GEN
4548
select HAVE_DEBUG_BUGVERBOSE
49+
select HAVE_DEBUG_KMEMLEAK
4650
select HAVE_DYNAMIC_FTRACE
4751
select HAVE_DYNAMIC_FTRACE_WITH_REGS
52+
select HAVE_GENERIC_VDSO
4853
select HAVE_FUNCTION_TRACER
4954
select HAVE_FUNCTION_GRAPH_TRACER
5055
select HAVE_FUNCTION_ERROR_INJECTION
56+
select HAVE_FUTEX_CMPXCHG if FUTEX && SMP
5157
select HAVE_FTRACE_MCOUNT_RECORD
5258
select HAVE_KERNEL_GZIP
5359
select HAVE_KERNEL_LZO
@@ -192,6 +198,22 @@ config CPU_CK860
192198
endchoice
193199

194200
choice
201+
prompt "PAGE OFFSET"
202+
default PAGE_OFFSET_80000000
203+
204+
config PAGE_OFFSET_80000000
205+
bool "PAGE OFFSET 2G (user:kernel = 2:2)"
206+
207+
config PAGE_OFFSET_A0000000
208+
bool "PAGE OFFSET 2.5G (user:kernel = 2.5:1.5)"
209+
endchoice
210+
211+
config PAGE_OFFSET
212+
hex
213+
default 0x80000000 if PAGE_OFFSET_80000000
214+
default 0xa0000000 if PAGE_OFFSET_A0000000
215+
choice
216+
195217
prompt "C-SKY PMU type"
196218
depends on PERF_EVENTS
197219
depends on CPU_CK807 || CPU_CK810 || CPU_CK860

arch/csky/abiv1/inc/abi/cacheflush.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#ifndef __ABI_CSKY_CACHEFLUSH_H
54
#define __ABI_CSKY_CACHEFLUSH_H

arch/csky/abiv1/inc/abi/ckmmu.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#ifndef __ASM_CSKY_CKMMUV1_H
54
#define __ASM_CSKY_CKMMUV1_H
@@ -89,13 +88,14 @@ static inline void tlb_invalid_indexed(void)
8988
cpwcr("cpcr8", 0x02000000);
9089
}
9190

92-
static inline void setup_pgd(unsigned long pgd, bool kernel)
91+
static inline void setup_pgd(pgd_t *pgd, int asid)
9392
{
94-
cpwcr("cpcr29", pgd | BIT(0));
93+
cpwcr("cpcr29", __pa(pgd) | BIT(0));
94+
write_mmu_entryhi(asid);
9595
}
9696

97-
static inline unsigned long get_pgd(void)
97+
static inline pgd_t *get_pgd(void)
9898
{
99-
return cprcr("cpcr29") & ~BIT(0);
99+
return __va(cprcr("cpcr29") & ~BIT(0));
100100
}
101101
#endif /* __ASM_CSKY_CKMMUV1_H */

arch/csky/abiv1/inc/abi/entry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#ifndef __ASM_CSKY_ENTRY_H
54
#define __ASM_CSKY_ENTRY_H

arch/csky/abiv1/inc/abi/page.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#include <asm/shmparam.h>
54

arch/csky/abiv1/inc/abi/pgtable-bits.h

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,49 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#ifndef __ASM_CSKY_PGTABLE_BITS_H
54
#define __ASM_CSKY_PGTABLE_BITS_H
65

76
/* implemented in software */
8-
#define _PAGE_ACCESSED (1<<3)
9-
#define PAGE_ACCESSED_BIT (3)
10-
7+
#define _PAGE_PRESENT (1<<0)
118
#define _PAGE_READ (1<<1)
129
#define _PAGE_WRITE (1<<2)
13-
#define _PAGE_PRESENT (1<<0)
14-
10+
#define _PAGE_ACCESSED (1<<3)
1511
#define _PAGE_MODIFIED (1<<4)
16-
#define PAGE_MODIFIED_BIT (4)
1712

1813
/* implemented in hardware */
1914
#define _PAGE_GLOBAL (1<<6)
20-
2115
#define _PAGE_VALID (1<<7)
22-
#define PAGE_VALID_BIT (7)
23-
2416
#define _PAGE_DIRTY (1<<8)
25-
#define PAGE_DIRTY_BIT (8)
2617

2718
#define _PAGE_CACHE (3<<9)
2819
#define _PAGE_UNCACHE (2<<9)
2920
#define _PAGE_SO _PAGE_UNCACHE
30-
3121
#define _CACHE_MASK (7<<9)
3222

33-
#define _CACHE_CACHED (_PAGE_VALID | _PAGE_CACHE)
34-
#define _CACHE_UNCACHED (_PAGE_VALID | _PAGE_UNCACHE)
23+
#define _CACHE_CACHED _PAGE_CACHE
24+
#define _CACHE_UNCACHED _PAGE_UNCACHE
25+
26+
#define _PAGE_PROT_NONE _PAGE_READ
27+
28+
/*
29+
* Encode and decode a swap entry
30+
*
31+
* Format of swap PTE:
32+
* bit 0: _PAGE_PRESENT (zero)
33+
* bit 1: _PAGE_READ (zero)
34+
* bit 2 - 5: swap type[0 - 3]
35+
* bit 6: _PAGE_GLOBAL (zero)
36+
* bit 7: _PAGE_VALID (zero)
37+
* bit 8: swap type[4]
38+
* bit 9 - 31: swap offset
39+
*/
40+
#define __swp_type(x) ((((x).val >> 2) & 0xf) | \
41+
(((x).val >> 4) & 0x10))
42+
#define __swp_offset(x) ((x).val >> 9)
43+
#define __swp_entry(type, offset) ((swp_entry_t) { \
44+
((type & 0xf) << 2) | \
45+
((type & 0x10) << 4) | \
46+
((offset) << 9)})
3547

3648
#define HAVE_ARCH_UNMAPPED_AREA
3749

arch/csky/abiv1/inc/abi/reg_ops.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#ifndef __ABI_REG_OPS_H
54
#define __ABI_REG_OPS_H

arch/csky/abiv1/inc/abi/regdef.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#ifndef __ASM_CSKY_REGDEF_H
54
#define __ASM_CSKY_REGDEF_H
65

6+
#ifdef __ASSEMBLY__
77
#define syscallid r1
8+
#else
9+
#define syscallid "r1"
10+
#endif
11+
812
#define regs_syscallid(regs) regs->regs[9]
913
#define regs_fp(regs) regs->regs[2]
1014

arch/csky/abiv1/inc/abi/string.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#ifndef __ABI_CSKY_STRING_H
54
#define __ABI_CSKY_STRING_H

arch/csky/abiv1/inc/abi/switch_context.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
32

43
#ifndef __ABI_CSKY_PTRACE_H
54
#define __ABI_CSKY_PTRACE_H

0 commit comments

Comments
 (0)