lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250430131516.24287-1-yangtiezhu@loongson.cn>
Date: Wed, 30 Apr 2025 21:15:11 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>
Cc: loongarch@...ts.linux.dev,
	linux-kernel@...r.kernel.org
Subject: [PATCH 0/5] Enable some configs in loongson3_defconfig

This is a small patchset based on 6.15-rc4, each patch is a
single logical change to better describe the problem and make
it easier to review.

If the changes make sense, all of them can be squashed into one
single patch, I think that would be fine as well, let us see if
other people have concern about it.

By the way, I received many compile-time error reports about tools,
most are related with configs, this is the motivation of this series.

Additionally, I also received one run-time bug report about uprobe,
but it works fine on my test environment. If somebody can reproduce
it, please let me know, maybe I am missing something.

1. How to reproduce

(1) Compile and install Tongsuo

git clone https://github.com/Tongsuo-Project/Tongsuo.git
cd Tongsuo && ./config --prefix=/opt/tongsuo -Wl,-rpath,/opt/tongsuo/lib
make && sudo make install

https://www.tongsuo.net/docs/compilation/source-compilation

(2) Compile and update kernel

Apply this series based on 6.15-rc4, then use the loongson3_defconfig,
CONFIG_UPROBE_EVENTS is already set.

(3) Probe "openssl speed sm2"

cd tools/perf && make
sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2

2. My test results

fedora@...ux:~/uprobe.git/tools/perf$ sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
Added new event:
  probe_libcrypto:BN_mod_mul_montgomery (on BN_mod_mul_montgomery in /usr/lib64/libcrypto.so.3.2.2)

You can now use it in all perf tools, such as:

	perf record -e probe_libcrypto:BN_mod_mul_montgomery -aR sleep 1

fedora@...ux:~/uprobe.git/tools/perf$ sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
Doing 256 bits sign CurveSM2's for 10s: 7463 256 bits CurveSM2 signs in 10.00s 
Doing 256 bits verify CurveSM2's for 10s: 9681 256 bits CurveSM2 verify in 9.98s
...
                              sign    verify    sign/s verify/s
 256 bits SM2 (CurveSM2)   0.0013s   0.0010s    746.3    970.0

 Performance counter stats for '/opt/tongsuo/bin/openssl speed sm2':

                 0      probe_libcrypto:BN_mod_mul_montgomery                                      

      20.007539877 seconds time elapsed

      19.990010000 seconds user
       0.000000000 seconds sys

Thanks,
Tiezhu

Tiezhu Yang (5):
  LoongArch: Clean up loongson3_defconfig
  LoongArch: Enable tracing infrastructure in defconfig
  LoongArch: Enable tracing syscalls in defconfig
  LoongArch: Enable debug information in defconfig
  LoongArch: Enable kprobe and ftrace in defconfig

 arch/loongarch/configs/loongson3_defconfig | 74 +++++-----------------
 1 file changed, 16 insertions(+), 58 deletions(-)

-- 
2.42.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ