<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/arch/riscv/kernel/vdso/Makefile, branch jd/orphan-parallel</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/arch/riscv/kernel/vdso/Makefile?h=jd%2Forphan-parallel</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/arch/riscv/kernel/vdso/Makefile?h=jd%2Forphan-parallel'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-10-09T14:57:30Z</updated>
<entry>
<title>kbuild: explicitly specify the build id style</title>
<updated>2020-10-09T14:57:30Z</updated>
<author>
<name>Bill Wendling</name>
<email>morbo@google.com</email>
</author>
<published>2020-09-22T23:21:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=a968433723310f35898b4a2f635a7991aeef66b1'/>
<id>urn:sha1:a968433723310f35898b4a2f635a7991aeef66b1</id>
<content type='text'>
ld's --build-id defaults to "sha1" style, while lld defaults to "fast".
The build IDs are very different between the two, which may confuse
programs that reference them.

Signed-off-by: Bill Wendling &lt;morbo@google.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>riscv: disable stack-protector for vDSO</title>
<updated>2020-08-04T22:02:49Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2020-07-29T07:51:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=40284a072c42f6177184fb1f62ba94c69e0c0277'/>
<id>urn:sha1:40284a072c42f6177184fb1f62ba94c69e0c0277</id>
<content type='text'>
Currently, building the vDSO with clang leads assembler errors like the
following:

  /tmp/vgettimeofday-1ae0d2.s: Assembler messages:
  /tmp/vgettimeofday-1ae0d2.s:28: Error: bad expression
  /tmp/vgettimeofday-1ae0d2.s:28: Error: illegal operands `auipc a2,%got_pcrel_hi(__stack_chk_guard)'

Disable the stack-protector for vDSO to fix these.

Link: https://github.com/ClangBuiltLinux/linux/issues/1112
Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: Allow building with kcov coverage</title>
<updated>2020-07-30T18:37:35Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2020-06-26T12:40:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=20d38f7c45a44e4b762b586a7bcacbc93ddb3153'/>
<id>urn:sha1:20d38f7c45a44e4b762b586a7bcacbc93ddb3153</id>
<content type='text'>
Add ARCH_HAS_KCOV and HAVE_GCC_PLUGINS to the riscv Kconfig.
Also disable instrumentation of some early boot code and vdso.

Boot-tested on QEMU's riscv64 virt machine.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Acked-by: Dmitry Vyukov &lt;dvyukov@google.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>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2020-06-23T09:50:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/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 -fPIC option to CFLAGS_vgettimeofday.o</title>
<updated>2020-06-25T21:58:59Z</updated>
<author>
<name>Vincent Chen</name>
<email>vincent.chen@sifive.com</email>
</author>
<published>2020-06-23T01:13:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/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>riscv: use vDSO common flow to reduce the latency of the time-related functions</title>
<updated>2020-06-11T02:47:16Z</updated>
<author>
<name>Vincent Chen</name>
<email>vincent.chen@sifive.com</email>
</author>
<published>2020-06-09T14:14:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=ad5d1122b82fbd6a816d1b9d26ee01a6dbc2d757'/>
<id>urn:sha1:ad5d1122b82fbd6a816d1b9d26ee01a6dbc2d757</id>
<content type='text'>
Even if RISC-V has supported the vDSO feature, the latency of the functions
for obtaining the system time is still expensive. It is because these
functions still trigger a corresponding system call in the process, which
slows down the response time. If we want to remove the system call to
reduce the latency, the kernel should have the ability to output the system
clock information to userspace. This patch introduces the vDSO common flow
to enable the kernel to achieve the above feature and uses "rdtime"
instruction to obtain the current time in the user space. Under this
condition, the latency cost by the ecall from U-mode to S-mode can be
eliminated. After applying this patch, the latency of gettimeofday()
measured on the HiFive unleashed board can be reduced by %61.

Signed-off-by: Vincent Chen &lt;vincent.chen@sifive.com&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>
<email>schwab@suse.de</email>
</author>
<published>2020-04-27T15:13:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/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>riscv: fix vdso build with lld</title>
<updated>2020-04-21T22:22:45Z</updated>
<author>
<name>Ilie Halip</name>
<email>ilie.halip@gmail.com</email>
</author>
<published>2020-04-15T14:29:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=3c1918c8f54166598195d938564072664a8275b1'/>
<id>urn:sha1:3c1918c8f54166598195d938564072664a8275b1</id>
<content type='text'>
When building with the LLVM linker this error occurrs:
    LD      arch/riscv/kernel/vdso/vdso-syms.o
  ld.lld: error: no input files

This happens because the lld treats -R as an alias to -rpath, as opposed
to ld where -R means --just-symbols.

Use the long option name for compatibility between the two.

Link: https://github.com/ClangBuiltLinux/linux/issues/805
Reported-by: Dmitry Golovin &lt;dima@golovin.in&gt;
Reviewed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Signed-off-by: Ilie Halip &lt;ilie.halip@gmail.com&gt;
Reviewed-by: Fangrui Song &lt;maskray@google.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
<entry>
<title>riscv: delete temporary files</title>
<updated>2020-01-18T21:22:13Z</updated>
<author>
<name>Ilie Halip</name>
<email>ilie.halip@gmail.com</email>
</author>
<published>2020-01-15T11:32:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=95f4d9cced96afa9c69b3da8e79e96102c84fc60'/>
<id>urn:sha1:95f4d9cced96afa9c69b3da8e79e96102c84fc60</id>
<content type='text'>
Temporary files used in the VDSO build process linger on even after make
mrproper: vdso-dummy.o.tmp, vdso.so.dbg.tmp.

Delete them once they're no longer needed.

Signed-off-by: Ilie Halip &lt;ilie.halip@gmail.com&gt;
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>riscv: Fix perf record without libelf support</title>
<updated>2019-07-31T19:26:10Z</updated>
<author>
<name>Mao Han</name>
<email>han_mao@c-sky.com</email>
</author>
<published>2019-07-11T02:38:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=b399abe7c21e248dc6224cadc9a378a2beb10cfd'/>
<id>urn:sha1:b399abe7c21e248dc6224cadc9a378a2beb10cfd</id>
<content type='text'>
This patch fix following perf record error by linking vdso.so with
build id.

perf.data      perf.data.old
[ perf record: Woken up 1 times to write data ]
free(): double free detected in tcache 2
Aborted

perf record use filename__read_build_id(util/symbol-minimal.c) to get
build id when libelf is not supported. When vdso.so is linked without
build id, the section size of PT_NOTE will be zero, buf size will
realloc to zero and cause memory corruption.

Signed-off-by: Mao Han &lt;han_mao@c-sky.com&gt;
Cc: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;
Cc: Palmer Dabbelt &lt;palmer@sifive.com&gt;
Cc: Albert Ou &lt;aou@eecs.berkeley.edu&gt;
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
</feed>
