History

Merge tag 'riscv/for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Paul Walmsley: "One fix for PCIe users: - Fix legacy PCI I/O port access emulation One set of cleanups: - Resolve most of the warnings generated by sparse across arch/riscv. No functional changes And one MAINTAINERS update: - Update Palmer's E-mail address" * tag 'riscv/for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: MAINTAINERS: Change to my personal email address RISC-V: Add PCIe I/O BAR memory mapping riscv: for C functions called only from assembly, mark with __visible riscv: fp: add missing __user pointer annotations riscv: add missing header file includes riscv: mark some code and data as file-static riscv: init: merge split string literals in preprocessor directive riscv: add prototypes for assembly language functions from head.S

Linus Torvalds committed 7 years ago

Commit e5897c72 parents 31408fb 1d9b0b624 files · +75 −18Browse files

Unified · Split

24 files
  1. MAINTAINERS +3 −3
  2. arch/riscv/include/asm/io.h +7 −0
  3. arch/riscv/include/asm/irq.h +3 −0
  4. arch/riscv/include/asm/pgtable.h +6 −1
  5. arch/riscv/include/asm/switch_to.h +1 −0
  6. arch/riscv/kernel/cpufeature.c +1 −0
  7. arch/riscv/kernel/head.h +21 −0
  8. arch/riscv/kernel/irq.c +1 −1
  9. arch/riscv/kernel/module-sections.c +1 −0
  10. arch/riscv/kernel/process.c +2 −0
  11. arch/riscv/kernel/ptrace.c +2 −2
  12. arch/riscv/kernel/reset.c +1 −0
  13. arch/riscv/kernel/setup.c +2 −0
  14. arch/riscv/kernel/signal.c +4 −4
  15. arch/riscv/kernel/smp.c +2 −0
  16. arch/riscv/kernel/smpboot.c +4 −1
  17. arch/riscv/kernel/syscall_table.c +1 −0
  18. arch/riscv/kernel/time.c +1 −0
  19. arch/riscv/kernel/traps.c +3 −2
  20. arch/riscv/kernel/vdso.c +2 −1
  21. arch/riscv/mm/context.c +1 −0
  22. arch/riscv/mm/fault.c +2 −0
  23. arch/riscv/mm/init.c +3 −2
  24. arch/riscv/mm/sifive_l2_cache.c +1 −1
MAINTAINERS+3−3
@@ -13906,7 +13906,7 @@ F: drivers/mtd/nand/raw/r852.h · 13905 unmodified lines
1390613906
1390713907 RISC-V ARCHITECTURE
1390813908 M: Paul Walmsley <paul.walmsley@sifive.com>
13909−M: Palmer Dabbelt <palmer@sifive.com>
13909+M: Palmer Dabbelt <palmer@dabbelt.com>
1391013910 M: Albert Ou <aou@eecs.berkeley.edu>
1391113911 L: linux-riscv@lists.infradead.org
1391213912 T: git git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git
@@ -14783,7 +14783,7 @@ F: drivers/media/usb/siano/ · 870 unmodified lines
1478314783 F: drivers/media/mmc/siano/
1478414784
1478514785 SIFIVE DRIVERS
14786−M: Palmer Dabbelt <palmer@sifive.com>
14786+M: Palmer Dabbelt <palmer@dabbelt.com>
1478714787 M: Paul Walmsley <paul.walmsley@sifive.com>
1478814788 L: linux-riscv@lists.infradead.org
1478914789 T: git git://github.com/sifive/riscv-linux.git
@@ -14793,7 +14793,7 @@ N: sifive · 3 unmodified lines
1479314793
1479414794 SIFIVE FU540 SYSTEM-ON-CHIP
1479514795 M: Paul Walmsley <paul.walmsley@sifive.com>
14796−M: Palmer Dabbelt <palmer@sifive.com>
14796+M: Palmer Dabbelt <palmer@dabbelt.com>
1479714797 L: linux-riscv@lists.infradead.org
1479814798 T: git git://git.kernel.org/pub/scm/linux/kernel/git/pjw/sifive.git
1479914799 S: Supported
arch/riscv/include/asm/io.h+7−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313
1414 #include <linux/types.h>
1515 #include <asm/mmiowb.h>
16+#include <asm/pgtable.h>
1617
1718 extern void __iomem *ioremap(phys_addr_t offset, unsigned long size);
1819
@@ -161,6 +162,12 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) · 142 unmodified lines
161162 #define writeq(v,c) ({ __io_bw(); writeq_cpu((v),(c)); __io_aw(); })
162163 #endif
163164
165+/*
166+ * I/O port access constants.
167+ */
168+#define IO_SPACE_LIMIT (PCI_IO_SIZE - 1)
169+#define PCI_IOBASE ((void __iomem *)PCI_IO_START)
170+
164171 /*
165172 * Emulation routines for the port-mapped IO space used by some PCI drivers.
166173 * These are defined as being "fully synchronous", but also "not guaranteed to
arch/riscv/include/asm/irq.h+3−0
@@ -7,6 +7,9 @@ · 6 unmodified lines
77 #ifndef _ASM_RISCV_IRQ_H
88 #define _ASM_RISCV_IRQ_H
99
10+#include <linux/interrupt.h>
11+#include <linux/linkage.h>
12+
1013 #define NR_IRQS 0
1114
1215 void riscv_timer_interrupt(void);
arch/riscv/include/asm/pgtable.h+6−1
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #define _ASM_RISCV_PGTABLE_H
88
99 #include <linux/mmzone.h>
10+#include <linux/sizes.h>
1011
1112 #include <asm/pgtable-bits.h>
1213
@@ -86,6 +87,7 @@ extern pgd_t swapper_pg_dir[]; · 73 unmodified lines
8687 #define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
8788 #define VMALLOC_END (PAGE_OFFSET - 1)
8889 #define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE)
90+#define PCI_IO_SIZE SZ_16M
8991
9092 /*
9193 * Roughly size the vmemmap space to be large enough to fit enough
@@ -100,7 +102,10 @@ extern pgd_t swapper_pg_dir[]; · 8 unmodified lines
100102
101103 #define vmemmap ((struct page *)VMEMMAP_START)
102104
103−#define FIXADDR_TOP (VMEMMAP_START)
105+#define PCI_IO_END VMEMMAP_START
106+#define PCI_IO_START (PCI_IO_END - PCI_IO_SIZE)
107+#define FIXADDR_TOP PCI_IO_START
108+
104109 #ifdef CONFIG_64BIT
105110 #define FIXADDR_SIZE PMD_SIZE
106111 #else
arch/riscv/include/asm/switch_to.h+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #ifndef _ASM_RISCV_SWITCH_TO_H
77 #define _ASM_RISCV_SWITCH_TO_H
88
9+#include <linux/sched/task_stack.h>
910 #include <asm/processor.h>
1011 #include <asm/ptrace.h>
1112 #include <asm/csr.h>
arch/riscv/kernel/cpufeature.c+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <asm/processor.h>
1111 #include <asm/hwcap.h>
1212 #include <asm/smp.h>
13+#include <asm/switch_to.h>
1314
1415 unsigned long elf_hwcap __read_mostly;
1516 #ifdef CONFIG_FPU
arch/riscv/kernel/head.h+21−0
@@ -0,0 +1,21 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (C) 2019 SiFive, Inc.
4+ */
5+#ifndef __ASM_HEAD_H
6+#define __ASM_HEAD_H
7+
8+#include <linux/linkage.h>
9+#include <linux/init.h>
10+
11+extern atomic_t hart_lottery;
12+
13+asmlinkage void do_page_fault(struct pt_regs *regs);
14+asmlinkage void __init setup_vm(uintptr_t dtb_pa);
15+
16+extern void *__cpu_up_stack_pointer[];
17+extern void *__cpu_up_task_pointer[];
18+
19+void __init parse_dtb(void);
20+
21+#endif /* __ASM_HEAD_H */
arch/riscv/kernel/irq.c+1−1
@@ -24,7 +24,7 @@ int arch_show_interrupts(struct seq_file *p, int prec) · 23 unmodified lines
2424 return 0;
2525 }
2626
27−asmlinkage void __irq_entry do_IRQ(struct pt_regs *regs)
27+asmlinkage __visible void __irq_entry do_IRQ(struct pt_regs *regs)
2828 {
2929 struct pt_regs *old_regs = set_irq_regs(regs);
3030
arch/riscv/kernel/module-sections.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/elf.h>
99 #include <linux/kernel.h>
1010 #include <linux/module.h>
11+#include <linux/moduleloader.h>
1112
1213 unsigned long module_emit_got_entry(struct module *mod, unsigned long val)
1314 {
arch/riscv/kernel/process.c+2−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 * Copyright (C) 2017 SiFive
88 */
99
10+#include <linux/cpu.h>
1011 #include <linux/kernel.h>
1112 #include <linux/sched.h>
1213 #include <linux/sched/task_stack.h>
@@ -19,6 +20,7 @@ · 6 unmodified lines
1920 #include <asm/csr.h>
2021 #include <asm/string.h>
2122 #include <asm/switch_to.h>
23+#include <asm/thread_info.h>
2224
2325 extern asmlinkage void ret_from_fork(void);
2426 extern asmlinkage void ret_from_kernel_thread(void);
arch/riscv/kernel/ptrace.c+2−2
@@ -148,7 +148,7 @@ long arch_ptrace(struct task_struct *child, long request, · 147 unmodified lines
148148 * Allows PTRACE_SYSCALL to work. These are called from entry.S in
149149 * {handle,ret_from}_syscall.
150150 */
151−void do_syscall_trace_enter(struct pt_regs *regs)
151+__visible void do_syscall_trace_enter(struct pt_regs *regs)
152152 {
153153 if (test_thread_flag(TIF_SYSCALL_TRACE))
154154 if (tracehook_report_syscall_entry(regs))
@@ -162,7 +162,7 @@ void do_syscall_trace_enter(struct pt_regs *regs) · 7 unmodified lines
162162 audit_syscall_entry(regs->a7, regs->a0, regs->a1, regs->a2, regs->a3);
163163 }
164164
165−void do_syscall_trace_exit(struct pt_regs *regs)
165+__visible void do_syscall_trace_exit(struct pt_regs *regs)
166166 {
167167 audit_syscall_exit(regs);
168168
arch/riscv/kernel/reset.c+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 */
55
66 #include <linux/reboot.h>
7+#include <linux/pm.h>
78 #include <asm/sbi.h>
89
910 static void default_power_off(void)
arch/riscv/kernel/setup.c+2−0
@@ -24,6 +24,8 @@ · 23 unmodified lines
2424 #include <asm/tlbflush.h>
2525 #include <asm/thread_info.h>
2626
27+#include "head.h"
28+
2729 #ifdef CONFIG_DUMMY_CONSOLE
2830 struct screen_info screen_info = {
2931 .orig_video_lines = 30,
arch/riscv/kernel/signal.c+4−4
@@ -26,7 +26,7 @@ struct rt_sigframe { · 25 unmodified lines
2626
2727 #ifdef CONFIG_FPU
2828 static long restore_fp_state(struct pt_regs *regs,
29− union __riscv_fp_state *sc_fpregs)
29+ union __riscv_fp_state __user *sc_fpregs)
3030 {
3131 long err;
3232 struct __riscv_d_ext_state __user *state = &sc_fpregs->d;
@@ -53,7 +53,7 @@ static long restore_fp_state(struct pt_regs *regs, · 20 unmodified lines
5353 }
5454
5555 static long save_fp_state(struct pt_regs *regs,
56− union __riscv_fp_state *sc_fpregs)
56+ union __riscv_fp_state __user *sc_fpregs)
5757 {
5858 long err;
5959 struct __riscv_d_ext_state __user *state = &sc_fpregs->d;
@@ -292,8 +292,8 @@ static void do_signal(struct pt_regs *regs) · 232 unmodified lines
292292 * notification of userspace execution resumption
293293 * - triggered by the _TIF_WORK_MASK flags
294294 */
295−asmlinkage void do_notify_resume(struct pt_regs *regs,
296− unsigned long thread_info_flags)
295+asmlinkage __visible void do_notify_resume(struct pt_regs *regs,
296+ unsigned long thread_info_flags)
297297 {
298298 /* Handle pending signal delivery */
299299 if (thread_info_flags & _TIF_SIGPENDING)
arch/riscv/kernel/smp.c+2−0
@@ -8,7 +8,9 @@ · 7 unmodified lines
88 * Copyright (C) 2017 SiFive
99 */
1010
11+#include <linux/cpu.h>
1112 #include <linux/interrupt.h>
13+#include <linux/profile.h>
1214 #include <linux/smp.h>
1315 #include <linux/sched.h>
1416 #include <linux/seq_file.h>
arch/riscv/kernel/smpboot.c+4−1
@@ -29,6 +29,9 @@ · 28 unmodified lines
2929 #include <asm/tlbflush.h>
3030 #include <asm/sections.h>
3131 #include <asm/sbi.h>
32+#include <asm/smp.h>
33+
34+#include "head.h"
3235
3336 void *__cpu_up_stack_pointer[NR_CPUS];
3437 void *__cpu_up_task_pointer[NR_CPUS];
@@ -130,7 +133,7 @@ void __init smp_cpus_done(unsigned int max_cpus) · 95 unmodified lines
130133 /*
131134 * C entry point for a secondary processor.
132135 */
133−asmlinkage void __init smp_callin(void)
136+asmlinkage __visible void __init smp_callin(void)
134137 {
135138 struct mm_struct *mm = &init_mm;
136139
arch/riscv/kernel/syscall_table.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/syscalls.h>
99 #include <asm-generic/syscalls.h>
1010 #include <asm/vdso.h>
11+#include <asm/syscall.h>
1112
1213 #undef __SYSCALL
1314 #define __SYSCALL(nr, call) [nr] = (call),
arch/riscv/kernel/time.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/clocksource.h>
88 #include <linux/delay.h>
99 #include <asm/sbi.h>
10+#include <asm/processor.h>
1011
1112 unsigned long riscv_timebase;
1213 EXPORT_SYMBOL_GPL(riscv_timebase);
arch/riscv/kernel/traps.c+3−2
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 * Copyright (C) 2012 Regents of the University of California
44 */
55
6+#include <linux/cpu.h>
67 #include <linux/kernel.h>
78 #include <linux/init.h>
89 #include <linux/sched.h>
@@ -83,7 +84,7 @@ static void do_trap_error(struct pt_regs *regs, int signo, int code, · 74 unmodified lines
8384 }
8485
8586 #define DO_ERROR_INFO(name, signo, code, str) \
86−asmlinkage void name(struct pt_regs *regs) \
87+asmlinkage __visible void name(struct pt_regs *regs) \
8788 { \
8889 do_trap_error(regs, signo, code, regs->sepc, "Oops - " str); \
8990 }
@@ -120,7 +121,7 @@ static inline unsigned long get_break_insn_length(unsigned long pc) · 30 unmodified lines
120121 return (((insn & __INSN_LENGTH_MASK) == __INSN_LENGTH_32) ? 4UL : 2UL);
121122 }
122123
123−asmlinkage void do_trap_break(struct pt_regs *regs)
124+asmlinkage __visible void do_trap_break(struct pt_regs *regs)
124125 {
125126 if (user_mode(regs))
126127 force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->sepc);
arch/riscv/kernel/vdso.c+2−1
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 * Copyright (C) 2015 Regents of the University of California
77 */
88
9+#include <linux/elf.h>
910 #include <linux/mm.h>
1011 #include <linux/slab.h>
1112 #include <linux/binfmts.h>
@@ -25,7 +26,7 @@ static union { · 13 unmodified lines
2526 struct vdso_data data;
2627 u8 page[PAGE_SIZE];
2728 } vdso_data_store __page_aligned_data;
28−struct vdso_data *vdso_data = &vdso_data_store.data;
29+static struct vdso_data *vdso_data = &vdso_data_store.data;
2930
3031 static int __init vdso_init(void)
3132 {
arch/riscv/mm/context.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/mm.h>
88 #include <asm/tlbflush.h>
99 #include <asm/cacheflush.h>
10+#include <asm/mmu_context.h>
1011
1112 /*
1213 * When necessary, performs a deferred icache flush for the given MM context,
arch/riscv/mm/fault.c+2−0
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 #include <asm/ptrace.h>
1919 #include <asm/tlbflush.h>
2020
21+#include "../kernel/head.h"
22+
2123 /*
2224 * This routine handles page faults. It determines the address and the
2325 * problem, and then passes it off to one of the appropriate routines.
arch/riscv/mm/init.c+3−2
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919 #include <asm/pgtable.h>
2020 #include <asm/io.h>
2121
22+#include "../kernel/head.h"
23+
2224 unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]
2325 __page_aligned_bss;
2426 EXPORT_SYMBOL(empty_zero_page);
@@ -337,8 +339,7 @@ static uintptr_t __init best_map_size(phys_addr_t base, phys_addr_t size) · 312 unmodified lines
337339 */
338340
339341 #ifndef __riscv_cmodel_medany
340−#error "setup_vm() is called from head.S before relocate so it should "
341− "not use absolute addressing."
342+#error "setup_vm() is called from head.S before relocate so it should not use absolute addressing."
342343 #endif
343344
344345 asmlinkage void __init setup_vm(uintptr_t dtb_pa)
arch/riscv/mm/sifive_l2_cache.c+1−1
@@ -142,7 +142,7 @@ static irqreturn_t l2_int_handler(int irq, void *device) · 141 unmodified lines
142142 return IRQ_HANDLED;
143143 }
144144
145−int __init sifive_l2_init(void)
145+static int __init sifive_l2_init(void)
146146 {
147147 struct device_node *np;
148148 struct resource res;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t