Skip to content

Commit 768fc66

Browse files
committed
Merge tag 'riscv/for-v5.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Paul Walmsley: "Several fixes for RISC-V: - Fix function graph trace support - Prefix the CSR IRQ_* macro names with "RV_", to avoid collisions with macros elsewhere in the Linux kernel tree named "IRQ_TIMER" - Use __pa_symbol() when computing the physical address of a kernel symbol, rather than __pa() - Mark the RISC-V port as supporting GCOV One DT addition: - Describe the L2 cache controller in the FU540 DT file One documentation update: - Add patch acceptance guideline documentation" * tag 'riscv/for-v5.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: Documentation: riscv: add patch acceptance guidelines riscv: prefix IRQ_ macro names with an RV_ namespace clocksource: riscv: add notrace to riscv_sched_clock riscv: ftrace: correct the condition logic in function graph tracer riscv: dts: Add DT support for SiFive L2 cache controller riscv: gcov: enable gcov for RISC-V riscv: mm: use __pa_symbol for kernel symbols
2 parents 3648790 + 0e194d9 commit 768fc66

File tree

13 files changed

+76
-22
lines changed

13 files changed

+76
-22
lines changed

Documentation/features/debug/gcov-profile-all/arch-support.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
| openrisc: | TODO |
2424
| parisc: | TODO |
2525
| powerpc: | ok |
26-
| riscv: | TODO |
26+
| riscv: | ok |
2727
| s390: | ok |
2828
| sh: | ok |
2929
| sparc: | TODO |

Documentation/process/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ lack of a better place.
6060
volatile-considered-harmful
6161
botching-up-ioctls
6262
clang-format
63+
../riscv/patch-acceptance
6364

6465
.. only:: subproject and html
6566

Documentation/riscv/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RISC-V architecture
77

88
boot-image-header
99
pmu
10+
patch-acceptance
1011

1112
.. only:: subproject and html
1213

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
arch/riscv maintenance guidelines for developers
4+
================================================
5+
6+
Overview
7+
--------
8+
The RISC-V instruction set architecture is developed in the open:
9+
in-progress drafts are available for all to review and to experiment
10+
with implementations. New module or extension drafts can change
11+
during the development process - sometimes in ways that are
12+
incompatible with previous drafts. This flexibility can present a
13+
challenge for RISC-V Linux maintenance. Linux maintainers disapprove
14+
of churn, and the Linux development process prefers well-reviewed and
15+
tested code over experimental code. We wish to extend these same
16+
principles to the RISC-V-related code that will be accepted for
17+
inclusion in the kernel.
18+
19+
Submit Checklist Addendum
20+
-------------------------
21+
We'll only accept patches for new modules or extensions if the
22+
specifications for those modules or extensions are listed as being
23+
"Frozen" or "Ratified" by the RISC-V Foundation. (Developers may, of
24+
course, maintain their own Linux kernel trees that contain code for
25+
any draft extensions that they wish.)
26+
27+
Additionally, the RISC-V specification allows implementors to create
28+
their own custom extensions. These custom extensions aren't required
29+
to go through any review or ratification process by the RISC-V
30+
Foundation. To avoid the maintenance complexity and potential
31+
performance impact of adding kernel code for implementor-specific
32+
RISC-V extensions, we'll only to accept patches for extensions that
33+
have been officially frozen or ratified by the RISC-V Foundation.
34+
(Implementors, may, of course, maintain their own Linux kernel trees
35+
containing code for any custom extensions that they wish.)

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14121,6 +14121,7 @@ M: Paul Walmsley <[email protected]>
1412114121
M: Palmer Dabbelt <[email protected]>
1412214122
M: Albert Ou <[email protected]>
1412314123
14124+
P: Documentation/riscv/patch-acceptance.rst
1412414125
T: git git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git
1412514126
S: Supported
1412614127
F: arch/riscv/

arch/riscv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ config RISCV
6464
select SPARSEMEM_STATIC if 32BIT
6565
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
6666
select HAVE_ARCH_MMAP_RND_BITS if MMU
67+
select ARCH_HAS_GCOV_PROFILE_ALL
6768

6869
config ARCH_MMAP_RND_BITS_MIN
6970
default 18 if 64BIT

arch/riscv/boot/dts/sifive/fu540-c000.dtsi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
reg = <1>;
5555
riscv,isa = "rv64imafdc";
5656
tlb-split;
57+
next-level-cache = <&l2cache>;
5758
cpu1_intc: interrupt-controller {
5859
#interrupt-cells = <1>;
5960
compatible = "riscv,cpu-intc";
@@ -77,6 +78,7 @@
7778
reg = <2>;
7879
riscv,isa = "rv64imafdc";
7980
tlb-split;
81+
next-level-cache = <&l2cache>;
8082
cpu2_intc: interrupt-controller {
8183
#interrupt-cells = <1>;
8284
compatible = "riscv,cpu-intc";
@@ -100,6 +102,7 @@
100102
reg = <3>;
101103
riscv,isa = "rv64imafdc";
102104
tlb-split;
105+
next-level-cache = <&l2cache>;
103106
cpu3_intc: interrupt-controller {
104107
#interrupt-cells = <1>;
105108
compatible = "riscv,cpu-intc";
@@ -123,6 +126,7 @@
123126
reg = <4>;
124127
riscv,isa = "rv64imafdc";
125128
tlb-split;
129+
next-level-cache = <&l2cache>;
126130
cpu4_intc: interrupt-controller {
127131
#interrupt-cells = <1>;
128132
compatible = "riscv,cpu-intc";
@@ -253,6 +257,17 @@
253257
#pwm-cells = <3>;
254258
status = "disabled";
255259
};
260+
l2cache: cache-controller@2010000 {
261+
compatible = "sifive,fu540-c000-ccache", "cache";
262+
cache-block-size = <64>;
263+
cache-level = <2>;
264+
cache-sets = <1024>;
265+
cache-size = <2097152>;
266+
cache-unified;
267+
interrupt-parent = <&plic0>;
268+
interrupts = <1 2 3>;
269+
reg = <0x0 0x2010000 0x0 0x1000>;
270+
};
256271

257272
};
258273
};

arch/riscv/include/asm/csr.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@
116116
# define SR_PIE SR_MPIE
117117
# define SR_PP SR_MPP
118118

119-
# define IRQ_SOFT IRQ_M_SOFT
120-
# define IRQ_TIMER IRQ_M_TIMER
121-
# define IRQ_EXT IRQ_M_EXT
119+
# define RV_IRQ_SOFT IRQ_M_SOFT
120+
# define RV_IRQ_TIMER IRQ_M_TIMER
121+
# define RV_IRQ_EXT IRQ_M_EXT
122122
#else /* CONFIG_RISCV_M_MODE */
123123
# define CSR_STATUS CSR_SSTATUS
124124
# define CSR_IE CSR_SIE
@@ -133,15 +133,15 @@
133133
# define SR_PIE SR_SPIE
134134
# define SR_PP SR_SPP
135135

136-
# define IRQ_SOFT IRQ_S_SOFT
137-
# define IRQ_TIMER IRQ_S_TIMER
138-
# define IRQ_EXT IRQ_S_EXT
136+
# define RV_IRQ_SOFT IRQ_S_SOFT
137+
# define RV_IRQ_TIMER IRQ_S_TIMER
138+
# define RV_IRQ_EXT IRQ_S_EXT
139139
#endif /* CONFIG_RISCV_M_MODE */
140140

141141
/* IE/IP (Supervisor/Machine Interrupt Enable/Pending) flags */
142-
#define IE_SIE (_AC(0x1, UL) << IRQ_SOFT)
143-
#define IE_TIE (_AC(0x1, UL) << IRQ_TIMER)
144-
#define IE_EIE (_AC(0x1, UL) << IRQ_EXT)
142+
#define IE_SIE (_AC(0x1, UL) << RV_IRQ_SOFT)
143+
#define IE_TIE (_AC(0x1, UL) << RV_IRQ_TIMER)
144+
#define IE_EIE (_AC(0x1, UL) << RV_IRQ_EXT)
145145

146146
#ifndef __ASSEMBLY__
147147

arch/riscv/kernel/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
142142
*/
143143
old = *parent;
144144

145-
if (function_graph_enter(old, self_addr, frame_pointer, parent))
145+
if (!function_graph_enter(old, self_addr, frame_pointer, parent))
146146
*parent = return_hooker;
147147
}
148148

arch/riscv/kernel/irq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ asmlinkage __visible void __irq_entry do_IRQ(struct pt_regs *regs)
2323

2424
irq_enter();
2525
switch (regs->cause & ~CAUSE_IRQ_FLAG) {
26-
case IRQ_TIMER:
26+
case RV_IRQ_TIMER:
2727
riscv_timer_interrupt();
2828
break;
2929
#ifdef CONFIG_SMP
30-
case IRQ_SOFT:
30+
case RV_IRQ_SOFT:
3131
/*
3232
* We only use software interrupts to pass IPIs, so if a non-SMP
3333
* system gets one, then we don't know what to do.
3434
*/
3535
riscv_software_interrupt();
3636
break;
3737
#endif
38-
case IRQ_EXT:
38+
case RV_IRQ_EXT:
3939
handle_arch_irq(regs);
4040
break;
4141
default:

0 commit comments

Comments
 (0)