<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/riscv/kernel, branch linux-5.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-08-26T09:42:12Z</updated>
<entry>
<title>riscv: Fixup static_obj() fail</title>
<updated>2020-08-26T09:42:12Z</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=b7df3f40fb7d58714821aae2e1c6848b46e4f799'/>
<id>urn:sha1:b7df3f40fb7d58714821aae2e1c6848b46e4f799</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>RISC-V: Don't allow write+exec only page mapping request in mmap</title>
<updated>2020-06-30T19:36:19Z</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=1c1549e363a1386c9a66f394dfda2cbeefbe3dfc'/>
<id>urn:sha1:1c1549e363a1386c9a66f394dfda2cbeefbe3dfc</id>
<content type='text'>
[ Upstream commit e0d17c842c0f824fd4df9f4688709fc6907201e1 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>RISC-V: gp_in_global needs register keyword</title>
<updated>2020-05-21T20:28:26Z</updated>
<author>
<name>Palmer Dabbelt</name>
</author>
<published>2020-05-21T20:28:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8356c379cfba8b1b90b0a2423f6afbbe2cdc5d91'/>
<id>urn:sha1:8356c379cfba8b1b90b0a2423f6afbbe2cdc5d91</id>
<content type='text'>
The Intel kernel build robot recently pointed out that I missed the
register keyword on this one when I refactored the code to remove local
register variables (which aren't supported by LLVM).  GCC's manual
indicates that global register variables must have the register keyword,
As far as I can tell lacking the register keyword causes GCC to ignore
the __asm__ and treat this as a regular variable, but I'm not sure how
that didn't show up as some sort of failure.

Fixes: 52e7c52d2ded ("RISC-V: Stop relying on GCC's register allocator's hueristics")
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: stacktrace: Fix undefined reference to `walk_stackframe'</title>
<updated>2020-05-13T00:04:25Z</updated>
<author>
<name>Kefeng Wang</name>
</author>
<published>2020-05-11T02:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0502bee37cdef755d63eee60236562e5605e2480'/>
<id>urn:sha1:0502bee37cdef755d63eee60236562e5605e2480</id>
<content type='text'>
Drop static declaration to fix following build error if FRAME_POINTER disabled,
  riscv64-linux-ld: arch/riscv/kernel/perf_callchain.o: in function `.L0':
  perf_callchain.c:(.text+0x2b8): undefined reference to `walk_stackframe'

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: perf: RISCV_BASE_PMU should be independent</title>
<updated>2020-05-12T23:21:46Z</updated>
<author>
<name>Kefeng Wang</name>
</author>
<published>2020-05-07T15:04:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=48084c3595cb7429f6ba734cfea1313573b9a7fa'/>
<id>urn:sha1:48084c3595cb7429f6ba734cfea1313573b9a7fa</id>
<content type='text'>
Selecting PERF_EVENTS without selecting RISCV_BASE_PMU results in a build
error.

Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
[Palmer: commit text]
Fixes: 178e9fc47aae("perf: riscv: preliminary RISC-V support")
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: perf_event: Make some funciton static</title>
<updated>2020-05-11T20:48:19Z</updated>
<author>
<name>Kefeng Wang</name>
</author>
<published>2020-05-07T15:04:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7b146a8bfba50e263745bbdefc11833c3766664'/>
<id>urn:sha1:e7b146a8bfba50e263745bbdefc11833c3766664</id>
<content type='text'>
Fixes the following warning detected when running make with W=1,
../arch/riscv/kernel/perf_event.c:150:5: warning: no previous prototype for ‘riscv_map_cache_decode’ [-Wmissing-prototypes]
 int riscv_map_cache_decode(u64 config, unsigned int *type,
     ^~~~~~~~~~~~~~~~~~~~~~
../arch/riscv/kernel/perf_event.c:345:13: warning: no previous prototype for ‘riscv_base_pmu_handle_irq’ [-Wmissing-prototypes]
 irqreturn_t riscv_base_pmu_handle_irq(int irq_num, void *dev)
             ^~~~~~~~~~~~~~~~~~~~~~~~~
../arch/riscv/kernel/perf_event.c:364:6: warning: no previous prototype for ‘release_pmc_hardware’ [-Wmissing-prototypes]
 void release_pmc_hardware(void)
      ^~~~~~~~~~~~~~~~~~~~
../arch/riscv/kernel/perf_event.c:467:12: warning: no previous prototype for ‘init_hw_perf_events’ [-Wmissing-prototypes]
 int __init init_hw_perf_events(void)
            ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: force __cpu_up_ variables to put in data section</title>
<updated>2020-05-04T22:03:25Z</updated>
<author>
<name>Zong Li</name>
</author>
<published>2020-05-04T03:54:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d6d5161280b3d57163f5310f0a0007cdeb729984'/>
<id>urn:sha1:d6d5161280b3d57163f5310f0a0007cdeb729984</id>
<content type='text'>
Put __cpu_up_stack_pointer and __cpu_up_task_pointer in data section.
Currently, these two variables are put in bss section, there is a
potential risk that secondary harts get the uninitialized value before
main hart finishing the bss clearing. In this case, all secondary
harts would pass the waiting loop and enable the MMU before main hart
set up the page table.

This issue happens on random booting of multiple harts, which means
it will manifest for BBL and OpenSBI v0.6 (or older version). In OpenSBI
v0.7 (or higher version), we have HSM extension so all the secondary harts
are brought-up by Linux kernel in an orderly fashion. This means we don't
need this change for OpenSBI v0.7 (or higher version).

Signed-off-by: Zong Li &lt;zong.li@sifive.com&gt;
Reviewed-by: Greentime Hu &lt;greentime.hu@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: add Linux note to vdso</title>
<updated>2020-05-04T21:22:34Z</updated>
<author>
<name>Andreas Schwab</name>
</author>
<published>2020-04-27T15:13:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a9f2a6161dcd6be057f6c501453d28b3c4a3b0c'/>
<id>urn:sha1:0a9f2a6161dcd6be057f6c501453d28b3c4a3b0c</id>
<content type='text'>
The Linux note in the vdso allows glibc to check the running kernel
version without having to issue the uname syscall.

Signed-off-by: Andreas Schwab &lt;schwab@suse.de&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: Add bitmap reprensenting ISA features common across CPUs</title>
<updated>2020-05-04T21:08:59Z</updated>
<author>
<name>Anup Patel</name>
</author>
<published>2020-04-24T04:59:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6bcff51539ccae5431a01f60293419dbae21100f'/>
<id>urn:sha1:6bcff51539ccae5431a01f60293419dbae21100f</id>
<content type='text'>
This patch adds riscv_isa bitmap which represents Host ISA features
common across all Host CPUs. The riscv_isa is not same as elf_hwcap
because elf_hwcap will only have ISA features relevant for user-space
apps whereas riscv_isa will have ISA features relevant to both kernel
and user-space apps.

One of the use-case for riscv_isa bitmap is in KVM hypervisor where
we will use it to do following operations:

1. Check whether hypervisor extension is available
2. Find ISA features that need to be virtualized (e.g. floating
   point support, vector extension, etc.)

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Signed-off-by: Atish Patra &lt;atish.patra@wdc.com&gt;
Reviewed-by: Alexander Graf &lt;graf@amazon.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: Export riscv_cpuid_to_hartid_mask() API</title>
<updated>2020-05-04T21:08:58Z</updated>
<author>
<name>Anup Patel</name>
</author>
<published>2020-04-24T04:59:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7391efa48d88c8555a802bac562d02a38567127c'/>
<id>urn:sha1:7391efa48d88c8555a802bac562d02a38567127c</id>
<content type='text'>
The riscv_cpuid_to_hartid_mask() API should be exported to allow
building KVM RISC-V as loadable module.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
</feed>
