!31 将源码仓rv补丁提交到制品仓

From: @laokz 
Reviewed-by: @cp3yeye, @MrRlu 
Signed-off-by: @MrRlu
This commit is contained in:
openeuler-ci-bot 2024-11-29 03:42:20 +00:00 committed by Gitee
commit ae40f866f3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 74 additions and 1 deletions

66
add-riscv64-support.patch Normal file
View File

@ -0,0 +1,66 @@
From 756f6595b562a3fff5de9ab8dd38865f20aa022c Mon Sep 17 00:00:00 2001
From: laokz <zhangkai@iscas.ac.cn>
Date: Thu, 25 Apr 2024 22:21:28 +0800
Subject: [PATCH] add riscv64 support
Signal info referenced:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/kernel/signal.c#L373
Max CPUs referenced:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/Kconfig#L411
Local disk suport PCI and VIRTIO both.
---
sysmonitor-1.3.2/module/signo_catch.c | 8 ++++++++
sysmonitor-1.3.2/script/get_local_disk.sh | 2 ++
sysmonitor-1.3.2/src/sys_resources.c | 2 ++
3 files changed, 12 insertions(+)
diff --git a/sysmonitor-1.3.2/module/signo_catch.c b/sysmonitor-1.3.2/module/signo_catch.c
index c038e161ff19..043a14838f98 100644
--- a/module/signo_catch.c
+++ b/module/signo_catch.c
@@ -272,6 +272,14 @@ static int pre_handler(struct kprobe *p, struct pt_regs *regs)
data.p = (struct task_struct *)((unsigned long *)regs->dx);
do_store_sig_info(&data);
#endif
+
+#if defined(CONFIG_RISCV) && defined(CONFIG_64BIT)
+ send_sig_info_data_t data;
+ data.sig = regs->a0;
+ data.info = (struct kernel_siginfo *)((unsigned long *)regs->a1);
+ data.p = (struct task_struct *)((unsigned long *)regs->a2);
+ do_store_sig_info(&data);
+#endif
return 0;
}
diff --git a/sysmonitor-1.3.2/script/get_local_disk.sh b/sysmonitor-1.3.2/script/get_local_disk.sh
index 318374cbffdd..063e540cebd4 100755
--- a/script/get_local_disk.sh
+++ b/script/get_local_disk.sh
@@ -9,6 +9,8 @@ fc_disk_file=""
local_disk_file=""
if uname -a | grep -q aarch64; then
fc_local_disk=`ls -l /sys/block/ | grep -E 'pci|HISI0162' 2> /dev/null`
+elif uname -a | grep -q riscv64; then
+ fc_local_disk=`ls -l /sys/block/ | grep -E 'pci|virtio' 2> /dev/null`
else
fc_local_disk=`ls -l /sys/block/ | grep pci 2> /dev/null`
fi
diff --git a/sysmonitor-1.3.2/src/sys_resources.c b/sysmonitor-1.3.2/src/sys_resources.c
index fdf52561e07d..87f2fdd73b10 100644
--- a/src/sys_resources.c
+++ b/src/sys_resources.c
@@ -64,6 +64,8 @@
#define MAX_DOMAIN_CPU_COUNT 256
#ifdef __x86_64__
#define DOMAIN_CPU_LEN 1024 /* x86 supports max 8192 CPUs */
+#elif defined(__riscv)
+#define DOMAIN_CPU_LEN 64 /* riscv supports max 512 CPUs */
#else
#define DOMAIN_CPU_LEN 128 /* arm64 supports max 1024 CPUs */
#endif
--
2.39.5

View File

@ -7,7 +7,7 @@
%define kmod_name sysmonitor
%define version 1.3.2
%define releaseversion 1.5
%define releaseversion 1.6
Summary: System Monitor Daemon
Name: %{kmod_name}-kmod
Version: %{version}
@ -38,6 +38,7 @@ Provides: sysmonitor
Patch1: bugfix-fix-signal-monitor-err.patch
Patch2: bugfix-fix-fd-path-failed-to-open.patch
Patch3: update-support-loongarch-fix-compilation-errors.patch
Patch4: add-riscv64-support.patch
%description
System Monitor Daemon
@ -172,6 +173,12 @@ systemctl daemon-reload 2>/dev/null 1>/dev/null
/usr/lib/systemd/system/multi-user.target.wants/sysmonitor.service
%changelog
* Mon Jun 03 2024 laokz <zhangkai@iscas.ac.cn> - 1.3.2-1.6
- Type:update
- CVE:NA
- SUG:NA
- DESC: support riscv64 build
* Mon Jun 03 2024 yueyuankun <yueyuankun@kylinos.cn> - 1.3.2-1.5
- Type:update
- CVE:NA