Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
06338fb3fe
!47 backport patches from upstream
From: @znzjugod 
Reviewed-by: @ziyangc 
Signed-off-by: @ziyangc
2023-08-22 12:24:29 +00:00
znzjugod
829a6c4b6f backport patches from upstream:change the DDR4 string to DDR to avoid confusion 2023-08-21 11:38:44 +08:00
openeuler-ci-bot
8c83bf463f
!38 backport patches from upstream
From: @zhangruifang2020 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
2023-06-16 08:24:48 +00:00
zhangruifang2020
95589b051d backport patches from upstream 2023-06-16 15:53:40 +08:00
openeuler-ci-bot
4b33a43f12
!26 enable check
From: @tong_1001 
Reviewed-by: @lvying6 
Signed-off-by: @lvying6
2022-11-22 02:20:09 +00:00
shixuantong
71f7fe07a4 enable check 2022-11-22 09:44:38 +08:00
openeuler-ci-bot
362755f199 !10 add buildrequires gcc
From: @yang_zhuang_zhuang
Reviewed-by: @overweight
Signed-off-by: @overweight
2021-05-28 14:45:50 +08:00
yang_zhuang_zhuang
16aff47ace The "cc:command not found" error message is displayed during compilation.Therefore,add buildrequires gcc. 2021-05-28 11:44:37 +08:00
openeuler-ci-bot
d58c63d2db !7 【openEuler-20.03-LTS】Modify source url in spec
Merge pull request !7 from yixiangzhike/openEuler-20.03-LTS
2020-09-02 14:15:05 +08:00
yixiangzhike
063d6749c1 modify source url 2020-09-02 12:50:25 +08:00
5 changed files with 176 additions and 3 deletions

View File

@ -0,0 +1,23 @@
From 775527e886a94d89ac90239ef54e1ef436956e75 Mon Sep 17 00:00:00 2001
From: huangduirong <huangduirong@huawei.com>
Date: Sat, 9 Oct 2021 16:50:08 +0800
Subject: [PATCH] fix the buf not freed in read_field
---
sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysfs.c b/sysfs.c
index 7e7166e..018f294 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -39,7 +39,7 @@ char *read_field(char *base, char *name)
fd = open(fn, O_RDONLY);
free(fn);
if (fd < 0)
- goto bad;
+ goto bad_buf;
n = read(fd, buf, 4096);
close(fd);
if (n < 0)

View File

@ -0,0 +1,31 @@
From 4146c9296a0cbd26f1c5e411cb44877f350053bd Mon Sep 17 00:00:00 2001
From: Andi Kleen <ak@linux.intel.com>
Date: Thu, 9 Dec 2021 17:12:29 -0800
Subject: [PATCH] Fix warnings in sysfs.c
---
sysfs.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sysfs.c b/sysfs.c
index 018f294..cd0f7c7 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -31,7 +31,6 @@ char *read_field(char *base, char *name)
{
char *fn, *val;
int n, fd;
- struct stat st;
char *s;
char *buf = xalloc(4096);
@@ -55,7 +54,6 @@ char *read_field(char *base, char *name)
bad_buf:
free(buf);
-bad:
SYSERRprintf("Cannot read sysfs field %s/%s", base, name);
return xstrdup("");
}

View File

@ -0,0 +1,39 @@
From 41ad98a81cc2c1a85dfdbff16eafe153b99e7866 Mon Sep 17 00:00:00 2001
From: Tony Luck <tony.luck@intel.com>
Date: Fri, 3 Dec 2021 09:44:04 -0800
Subject: [PATCH] mcelog: Change "DDR4" string to "DDR" for i10nm platforms
There are i10nm platforms that support DDR5 as well as some that support
DDR4.
Change the DDR4 string to DDR to avoid confusion.
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
i10nm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/i10nm.c b/i10nm.c
index b629c27..3a0e97c 100644
--- a/i10nm.c
+++ b/i10nm.c
@@ -191,7 +191,7 @@ static char *imc_1[] = {
};
static char *imc_2[] = {
- [0x00] = "DDR4 command / address parity error",
+ [0x00] = "DDR command / address parity error",
[0x20] = "HBM command / address parity error",
[0x21] = "HBM data parity error",
};
@@ -204,7 +204,7 @@ static char *imc_8[] = {
[0x00] = "DDR-T bad request",
[0x01] = "DDR Data response to an invalid entry",
[0x02] = "DDR data response to an entry not expecting data",
- [0x03] = "DDR4 completion to an invalid entry",
+ [0x03] = "DDR completion to an invalid entry",
[0x04] = "DDR-T completion to an invalid entry",
[0x05] = "DDR data/completion FIFO overflow",
[0x06] = "DDR-T ERID correctable parity error",

View File

@ -0,0 +1,50 @@
From 03be76d6bd223e39e89976a9f75e1e9d19c30a18 Mon Sep 17 00:00:00 2001
From: Andi Kleen <andi@firstfloor.org>
Date: Sat, 2 Oct 2021 16:45:20 -0700
Subject: [PATCH] mcelog: Handle sysfs files without length
---
sysfs.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/sysfs.c b/sysfs.c
index bc61b4a..7e7166e 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -33,29 +33,25 @@ char *read_field(char *base, char *name)
int n, fd;
struct stat st;
char *s;
- char *buf = NULL;
+ char *buf = xalloc(4096);
xasprintf(&fn, "%s/%s", base, name);
fd = open(fn, O_RDONLY);
free(fn);
if (fd < 0)
goto bad;
- if (fstat(fd, &st) < 0) {
- close(fd);
- goto bad;
- }
- buf = xalloc(st.st_size);
- n = read(fd, buf, st.st_size);
+ n = read(fd, buf, 4096);
close(fd);
if (n < 0)
goto bad_buf;
val = xalloc(n + 1);
memcpy(val, buf, n);
+ val[n] = 0;
free(buf);
s = memchr(val, '\n', n);
if (s)
*s = 0;
- return val;
+ return val;
bad_buf:
free(buf);
--
2.25.1

View File

@ -1,20 +1,27 @@
#needsrootforbuild
%define last_tar_version 168
%define mce_inject_ver 2013.01.19
%define aer_inject_ver 2010.03.10
Name: mcelog
Version: 168
Release: 1
Release: 6
Epoch: 3
Summary: Linux kernel machine check handling middleware
License: GPLv2
URL: https://github.com/andikleen/mcelog
Source0: v%{last_tar_version}.tar.gz
Source0: https://github.com/andikleen/%{name}/archive/v%{last_tar_version}.tar.gz
Source1: mce-inject-%{mce_inject_ver}.tar.bz2
Source2: aer-inject-%{aer_inject_ver}.tar.bz2
Source3: mcelog.conf
Patch0:backport-mcelog-Handle-sysfs-files-without-length.patch
Patch1:backport-fix-the-buf-not-freed-in-read_field.patch
Patch2:backport-fix-warnings-in-sysfs.patch
Patch3:backport-mcelog-Change-DDR4-string-to-DDR-for-i10nm-platforms.patch
ExclusiveArch: i686 x86_64
BuildRequires: bison flex systemd
BuildRequires: bison flex systemd gcc psmisc
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
@ -31,6 +38,10 @@ driver error recovery handler and PCIE AER core handler.
%prep
%setup -q -n %{name}-%{last_tar_version} -a 1 -a 2
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
make CFLAGS="$RPM_OPT_FLAGS -Wl,-z,relro,-z,now -fpie" LDFLAGS="-Wl,-z,relro,-z,now -fpie -pie"
@ -50,6 +61,10 @@ install -p -m644 mcelog.service $RPM_BUILD_ROOT%{_unitdir}/mcelog.service
destdir=$RPM_BUILD_ROOT make -C mce-inject-%{mce_inject_ver} install
install -p -m755 aer-inject-%{aer_inject_ver}/aer-inject $RPM_BUILD_ROOT/%{_sbindir}/aer-inject
%check
export PATH="$PATH:$RPM_BUILD_ROOT%{_sbindir}"
make test
%clean
rm -rf $RPM_BUILD_ROOT
@ -75,5 +90,20 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644,root,root) %{_mandir}/*/*
%changelog
* Mon Aug 21 2023 zhangnan <zhangnan134@huawei.com> - 3:168-6
- backport patches from upstream:change the DDR4 string to DDR to avoid confusion
* Fri Jun 16 2023 zhangruifang2020 <zhangruifang1@h-partners.com> - 3:168-5
- backport patches from upstream
* Tue Nov 22 2022 shixuantong <shixuantong1@huawei.com> - 3:168-4
- enable check
* Fri May 28 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 168-3
- The "cc:command not found" error message is displayed during compilation.Therefore,add buildrequires gcc.
* Wed Sep 2 2020 zhangxingliang <zhangxingliang3@huawei.com> - 168-2
- modify source url
* Thu Feb 27 2020 openEuler Buildteam <buildteam@openeuler.org> - 168-1
- Package init