<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/arch/csky/kernel/entry.S, branch v5.10</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>csky: Add context tracking support</title>
<updated>2020-08-01T08:17:51+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-07-31T09:13:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bdcd93ef9afb42a6051e472fa62c693b1f9edbd8'/>
<id>bdcd93ef9afb42a6051e472fa62c693b1f9edbd8</id>
<content type='text'>
This patch support context tracking with no hz full.

Here is the test result with dynticks-testing (see tick_stop):

 cat /sys/kernel/debug/tracing/per_cpu/cpu0/trace
 tracer: nop

 entries-in-buffer/entries-written: 356/356   #P:1

                              _-----=&gt; irqs-off
                             / _----=&gt; need-resched
                            | / _---=&gt; hardirq/softirq
                            || / _--=&gt; preempt-depth
                            ||| /     delay
           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
              | |       |   ||||       |         |
...
          sleep-192   [000] d.h.   167.088270: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166436355700
          sleep-192   [000] d.h.   167.092279: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166440365700
         &lt;idle&gt;-0     [000] d.h2   167.096492: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166444578400
         &lt;idle&gt;-0     [000] d..1   167.097876: tick_stop: success=1 dependency=NONE
                                               ^^^^^^^^^
         &lt;idle&gt;-0     [000] d.h1   168.818206: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168166280900
   kworker/u2:0-7     [000] ....   168.821760: workqueue_execute_start: work struct (ptrval): function wb_workfn
   kworker/u2:0-7     [000] d.h1   168.824464: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168172547100
    kworker/0:1-18    [000] ....   168.825053: workqueue_execute_start: work struct (ptrval): function vmstat_update
    kworker/0:1-18    [000] ....   168.825238: workqueue_execute_start: work struct (ptrval): function vmstat_shepherd
    kworker/0:1-18    [000] ....   168.825516: workqueue_execute_start: work struct (ptrval): function neigh_periodic_work
         &lt;idle&gt;-0     [000] d..1   168.826121: tick_stop: success=1 dependency=NONE
   kworker/u2:0-7     [000] ....   169.377327: workqueue_execute_start: work struct (ptrval): function flush_to_ldisc
         &lt;idle&gt;-0     [000] d..1   169.379832: tick_stop: success=1 dependency=NONE
   kworker/u2:0-7     [000] ....   169.607935: workqueue_execute_start: work struct (ptrval): function flush_to_ldisc
   kworker/u2:0-7     [000] d.h1   169.608148: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168956235500
         &lt;idle&gt;-0     [000] d..1   169.608654: tick_stop: success=1 dependency=NONE

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Cc: Greentime Hu &lt;greentime.hu@sifive.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch support context tracking with no hz full.

Here is the test result with dynticks-testing (see tick_stop):

 cat /sys/kernel/debug/tracing/per_cpu/cpu0/trace
 tracer: nop

 entries-in-buffer/entries-written: 356/356   #P:1

                              _-----=&gt; irqs-off
                             / _----=&gt; need-resched
                            | / _---=&gt; hardirq/softirq
                            || / _--=&gt; preempt-depth
                            ||| /     delay
           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
              | |       |   ||||       |         |
...
          sleep-192   [000] d.h.   167.088270: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166436355700
          sleep-192   [000] d.h.   167.092279: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166440365700
         &lt;idle&gt;-0     [000] d.h2   167.096492: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166444578400
         &lt;idle&gt;-0     [000] d..1   167.097876: tick_stop: success=1 dependency=NONE
                                               ^^^^^^^^^
         &lt;idle&gt;-0     [000] d.h1   168.818206: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168166280900
   kworker/u2:0-7     [000] ....   168.821760: workqueue_execute_start: work struct (ptrval): function wb_workfn
   kworker/u2:0-7     [000] d.h1   168.824464: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168172547100
    kworker/0:1-18    [000] ....   168.825053: workqueue_execute_start: work struct (ptrval): function vmstat_update
    kworker/0:1-18    [000] ....   168.825238: workqueue_execute_start: work struct (ptrval): function vmstat_shepherd
    kworker/0:1-18    [000] ....   168.825516: workqueue_execute_start: work struct (ptrval): function neigh_periodic_work
         &lt;idle&gt;-0     [000] d..1   168.826121: tick_stop: success=1 dependency=NONE
   kworker/u2:0-7     [000] ....   169.377327: workqueue_execute_start: work struct (ptrval): function flush_to_ldisc
         &lt;idle&gt;-0     [000] d..1   169.379832: tick_stop: success=1 dependency=NONE
   kworker/u2:0-7     [000] ....   169.607935: workqueue_execute_start: work struct (ptrval): function flush_to_ldisc
   kworker/u2:0-7     [000] d.h1   169.608148: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168956235500
         &lt;idle&gt;-0     [000] d..1   169.608654: tick_stop: success=1 dependency=NONE

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Cc: Greentime Hu &lt;greentime.hu@sifive.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>csky: Add SECCOMP_FILTER supported</title>
<updated>2020-07-31T01:51:05+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-05-26T08:11:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e95a4f8cb985e759648b32ed0b721a472deb86a5'/>
<id>e95a4f8cb985e759648b32ed0b721a472deb86a5</id>
<content type='text'>
secure_computing() is called first in syscall_trace_enter() so that
a system call will be aborted quickly without doing succeeding syscall
tracing if seccomp rules want to deny that system call.

TODO:
 - Update https://github.com/seccomp/libseccomp csky support

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
secure_computing() is called first in syscall_trace_enter() so that
a system call will be aborted quickly without doing succeeding syscall
tracing if seccomp rules want to deny that system call.

TODO:
 - Update https://github.com/seccomp/libseccomp csky support

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
</pre>
</div>
</content>
</entry>
<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.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.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.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.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.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.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.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.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>
</feed>
