<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/arch/csky/kernel/entry.S, branch v5.8</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>csky: Fixup CONFIG_DEBUG_RSEQ</title>
<updated>2020-05-28T00:18:36+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-05-26T06:34:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f36e0aab6f1f78d770ce859df3f07a9c5763ce5f'/>
<id>f36e0aab6f1f78d770ce859df3f07a9c5763ce5f</id>
<content type='text'>
Put the rseq_syscall check point at the prologue of the syscall
will break the a0 ... a7. This will casue system call bug when
DEBUG_RSEQ is enabled.

So move it to the epilogue of syscall, but before syscall_trace.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Put the rseq_syscall check point at the prologue of the syscall
will break the a0 ... a7. This will casue system call bug when
DEBUG_RSEQ is enabled.

So move it to the epilogue of syscall, but before syscall_trace.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Coding convention in entry.S</title>
<updated>2020-05-28T00:18:36+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-05-24T12:14:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=20f69538b9ab7175e1474a73e2793b8278846e1e'/>
<id>20f69538b9ab7175e1474a73e2793b8278846e1e</id>
<content type='text'>
There is no fixup or feature in the patch, we only cleanup with:

 - Remove unnecessary reg used (r11, r12), just use r9 &amp; r10 &amp;
   syscallid regs as temp useage.
 - Add _TIF_SYSCALL_WORK and _TIF_WORK_MASK to gather macros.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no fixup or feature in the patch, we only cleanup with:

 - Remove unnecessary reg used (r11, r12), just use r9 &amp; r10 &amp;
   syscallid regs as temp useage.
 - Add _TIF_SYSCALL_WORK and _TIF_WORK_MASK to gather macros.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Fixup abiv2 syscall_trace break a4 &amp; a5</title>
<updated>2020-05-28T00:18:36+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-05-24T10:44:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e0bbb53843b5fdfe464b099217e3b9d97e8a75d7'/>
<id>e0bbb53843b5fdfe464b099217e3b9d97e8a75d7</id>
<content type='text'>
Current implementation could destory a4 &amp; a5 when strace, so we need to get them
from pt_regs by SAVE_ALL.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current implementation could destory a4 &amp; a5 when strace, so we need to get them
from pt_regs by SAVE_ALL.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Fixup CONFIG_PREEMPT panic</title>
<updated>2020-05-28T00:18:36+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-05-24T08:03:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=900897591b2bf01154db8f59f6ecf8d60e60f15e'/>
<id>900897591b2bf01154db8f59f6ecf8d60e60f15e</id>
<content type='text'>
log:
[    0.13373200] Calibrating delay loop...
[    0.14077600] ------------[ cut here ]------------
[    0.14116700] WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:3790 preempt_count_add+0xc8/0x11c
[    0.14348000] DEBUG_LOCKS_WARN_ON((preempt_count() &lt; 0))Modules linked in:
[    0.14395100] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0 #7
[    0.14410800]
[    0.14427400] Call Trace:
[    0.14450700] [&lt;807cd226&gt;] dump_stack+0x8a/0xe4
[    0.14473500] [&lt;80072792&gt;] __warn+0x10e/0x15c
[    0.14495900] [&lt;80072852&gt;] warn_slowpath_fmt+0x72/0xc0
[    0.14518600] [&lt;800a5240&gt;] preempt_count_add+0xc8/0x11c
[    0.14544900] [&lt;807ef918&gt;] _raw_spin_lock+0x28/0x68
[    0.14572600] [&lt;800e0eb8&gt;] vprintk_emit+0x84/0x2d8
[    0.14599000] [&lt;800e113a&gt;] vprintk_default+0x2e/0x44
[    0.14625100] [&lt;800e2042&gt;] vprintk_func+0x12a/0x1d0
[    0.14651300] [&lt;800e1804&gt;] printk+0x30/0x48
[    0.14677600] [&lt;80008052&gt;] lockdep_init+0x12/0xb0
[    0.14703800] [&lt;80002080&gt;] start_kernel+0x558/0x7f8
[    0.14730000] [&lt;800052bc&gt;] csky_start+0x58/0x94
[    0.14756600] irq event stamp: 34
[    0.14775100] hardirqs last  enabled at (33): [&lt;80067370&gt;] ret_from_exception+0x2c/0x72
[    0.14793700] hardirqs last disabled at (34): [&lt;800e0eae&gt;] vprintk_emit+0x7a/0x2d8
[    0.14812300] softirqs last  enabled at (32): [&lt;800655b0&gt;] __do_softirq+0x578/0x6d8
[    0.14830800] softirqs last disabled at (25): [&lt;8007b3b8&gt;] irq_exit+0xec/0x128

The preempt_count of reg could be destroyed after csky_do_IRQ without reload
from memory.

After reference to other architectures (arm64, riscv), we move preempt entry
into ret_from_exception and disable irq at the beginning of
ret_from_exception instead of RESTORE_ALL.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Reported-by: Lu Baoquan &lt;lu.baoquan@intellif.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
log:
[    0.13373200] Calibrating delay loop...
[    0.14077600] ------------[ cut here ]------------
[    0.14116700] WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:3790 preempt_count_add+0xc8/0x11c
[    0.14348000] DEBUG_LOCKS_WARN_ON((preempt_count() &lt; 0))Modules linked in:
[    0.14395100] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0 #7
[    0.14410800]
[    0.14427400] Call Trace:
[    0.14450700] [&lt;807cd226&gt;] dump_stack+0x8a/0xe4
[    0.14473500] [&lt;80072792&gt;] __warn+0x10e/0x15c
[    0.14495900] [&lt;80072852&gt;] warn_slowpath_fmt+0x72/0xc0
[    0.14518600] [&lt;800a5240&gt;] preempt_count_add+0xc8/0x11c
[    0.14544900] [&lt;807ef918&gt;] _raw_spin_lock+0x28/0x68
[    0.14572600] [&lt;800e0eb8&gt;] vprintk_emit+0x84/0x2d8
[    0.14599000] [&lt;800e113a&gt;] vprintk_default+0x2e/0x44
[    0.14625100] [&lt;800e2042&gt;] vprintk_func+0x12a/0x1d0
[    0.14651300] [&lt;800e1804&gt;] printk+0x30/0x48
[    0.14677600] [&lt;80008052&gt;] lockdep_init+0x12/0xb0
[    0.14703800] [&lt;80002080&gt;] start_kernel+0x558/0x7f8
[    0.14730000] [&lt;800052bc&gt;] csky_start+0x58/0x94
[    0.14756600] irq event stamp: 34
[    0.14775100] hardirqs last  enabled at (33): [&lt;80067370&gt;] ret_from_exception+0x2c/0x72
[    0.14793700] hardirqs last disabled at (34): [&lt;800e0eae&gt;] vprintk_emit+0x7a/0x2d8
[    0.14812300] softirqs last  enabled at (32): [&lt;800655b0&gt;] __do_softirq+0x578/0x6d8
[    0.14830800] softirqs last disabled at (25): [&lt;8007b3b8&gt;] irq_exit+0xec/0x128

The preempt_count of reg could be destroyed after csky_do_IRQ without reload
from memory.

After reference to other architectures (arm64, riscv), we move preempt entry
into ret_from_exception and disable irq at the beginning of
ret_from_exception instead of RESTORE_ALL.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Reported-by: Lu Baoquan &lt;lu.baoquan@intellif.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Fixup remove unnecessary save/restore PSR code</title>
<updated>2020-05-13T09:55:06+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-05-13T09:16:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9e2ca15322acc5a0a697305e02af9ce5ac881f66'/>
<id>9e2ca15322acc5a0a697305e02af9ce5ac881f66</id>
<content type='text'>
All processes' PSR could success from SETUP_MMU, so need set it
in INIT_THREAD again.

And use a3 instead of r7 in __switch_to for code convention.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All processes' PSR could success from SETUP_MMU, so need set it
in INIT_THREAD again.

And use a3 instead of r7 in __switch_to for code convention.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Fixup remove duplicate irq_disable</title>
<updated>2020-05-13T09:55:06+00:00</updated>
<author>
<name>Liu Yibin</name>
<email>jiulong@linux.alibaba.com</email>
</author>
<published>2020-05-13T07:54:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6633a5aa8eb6bda70eb3a9837efd28a67ccc6e0a'/>
<id>6633a5aa8eb6bda70eb3a9837efd28a67ccc6e0a</id>
<content type='text'>
Interrupt has been disabled in __schedule() with local_irq_disable()
and enabled in finish_task_switch-&gt;finish_lock_switch() with
local_irq_enabled(), So needn't to disable irq here.

Signed-off-by: Liu Yibin &lt;jiulong@linux.alibaba.com&gt;
Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Interrupt has been disabled in __schedule() with local_irq_disable()
and enabled in finish_task_switch-&gt;finish_lock_switch() with
local_irq_enabled(), So needn't to disable irq here.

Signed-off-by: Liu Yibin &lt;jiulong@linux.alibaba.com&gt;
Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Add uprobes support</title>
<updated>2020-04-03T03:37:51+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-04-02T11:52:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8f6bb793b2be82f1f73bfb416486f156f70b4314'/>
<id>8f6bb793b2be82f1f73bfb416486f156f70b4314</id>
<content type='text'>
This patch adds support for uprobes on csky architecture.

Just like kprobe, it support single-step and simulate instructions.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds support for uprobes on csky architecture.

Just like kprobe, it support single-step and simulate instructions.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Enable LOCKDEP_SUPPORT</title>
<updated>2020-04-02T11:39:42+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-04-02T11:39:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=000591f1ca3312d9a29e15a9e3fe5c4171f75586'/>
<id>000591f1ca3312d9a29e15a9e3fe5c4171f75586</id>
<content type='text'>
Lockdep is needed by proving the spinlocks and rwlocks. Currently,
we only put trace_hardirqs_on/off with csky_irq and
ret_from_exception.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Lockdep is needed by proving the spinlocks and rwlocks. Currently,
we only put trace_hardirqs_on/off with csky_irq and
ret_from_exception.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Add support for restartable sequence</title>
<updated>2020-03-08T12:55:14+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2019-11-05T01:58:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9866d141a0977ace974400bf1f793dfc163409ce'/>
<id>9866d141a0977ace974400bf1f793dfc163409ce</id>
<content type='text'>
Copied and adapted from vincent's patch, but modified for csky.

ref:
https://lore.kernel.org/linux-riscv/1572919114-3886-3-git-send-email-vincent.chen@sifive.com/raw

Add calls to rseq_signal_deliver(), rseq_handle_notify_resume() and
rseq_syscall() to introduce RSEQ support.

1. Call the rseq_handle_notify_resume() function on return to userspace
   if TIF_NOTIFY_RESUME thread flag is set.

2. Call the rseq_signal_deliver() function to fixup on the pre-signal
   frame when a signal is delivered on top of a restartable sequence
   critical section.

3. Check that system calls are not invoked from within rseq critical
   sections by invoking rseq_signal() from ret_from_syscall(). With
   CONFIG_DEBUG_RSEQ, such behavior results in termination of the
   process with SIGSEGV.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Copied and adapted from vincent's patch, but modified for csky.

ref:
https://lore.kernel.org/linux-riscv/1572919114-3886-3-git-send-email-vincent.chen@sifive.com/raw

Add calls to rseq_signal_deliver(), rseq_handle_notify_resume() and
rseq_syscall() to introduce RSEQ support.

1. Call the rseq_handle_notify_resume() function on return to userspace
   if TIF_NOTIFY_RESUME thread flag is set.

2. Call the rseq_signal_deliver() function to fixup on the pre-signal
   frame when a signal is delivered on top of a restartable sequence
   critical section.

3. Check that system calls are not invoked from within rseq critical
   sections by invoking rseq_signal() from ret_from_syscall(). With
   CONFIG_DEBUG_RSEQ, such behavior results in termination of the
   process with SIGSEGV.

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched/rt, csky: Use CONFIG_PREEMPTION</title>
<updated>2019-12-08T13:37:33+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-10-15T19:17:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=365a795a13326df11a5114d2b6067ca2a6d53364'/>
<id>365a795a13326df11a5114d2b6067ca2a6d53364</id>
<content type='text'>
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT.
Both PREEMPT and PREEMPT_RT require the same functionality which today
depends on CONFIG_PREEMPT.

Switch the entry code over to use CONFIG_PREEMPTION.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Guo Ren &lt;guoren@kernel.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/20191015191821.11479-7-bigeasy@linutronix.de
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT.
Both PREEMPT and PREEMPT_RT require the same functionality which today
depends on CONFIG_PREEMPT.

Switch the entry code over to use CONFIG_PREEMPTION.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Guo Ren &lt;guoren@kernel.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/20191015191821.11479-7-bigeasy@linutronix.de
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
