<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/riscv/kernel, branch linux-5.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-10-01T15:36:24Z</updated>
<entry>
<title>RISC-V: Take text_mutex in ftrace_init_nop()</title>
<updated>2020-10-01T15:36:24Z</updated>
<author>
<name>Palmer Dabbelt</name>
</author>
<published>2020-08-25T00:21:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af5681dfa0aaf4fc96f1bd1dfb00a39270107053'/>
<id>urn:sha1:af5681dfa0aaf4fc96f1bd1dfb00a39270107053</id>
<content type='text'>
[ Upstream commit 66d18dbda8469a944dfec6c49d26d5946efba218 ]

Without this we get lockdep failures.  They're spurious failures as SMP isn't
up when ftrace_init_nop() is called.  As far as I can tell the easiest fix is
to just take the lock, which also seems like the safest fix.

Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Acked-by: Guo Ren &lt;guoren@kernel.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: Fixup static_obj() fail</title>
<updated>2020-08-26T09:49:06Z</updated>
<author>
<name>Guo Ren</name>
</author>
<published>2020-06-27T13:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7beedf14a639058c7d737b1ccd8fcdaa6cf973ae'/>
<id>urn:sha1:7beedf14a639058c7d737b1ccd8fcdaa6cf973ae</id>
<content type='text'>
[ Upstream commit 6184358da0004c8fd940afda6c0a0fa4027dc911 ]

When enable LOCKDEP, static_obj() will cause error. Because some
__initdata static variables is before _stext:

static int static_obj(const void *obj)
{
        unsigned long start = (unsigned long) &amp;_stext,
                      end   = (unsigned long) &amp;_end,
                      addr  = (unsigned long) obj;

        /*
         * static variable?
         */
        if ((addr &gt;= start) &amp;&amp; (addr &lt; end))
                return 1;

[    0.067192] INFO: trying to register non-static key.
[    0.067325] the code is fine but needs lockdep annotation.
[    0.067449] turning off the locking correctness validator.
[    0.067718] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.7.0-rc7-dirty #44
[    0.067945] Call Trace:
[    0.068369] [&lt;ffffffe00020323c&gt;] walk_stackframe+0x0/0xa4
[    0.068506] [&lt;ffffffe000203422&gt;] show_stack+0x2a/0x34
[    0.068631] [&lt;ffffffe000521e4e&gt;] dump_stack+0x94/0xca
[    0.068757] [&lt;ffffffe000255a4e&gt;] register_lock_class+0x5b8/0x5bc
[    0.068969] [&lt;ffffffe000255abe&gt;] __lock_acquire+0x6c/0x1d5c
[    0.069101] [&lt;ffffffe0002550fe&gt;] lock_acquire+0xae/0x312
[    0.069228] [&lt;ffffffe000989a8e&gt;] _raw_spin_lock_irqsave+0x40/0x5a
[    0.069357] [&lt;ffffffe000247c64&gt;] complete+0x1e/0x50
[    0.069479] [&lt;ffffffe000984c38&gt;] rest_init+0x1b0/0x28a
[    0.069660] [&lt;ffffffe0000016a2&gt;] 0xffffffe0000016a2
[    0.069779] [&lt;ffffffe000001b84&gt;] 0xffffffe000001b84
[    0.069953] [&lt;ffffffe000001092&gt;] 0xffffffe000001092

static __initdata DECLARE_COMPLETION(kthreadd_done);

noinline void __ref rest_init(void)
{
	...
	complete(&amp;kthreadd_done);

Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&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: Fix "no previous prototype" compile warning in kgdb.c file</title>
<updated>2020-07-10T03:09:30Z</updated>
<author>
<name>Vincent Chen</name>
</author>
<published>2020-06-23T05:37:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f7fc752815f8e2337548497b3afb4aef791db4ef'/>
<id>urn:sha1:f7fc752815f8e2337548497b3afb4aef791db4ef</id>
<content type='text'>
Some functions are only used in the kgdb.c file. Add static properities
to these functions to avoid "no previous prototype" compile warnings

Signed-off-by: Vincent Chen &lt;vincent.chen@sifive.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: Fixup __vdso_gettimeofday broke dynamic ftrace</title>
<updated>2020-06-25T22:38:39Z</updated>
<author>
<name>Guo Ren</name>
</author>
<published>2020-06-23T09:50:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e05d57dcb8c71492268ff46ba9bfe9a9cfb1f95d'/>
<id>urn:sha1:e05d57dcb8c71492268ff46ba9bfe9a9cfb1f95d</id>
<content type='text'>
For linux-5.8-rc1, enable ftrace of riscv will cause boot panic:

[    2.388980] Run /sbin/init as init process
[    2.529938] init[39]: unhandled signal 4 code 0x1 at 0x0000003ff449e000
[    2.531078] CPU: 0 PID: 39 Comm: init Not tainted 5.8.0-rc1-dirty #13
[    2.532719] epc: 0000003ff449e000 ra : 0000003ff449e954 sp : 0000003fffedb900
[    2.534005]  gp : 00000000000e8528 tp : 0000003ff449d800 t0 : 000000000000001e
[    2.534965]  t1 : 000000000000000a t2 : 0000003fffedb89e s0 : 0000003fffedb920
[    2.536279]  s1 : 0000003fffedb940 a0 : 0000003ff43d4b2c a1 : 0000000000000000
[    2.537334]  a2 : 0000000000000001 a3 : 0000000000000000 a4 : fffffffffbad8000
[    2.538466]  a5 : 0000003ff449e93a a6 : 0000000000000000 a7 : 0000000000000000
[    2.539511]  s2 : 0000000000000000 s3 : 0000003ff448412c s4 : 0000000000000010
[    2.541260]  s5 : 0000000000000016 s6 : 00000000000d0a30 s7 : 0000003fffedba70
[    2.542152]  s8 : 0000000000000000 s9 : 0000000000000000 s10: 0000003fffedb960
[    2.543335]  s11: 0000000000000000 t3 : 0000000000000000 t4 : 0000003fffedb8a0
[    2.544471]  t5 : 0000000000000000 t6 : 0000000000000000
[    2.545730] status: 0000000000004020 badaddr: 00000000464c457f cause: 0000000000000002
[    2.549867] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[    2.551267] CPU: 0 PID: 1 Comm: init Not tainted 5.8.0-rc1-dirty #13
[    2.552061] Call Trace:
[    2.552626] [&lt;ffffffe00020374a&gt;] walk_stackframe+0x0/0xc4
[    2.553486] [&lt;ffffffe0002039f4&gt;] show_stack+0x40/0x4c
[    2.553995] [&lt;ffffffe00054a6ae&gt;] dump_stack+0x7a/0x98
[    2.554615] [&lt;ffffffe00020b9b8&gt;] panic+0x114/0x2f4
[    2.555395] [&lt;ffffffe00020ebd6&gt;] do_exit+0x89c/0x8c2
[    2.555949] [&lt;ffffffe00020f930&gt;] do_group_exit+0x3a/0x90
[    2.556715] [&lt;ffffffe000219e08&gt;] get_signal+0xe2/0x6e6
[    2.557388] [&lt;ffffffe000202d72&gt;] do_notify_resume+0x6a/0x37a
[    2.558089] [&lt;ffffffe000201c16&gt;] ret_from_exception+0x0/0xc

"ra:0x3ff449e954" is the return address of "call _mcount" in the
prologue of __vdso_gettimeofday(). Without proper relocate, pc jmp
to 0x0000003ff449e000 (vdso map base) with a illegal instruction
trap.

The solution comes from arch/arm64/kernel/vdso/Makefile:

CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS)

 - CC_FLAGS_SCS is ShadowCallStack feature in Clang and only
   implemented for arm64, no use for riscv.

Fixes: ad5d1122b82f ("riscv: use vDSO common flow to reduce the latency of the time-related functions")
Cc: stable@vger.kernel.org
Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Reviewed-by: Vincent Chen &lt;vincent.chen@sifive.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: Add extern declarations for vDSO time-related functions</title>
<updated>2020-06-25T22:15:51Z</updated>
<author>
<name>Vincent Chen</name>
</author>
<published>2020-06-23T05:40:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e93b327dbf3d37f0dfb123b58f9627ad17be652e'/>
<id>urn:sha1:e93b327dbf3d37f0dfb123b58f9627ad17be652e</id>
<content type='text'>
Add extern declarations for vDSO time-related functions to notify the
compiler these functions will be used in somewhere to avoid
"no previous prototype" compile warning.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Vincent Chen &lt;vincent.chen@sifive.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: Add -fPIC option to CFLAGS_vgettimeofday.o</title>
<updated>2020-06-25T21:58:59Z</updated>
<author>
<name>Vincent Chen</name>
</author>
<published>2020-06-23T01:13:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a0fc3b32893b29a7b3a2771b6d63bae16cb1e8de'/>
<id>urn:sha1:a0fc3b32893b29a7b3a2771b6d63bae16cb1e8de</id>
<content type='text'>
The time related vDSO functions use a variable, vdso_data, to access the
vDSO data page to get the system time information. Because the vdso_data
for CFLAGS_vgettimeofday.o is an external variable defined in vdso.o,
the CFLAGS_vgettimeofday.o should be compiled with -fPIC to ensure
that vdso_data is addressable.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Vincent Chen &lt;vincent.chen@sifive.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'riscv-for-linus-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux</title>
<updated>2020-06-20T19:14:29Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2020-06-20T19:14:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fdfbe08a2b3e2bf776e2f2b341768ba93c2e158'/>
<id>urn:sha1:7fdfbe08a2b3e2bf776e2f2b341768ba93c2e158</id>
<content type='text'>
Pull RISC-V fixes from Palmer Dabbelt:

 - a workaround for a compiler surprise related to the "r" inline
   assembly that allows LLVM to boot.

 - a fix to avoid WX-only mappings, which the ISA does not allow. While
   this probably manifests in many ways, the bug was found in stress-ng.

 - a missing lock in set_direct_map_*(), which due to a recent lockdep
   change started asserting.

* tag 'riscv-for-linus-5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  RISC-V: Acquire mmap lock before invoking walk_page_range
  RISC-V: Don't allow write+exec only page mapping request in mmap
  riscv/atomic: Fix sign extension for RV64I
</content>
</entry>
<entry>
<title>RISC-V: Don't allow write+exec only page mapping request in mmap</title>
<updated>2020-06-19T00:28:53Z</updated>
<author>
<name>Yash Shah</name>
</author>
<published>2020-06-16T14:03:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e0d17c842c0f824fd4df9f4688709fc6907201e1'/>
<id>urn:sha1:e0d17c842c0f824fd4df9f4688709fc6907201e1</id>
<content type='text'>
As per the table 4.4 of version "20190608-Priv-MSU-Ratified" of the
RISC-V instruction set manual[0], the PTE permission bit combination of
"write+exec only" is reserved for future use. Hence, don't allow such
mapping request in mmap call.

An issue is been reported by David Abdurachmanov, that while running
stress-ng with "sysbadaddr" argument, RCU stalls are observed on RISC-V
specific kernel.

This issue arises when the stress-sysbadaddr request for pages with
"write+exec only" permission bits and then passes the address obtain
from this mmap call to various system call. For the riscv kernel, the
mmap call should fail for this particular combination of permission bits
since it's not valid.

[0]: http://dabbelt.com/~palmer/keep/riscv-isa-manual/riscv-privileged-20190608-1.pdf

Signed-off-by: Yash Shah &lt;yash.shah@sifive.com&gt;
Reported-by: David Abdurachmanov &lt;david.abdurachmanov@gmail.com&gt;
[Palmer: Refer to the latest ISA specification at the only link I could
find, and update the terminology.]
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>maccess: rename probe_kernel_address to get_kernel_nofault</title>
<updated>2020-06-18T18:14:40Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2020-06-17T07:37:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=25f12ae45fc1931a1dce3cc59f9989a9d87834b0'/>
<id>urn:sha1:25f12ae45fc1931a1dce3cc59f9989a9d87834b0</id>
<content type='text'>
Better describe what this helper does, and match the naming of
copy_from_kernel_nofault.

Also switch the argument order around, so that it acts and looks
like get_user().

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault</title>
<updated>2020-06-17T17:57:41Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2020-06-17T07:37:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe557319aa06c23cffc9346000f119547e0f289a'/>
<id>urn:sha1:fe557319aa06c23cffc9346000f119547e0f289a</id>
<content type='text'>
Better describe what these functions do.

Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
