From c83195e098ba171cee0cf4909c3108e2a3a4d09f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 29 2019 12:51:37 +0000 Subject: import opal-prd-6.0.4-5.el7_6 --- diff --git a/SOURCES/opal-prd-logrotate b/SOURCES/opal-prd-logrotate new file mode 100644 index 0000000..e46b2b2 --- /dev/null +++ b/SOURCES/opal-prd-logrotate @@ -0,0 +1,9 @@ +/var/log/opal-prd.log { + monthly + rotate 12 + compress + delaycompress + missingok + notifempty + create 644 root root +} diff --git a/SOURCES/opal-prd-rsyslog b/SOURCES/opal-prd-rsyslog new file mode 100644 index 0000000..ce89e38 --- /dev/null +++ b/SOURCES/opal-prd-rsyslog @@ -0,0 +1,3 @@ +if $programname == 'opal-prd' then /var/log/opal-prd.log +if $programname == 'opal-prd' and $syslogseverity <= 4 then /var/log/messages +if $programname == 'opal-prd' then ~ diff --git a/SOURCES/skiboot-6.0.4-e247710814227a7122915ff44474e0c8aa26fd3a.patch b/SOURCES/skiboot-6.0.4-e247710814227a7122915ff44474e0c8aa26fd3a.patch new file mode 100644 index 0000000..7717635 --- /dev/null +++ b/SOURCES/skiboot-6.0.4-e247710814227a7122915ff44474e0c8aa26fd3a.patch @@ -0,0 +1,100 @@ +commit e247710814227a7122915ff44474e0c8aa26fd3a +Author: Samuel Mendoza-Jonas +Date: Wed Nov 21 17:16:01 2018 +1100 + + libflash: Don't merge ECC-protected ranges + + Libflash currently merges contiguous ECC-protected ranges, but doesn't + check that the ECC bytes at the end of the first and start of the second + range actually match sanely. More importantly, if blocklevel_read() is + called with a position at the start of a partition that is contained + somewhere within a region that has been merged it will update the + position assuming ECC wasn't being accounted for. This results in the + position being somewhere well after the actual start of the partition + which is incorrect. + + For now, remove the code merging ranges. This means more ranges must be + held and checked however it prevents incorrectly reading ECC-correct + regions like below: + + [ 174.334119453,7] FLASH: CAPP partition has ECC + [ 174.437349574,3] ECC: uncorrectable error: ffffffffffffffff ff + [ 174.437426306,3] FLASH: failed to read the first 0x1000 from CAPP partition, rc 14 + [ 174.439919343,3] CAPP: Error loading ucode lid. index=201d1 + + Signed-off-by: Samuel Mendoza-Jonas + Signed-off-by: Stewart Smith + +diff --git a/libflash/blocklevel.c b/libflash/blocklevel.c +index bbcc8e61..5b57d3c6 100644 +--- a/libflash/blocklevel.c ++++ b/libflash/blocklevel.c +@@ -53,9 +53,9 @@ static int ecc_protected(struct blocklevel_device *bl, uint64_t pos, uint64_t le + } + + /* +- * Since we merge regions on inserting we can be sure that a +- * partial fit means that the non fitting region won't fit in another ecc +- * region ++ * Even if ranges are merged we can't currently guarantee two ++ * contiguous regions are sanely ECC protected so a partial fit ++ * is no good. + */ + if ((bl->ecc_prot.prot[i].start >= pos && bl->ecc_prot.prot[i].start < pos + len) || + (bl->ecc_prot.prot[i].start <= pos && +@@ -696,26 +696,6 @@ static bool insert_bl_prot_range(struct blocklevel_range *ranges, struct bl_prot + prot = new_ranges; + } + +- /* Probably only worth mergeing when we're low on space */ +- if (ranges->n_prot + 1 == ranges->total_prot) { +- FL_DBG("%s: merging ranges\n", __func__); +- /* Check to see if we can merge ranges */ +- for (i = 0; i < ranges->n_prot - 1; i++) { +- if (prot[i].start + prot[i].len == prot[i + 1].start) { +- int j; +- FL_DBG("%s: merging 0x%" PRIx64 "..0x%" PRIx64 " with " +- "0x%" PRIx64 "..0x%" PRIx64 "\n", +- __func__, prot[i].start, prot[i].start + prot[i].len, +- prot[i + 1].start, prot[i + 1].start + prot[i + 1].len); +- prot[i].len += prot[i + 1].len; +- for (j = i + 1; j < ranges->n_prot - 1; j++) +- memcpy(&prot[j] , &prot[j + 1], sizeof(range)); +- ranges->n_prot--; +- i--; /* Maybe the next one can merge too */ +- } +- } +- } +- + return true; + } + +diff --git a/libflash/test/test-blocklevel.c b/libflash/test/test-blocklevel.c +index 42ad146a..a67f5888 100644 +--- a/libflash/test/test-blocklevel.c ++++ b/libflash/test/test-blocklevel.c +@@ -289,24 +289,6 @@ int main(void) + ERR("Failed to blocklevel_ecc_protect(0x6200, 0x100)\n"); + return 1; + } +- /*This addition should cause this one to merge the other two together*/ +- if (blocklevel_ecc_protect(bl, 0x6100, 0x100)) { +- ERR("Failed to blocklevel_ecc_protect(0x6100, 0x100)\n"); +- return 1; +- } +- /* Make sure we trigger the merging code */ +- for (i = bl->ecc_prot.n_prot; i < bl->ecc_prot.total_prot; i++) +- blocklevel_ecc_protect(bl, 0x10000 + i * 0x200, 0x10); +- /* Check that the region merging works */ +- for (i = 0; i < bl->ecc_prot.n_prot - 1; i++) { +- if (bl->ecc_prot.prot[i].start + bl->ecc_prot.prot[i].len == bl->ecc_prot.prot[i + 1].start || +- bl->ecc_prot.prot[i + 1].start + bl->ecc_prot.prot[i + 1].len == bl->ecc_prot.prot[i].start) { +- ERR("Problem with protection range merge code, region starting at 0x%08lx for 0x%08lx appears " +- "to touch region 0x%lx for 0x%lx\n", bl->ecc_prot.prot[i].start, bl->ecc_prot.prot[i].len, +- bl->ecc_prot.prot[i + 1].start, bl->ecc_prot.prot[i + 1].len); +- return 1; +- } +- } + + /* Test ECC reading and writing being 100% transparent to the + * caller */ diff --git a/SPECS/opal-prd.spec b/SPECS/opal-prd.spec index afeec64..e491287 100644 --- a/SPECS/opal-prd.spec +++ b/SPECS/opal-prd.spec @@ -2,7 +2,7 @@ Name: opal-prd Version: 6.0.4 -Release: 2%{?dist} +Release: 5%{?dist} Summary: OPAL Processor Recovery Diagnostics Daemon Group: System Environment/Daemons @@ -24,12 +24,16 @@ Requires(preun): systemd Requires(postun): systemd Source0: https://github.com/open-power/%{project}/archive/v%{version}/%{project}-%{version}.tar.gz +Source1: opal-prd-rsyslog +Source2: opal-prd-logrotate # https://github.com/open-power/skiboot/issues/160 Patch0: skiboot-5.10.2-alignment.patch # 1596245 - "diag_encl -d" creates xml file with blank space in file name also # file contains attributes with NULL value. Patch1: skiboot-6.0.4-77f510d35e8d60faed989496fac2de16663ff332.patch Patch2: skiboot-6.0.4-861350941f9a3fb76ebcae3e5a32b3cbec929d03.patch +# bz#1704699 - RHEL-Alt-7.6 - opal-gard binary doesn't list GUARD records from PNOR +Patch3: skiboot-6.0.4-e247710814227a7122915ff44474e0c8aa26fd3a.patch %description This package provides a daemon to load and run the OpenPower firmware's @@ -64,6 +68,7 @@ services to the OS (Linux) on IBM Power and OpenPower systems. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build OPAL_PRD_VERSION=%{version} make V=1 CC="gcc" CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" -C external/opal-prd @@ -82,8 +87,11 @@ SKIBOOT_VERSION=%{version} make V=1 CROSS= %install make -C external/opal-prd install DESTDIR=%{buildroot} prefix=/usr make -C external/gard install DESTDIR=%{buildroot} prefix=/usr -cp external/pflash/pflash %{buildroot}%{_sbindir} -cp external/xscom-utils/{get,put}scom %{buildroot}%{_sbindir} +make -C external/pflash install DESTDIR=%{buildroot} prefix=/usr +make -C external/xscom-utils install DESTDIR=%{buildroot} prefix=/usr + +# drop getsram for 7.6.x +rm -f %{buildroot}%{_sbindir}/getsram %{buildroot}%{_mandir}/man1/getsram* mkdir -p %{buildroot}%{_unitdir} install -m 644 -p external/opal-prd/opal-prd.service %{buildroot}%{_unitdir}/opal-prd.service @@ -92,6 +100,11 @@ mkdir -p %{buildroot}%{_datadir}/qemu install -m 644 -p skiboot.lid %{buildroot}%{_datadir}/qemu/skiboot.lid install -m 644 -p skiboot.lid.xz %{buildroot}%{_datadir}/qemu/skiboot.lid.xz +# log opal-prd messages to /var/log/opal-prd.log +mkdir -p %{buildroot}%{_sysconfdir}/{rsyslog.d,logrotate.d} +install -m 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/rsyslog.d/opal-prd.conf +install -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/opal-prd + %post %systemd_post opal-prd.service @@ -104,6 +117,8 @@ install -m 644 -p skiboot.lid.xz %{buildroot}%{_datadir}/qemu/skiboot.lid.xz %files %doc README.md %license LICENCE +%config(noreplace) %{_sysconfdir}/logrotate.d/opal-prd +%config(noreplace) %{_sysconfdir}/rsyslog.d/opal-prd.conf %{_sbindir}/opal-prd %{_unitdir}/opal-prd.service %{_mandir}/man8/* @@ -123,6 +138,15 @@ install -m 644 -p skiboot.lid.xz %{buildroot}%{_datadir}/qemu/skiboot.lid.xz %{_datadir}/qemu/ %changelog +* Tue Jun 04 2019 Than Ngo - 6.0.4-5 +- Resolves: #1716855, log messages to /var/log/opal-prd.log + +* Mon May 13 2019 Than Ngo - 6.0.4-4 +- Related: #1704699 - added missing manpages + +* Mon May 13 2019 Than Ngo - 6.0.4-3 +- Resolves: #1704699 - opal-gard binary doesn't list GUARD records from PNO + * Thu Jun 28 2018 Than Ngo - 6.0.4-2 - Resolves: #1596245 - "diag_encl -d" creates xml file with blank space in file name