<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/riscv/kernel/entry.S, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-04-16T09:49:30Z</updated>
<entry>
<title>riscv,entry: fix misaligned base for excp_vect_table</title>
<updated>2021-04-16T09:49:30Z</updated>
<author>
<name>Zihao Yu</name>
</author>
<published>2021-03-17T08:17:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4f17a45f8e35068cfb25c66fdd85606962a3a448'/>
<id>urn:sha1:4f17a45f8e35068cfb25c66fdd85606962a3a448</id>
<content type='text'>
[ Upstream commit ac8d0b901f0033b783156ab2dc1a0e73ec42409b ]

In RV64, the size of each entry in excp_vect_table is 8 bytes. If the
base of the table is not 8-byte aligned, loading an entry in the table
will raise a misaligned exception. Although such exception will be
handled by opensbi/bbl, this still causes performance degradation.

Signed-off-by: Zihao Yu &lt;yuzihao@ict.ac.cn&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>riscv: Avoid interrupts being erroneously enabled in handle_exception()</title>
<updated>2019-10-11T16:21:29Z</updated>
<author>
<name>Vincent Chen</name>
</author>
<published>2019-09-16T08:47:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d286a37471b6a72908d1a0214c79fb16e958a28e'/>
<id>urn:sha1:d286a37471b6a72908d1a0214c79fb16e958a28e</id>
<content type='text'>
[ Upstream commit c82dd6d078a2bb29d41eda032bb96d05699a524d ]

When the handle_exception function addresses an exception, the interrupts
will be unconditionally enabled after finishing the context save. However,
It may erroneously enable the interrupts if the interrupts are disabled
before entering the handle_exception.

For example, one of the WARN_ON() condition is satisfied in the scheduling
where the interrupt is disabled and rq.lock is locked. The WARN_ON will
trigger a break exception and the handle_exception function will enable the
interrupts before entering do_trap_break function. During the procedure, if
a timer interrupt is pending, it will be taken when interrupts are enabled.
In this case, it may cause a deadlock problem if the rq.lock is locked
again in the timer ISR.

Hence, the handle_exception() can only enable interrupts when the state of
sstatus.SPIE is 1.

This patch is tested on HiFive Unleashed board.

Signed-off-by: Vincent Chen &lt;vincent.chen@sifive.com&gt;
Reviewed-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
[paul.walmsley@sifive.com: updated to apply]
Fixes: bcae803a21317 ("RISC-V: Enable IRQ during exception handling")
Cc: David Abdurachmanov &lt;david.abdurachmanov@sifive.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>RISC-V: implement low-level interrupt handling</title>
<updated>2018-08-13T15:31:31Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2018-08-04T08:23:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ea0f26a7913b2a72f9cbe84e77ad2cbeaaa9dde'/>
<id>urn:sha1:6ea0f26a7913b2a72f9cbe84e77ad2cbeaaa9dde</id>
<content type='text'>
Add support for a routine that dispatches exceptions with the interrupt
flags set to either the IPI or irqdomain code (and the clock source in the
future).

Loosely based on the irq-riscv-int.c irqchip driver from the RISC-V tree.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler</title>
<updated>2018-03-14T20:46:29Z</updated>
<author>
<name>Palmer Dabbelt</name>
</author>
<published>2018-03-07T23:57:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc6c98485f8e61fb3d6c51821fc75384e5a3a9c3'/>
<id>urn:sha1:cc6c98485f8e61fb3d6c51821fc75384e5a3a9c3</id>
<content type='text'>
The existing mechanism for handling IRQs on RISC-V is pretty ugly: the irq
entry code selects the handler via Kconfig dependencies.

Use the new generic IRQ handling infastructure, which allows boot time
registration of the low level entry handler.

This does add an additional load to the interrupt latency, but there's a
lot of tuning left to be done there on RISC-V so it's OK for now.

Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Stafford Horne &lt;shorne@gmail.com&gt;
Cc: jonas@southpole.se
Cc: catalin.marinas@arm.com
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: linux@armlinux.org.uk
Cc: stefan.kristiansson@saunalahti.fi
Cc: openrisc@lists.librecores.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lkml.kernel.org/r/20180307235731.22627-3-palmer@sifive.com

</content>
</entry>
<entry>
<title>RISC-V: Enable IRQ during exception handling</title>
<updated>2018-02-20T18:56:14Z</updated>
<author>
<name>zongbox@gmail.com</name>
</author>
<published>2018-01-30T07:51:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bcae803a213172c79ab5d077f169e3428e44d2ba'/>
<id>urn:sha1:bcae803a213172c79ab5d077f169e3428e44d2ba</id>
<content type='text'>
Interrupt is allowed during exception handling.
There are warning messages if the kernel enables the configuration
'CONFIG_DEBUG_ATOMIC_SLEEP=y'.

BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:23
in_atomic(): 0, irqs_disabled(): 1, pid: 43, name: ash
CPU: 0 PID: 43 Comm: ash Tainted:  G	 W	 4.15.0-rc8-00089-g89ffdae-dirty #17
Call Trace:
[&lt;000000009abb1587&gt;] walk_stackframe+0x0/0x7a
[&lt;00000000d4f3d088&gt;] ___might_sleep+0x102/0x11a
[&lt;00000000b1fd792a&gt;] down_read+0x18/0x28
[&lt;000000000289ec01&gt;] do_page_fault+0x86/0x2f6
[&lt;00000000012441f6&gt;] _do_fork+0x1b4/0x1e0
[&lt;00000000f46c3e3b&gt;] ret_from_syscall+0xa/0xe

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Zong Li &lt;zong@andestech.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@dabbelt.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>riscv: disable SUM in the exception handler</title>
<updated>2018-01-31T03:12:38Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2018-01-04T18:55:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe9b842f72921fb18b93cf47a255f374289ef242'/>
<id>urn:sha1:fe9b842f72921fb18b93cf47a255f374289ef242</id>
<content type='text'>
The SUM bit is enabled at the beginning of the copy_{to,from}_user and
{get,put}_user routines, and cleared before they return.  But these user
copy helper can be interrupted by exceptions, in which case the SUM bit
will remain set, which leads to elevated privileges for the code running
in exception context, as that can now access userspace address space
unconditionally.  This frequently happens when the user copy routines
access freshly allocated user memory that hasn't been faulted in, and a
pagefault needs to be taken before the user copy routines can continue.

Fix this by unconditionally clearing SUM when the exception handler is
called - the restore code will automatically restore it based on the
saved value.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>riscv: rename SR_* constants to match the spec</title>
<updated>2018-01-07T23:14:39Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2018-01-04T17:35:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1125203c13b9da32125e171b4bd75e93d4918ddd'/>
<id>urn:sha1:1125203c13b9da32125e171b4bd75e93d4918ddd</id>
<content type='text'>
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: Task implementation</title>
<updated>2017-09-26T22:26:46Z</updated>
<author>
<name>Palmer Dabbelt</name>
</author>
<published>2017-07-11T01:04:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7db91e57a0acde126a162ababfb1e0ab190130cb'/>
<id>urn:sha1:7db91e57a0acde126a162ababfb1e0ab190130cb</id>
<content type='text'>
This patch contains the implementation of tasks on RISC-V, most of which
is involved in task switching.

Signed-off-by: Palmer Dabbelt &lt;palmer@dabbelt.com&gt;
</content>
</entry>
</feed>
