Hello community, here is the log from the commit of package powerpc-utils.12087 for openSUSE:Leap:15.1:Update checked in at 2020-03-08 08:39:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.1:Update/powerpc-utils.12087 (Old) and /work/SRC/openSUSE:Leap:15.1:Update/.powerpc-utils.12087.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerpc-utils.12087" Sun Mar 8 08:39:33 2020 rev:1 rq:782087 version:1.3.7.1 Changes: -------- New Changes file: --- /dev/null 2019-12-19 10:12:34.003146842 +0100 +++ /work/SRC/openSUSE:Leap:15.1:Update/.powerpc-utils.12087.new.26092/powerpc-utils.changes 2020-03-08 08:39:33.765747750 +0100 @@ -0,0 +1,1306 @@ +------------------------------------------------------------------- +Wed Jan 15 08:37:36 UTC 2020 - Josef Möllers <josef.moell...@suse.com> + +- * Deal with error messages returned sometimes by evaluation + of ${devspec} in 'ofpathname'. + * Strip embedded nulls from values provided by kernel files. + * Redirect more error messages to /dev/null + [bsc#1116561, + 0001-powerpc-utils-Suppress-errors-reading-kernel-files.patch] + +------------------------------------------------------------------- +Tue Dec 3 15:55:46 UTC 2019 - Josef Möllers <josef.moell...@suse.com> + +- Parse new DRC Info: Define data structures to support parsing + the new "ibm,drc-info" device tree property. Integrate the new + property information into the existing search mechanisms of the + userspace 'drmgr' driver. + [jsc#SLE-11094, jsc#SLE-11193, jsc#SLE-11092, jsc#SLE-11319, jsc#ECO-935, + bsc#1158312, bsc#1161925, fate#326955 + bug-1158312-parse-ibm-drc-info-property.patch] + +- Bump package version to be able to tell the fix for jsc#SLE-11092 is included + Kernel can depend on the fixed version this way. + +------------------------------------------------------------------- +Tue Dec 3 15:55:46 UTC 2019 - Josef Möllers <josef.moell...@suse.com> + +- Parse new DRC Info: Define data structures to support parsing + the new "ibm,drc-info" device tree property. Integrate the new + property information into the existing search mechanisms of the + userspace 'drmgr' driver. + [bsc#1158312, bug-1158312-parse-ibm-drc-info-property.patch] + +------------------------------------------------------------------- +Wed Jul 3 06:59:23 UTC 2019 - jmoell...@suse.de + +- Change the file permissions of smt_off.service to 644 + [powerpc-utils.spec, bsc#1139777] + +------------------------------------------------------------------- +Thu Jun 27 15:35:42 UTC 2019 - Michal Suchanek <msucha...@suse.de> + +- Drop compat patch on SLE 12 SP5. +- Remove unused macro + +------------------------------------------------------------------- +Tue Jun 11 15:15:48 UTC 2019 - josef.moell...@suse.com + +- Update to version 1.3.7 (jsc#SLE-6176, bsc#1139456). + - lparstat: + - add an option to print the lparstat report similar to + legacy lparstat tool + - introduce the help command line option to print + lparstat usage + - restrict the physc and entc attribute values to two decimal + places + - correct calculation of physc to use tbr + - Enable desired and maximum memory stats + - Show available physical processors in the shared pool + - scripts: Improve handling of errors from subsidiary scripts + - man/update_flash: + - Add details to extract rpm format image + - Fix man page + - ppc64_cpu: Limit number of CPUs for frequency calculation + - lsslot: + - Add ibm,dynamic-memory-v2 parsing capability + - Split dynamic-memory v1 parsing into separate routine + - Patch to display logical name using bootlist -o option + - Refresh ofpathname_powernv.patch, systemd-dir.patch, + Revert-lparstat-Show-available-physical-processors-i.patch + +------------------------------------------------------------------- +Fri Jan 18 23:18:49 UTC 2019 - Michal Suchanek <msucha...@suse.com> + +- ibmvscsis module we ship no longer needs support in powerpc-utils + (bsc#1120474). + - Remove Revert-ibmvscsis-remove-deprecated-ibmvscsis-scripts.patch + +------------------------------------------------------------------- +Mon Dec 17 12:26:15 UTC 2018 - Michal Suchanek <msucha...@suse.de> + +- Update to upstream v1.3.6 (FATE#326519, bsc#1120474) + (see Changelog under powerpc-utils-1.3.6/Changelog) +- remove upstreamed patches + - bootlist-Display-logical-name-using-bootlist-o-option.patch + - lsslot-Add-ibm-dynamic-memory-v2-parsing-capability.patch + - lsslot-Split-dynamic-memory-v1-parsing-into-separate.patch + - powerpc-utils.bug-1109046_cpu-Limit-number-of-CPUs-for-frequency-calc.patch +- Patch to preserve compatibility with v1.3.4, v1.3.5 + + Revert-lparstat-Show-available-physical-processors-i.patch +- Keep support for ibmvscsis which we still ship + + Revert-ibmvscsis-remove-deprecated-ibmvscsis-scripts.patch + +------------------------------------------------------------------- +Mon Sep 24 09:35:18 UTC 2018 - jloe...@suse.com + +- limit number of CPUs for frequency calculation (bsc#1109046) + +- added patches: + * powerpc-utils.bug-1109046_cpu-Limit-number-of-CPUs-for-frequency-calc.patch + +------------------------------------------------------------------- +Wed Aug 8 11:46:06 UTC 2018 - msucha...@suse.com + +- Add support for ibm,dynamic-memory-v2 devicetree property (bsc#1103283) + * lsslot-Split-dynamic-memory-v1-parsing-into-separate.patch + * lsslot-Add-ibm-dynamic-memory-v2-parsing-capability.patch + +- Display logical name using bootlist -o option (bsc#1099910) + * bootlist-Display-logical-name-using-bootlist-o-option.patch + +------------------------------------------------------------------- +Wed Jun 20 09:54:04 UTC 2018 - jloe...@suse.com + +- version update to 1.3.5 (fate#324948) + (see Changelog under powerpc-utils-1.3.5/Changelog) + +- removed patches: + * drmgr-load-rpadlpar_io-on-C-as-well.patch + * Revert-lsslot-free-lmb_list-on-error.patch + +------------------------------------------------------------------- +Wed Apr 4 10:36:11 UTC 2018 - tchva...@suse.com + +- Fix build failure (bsc#1088577) + +------------------------------------------------------------------- +Thu Mar 22 11:11:15 UTC 2018 - tchva...@suse.com + +- Use spec-cleaner to get %license and SPDX-3.0 string + +------------------------------------------------------------------- +Wed Mar 21 16:31:46 UTC 2018 - msucha...@suse.com + +- Revert-lsslot-free-lmb_list-on-error.patch (bsc#1086268) + +------------------------------------------------------------------- +Thu Dec 14 13:45:35 UTC 2017 - msucha...@suse.com + +- Update drmgr-load-rpadlpar_io-on-C-as-well.patch to more robust solution. + +------------------------------------------------------------------- +Thu Nov 30 17:41:30 UTC 2017 - msucha...@suse.com + +- drmgr: load rpadlpar_io on -C as well (bnc#1064039, bsc#1070113) + * drmgr-load-rpadlpar_io-on-C-as-well.patch + +------------------------------------------------------------------- +Fri Oct 20 08:56:52 UTC 2017 - jloe...@suse.com + +- version update to 1.3.4 (fate#323767) + (see Changelog under powerpc-utils-1.3.4/Changelog) + +- modified patches: + * libvirt-service-dep.patch + * ofpathname_powernv.patch + * powerpc-utils-lsprop.patch + * systemd-dir.patch + +- deleted paches: + * powerpc-utils.bug-1039711_ofpathname-avoid-duplicate-entries-of-vFC-devices.patch + * powerpc-utils.bug-1040076_test-for-zlib-presence-at-configuration-time.patch + * powerpc-utils.bug-1041531_lsdevinfo-Add-support-for-vNIC-devices.patch + * powerpc-utils.bug-1041531_ofpathname-Add-support-for-vNIC-devices.patch + * powerpc-utils.bug-1042239_lsslot-Rectify-usr_drc_name-check.patch + * powerpc-utils.bug-1043569_drmgr-Correct-drc-type-checking-in-check_kmods.patch + +------------------------------------------------------------------- +Mon Jun 12 10:13:52 UTC 2017 - msucha...@suse.com + +- add powerpc-utils.bug-1043569_drmgr-Correct-drc-type-checking-in-check_kmods.patch + drmgr does not load rpadlpar_io module automatically (bsc#1043569) + +------------------------------------------------------------------- +Fri Jun 2 11:03:13 UTC 2017 - msucha...@suse.com + +- add powerpc-utils.bug-1042239_lsslot-Rectify-usr_drc_name-check.patch + lsslot doesn't display the slot information (bsc#1042239) + +------------------------------------------------------------------- +Tue May 30 08:50:53 UTC 2017 - msucha...@suse.com + +- add patches to enable support for vNIC devices (bsc#1041531) + * powerpc-utils.bug-1041531_lsdevinfo-Add-support-for-vNIC-devices.patch + * powerpc-utils.bug-1041531_ofpathname-Add-support-for-vNIC-devices.patch + +------------------------------------------------------------------- +Mon May 29 06:36:47 UTC 2017 - jloe...@suse.com + +- avoid duplicate entries of a Open Firmware device path to logical + device path for vfc-client devices (bsc#1039711) +- test for zlib presence at configuration time (bsc#1040076) + +- added patches: + * powerpc-utils.bug-1039711_ofpathname-avoid-duplicate-entries-of-vFC-devices.patch + * powerpc-utils.bug-1040076_test-for-zlib-presence-at-configuration-time.patch + ++++ 1109 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:Leap:15.1:Update/.powerpc-utils.12087.new.26092/powerpc-utils.changes New: ---- 0001-powerpc-utils-Suppress-errors-reading-kernel-files.patch Revert-lparstat-Show-available-physical-processors-i.patch bug-1158312-parse-ibm-drc-info-property.patch libvirt-service-dep.patch nvsetenv ofpathname_powernv.patch powerpc-utils-1.3.7.tar.gz powerpc-utils-lsprop.patch powerpc-utils.changes powerpc-utils.spec systemd-dir.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerpc-utils.spec ++++++ # # spec file for package powerpc-utils # # Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define realversion 1.3.7 Name: powerpc-utils Version: %{realversion}.1 Release: 0 Summary: Utilities for PowerPC Hardware License: GPL-2.0-or-later Group: System/Management URL: https://github.com/ibm-power-utilities/powerpc-utils Source0: https://github.com/ibm-power-utilities/powerpc-utils/archive/v%{realversion}.tar.gz#/%{name}-%{realversion}.tar.gz Source1: nvsetenv Patch1: powerpc-utils-lsprop.patch Patch2: ofpathname_powernv.patch Patch3: systemd-dir.patch Patch4: libvirt-service-dep.patch # This adds field in the middle of tool output so revert it again in < 15.1 Patch5: Revert-lparstat-Show-available-physical-processors-i.patch Patch6: bug-1158312-parse-ibm-drc-info-property.patch Patch7: 0001-powerpc-utils-Suppress-errors-reading-kernel-files.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: librtas-devel BuildRequires: pkgconfig BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(zlib) Requires: bc Requires: coreutils Requires: findutils Requires: gawk Requires: grep Requires: kmod-compat Requires: systemd-sysvinit Requires: udev Requires: util-linux Recommends: powerpc-utils-python ExclusiveArch: ppc ppc64 ppc64le %{?systemd_requires} %description The powerpc-utils package provides a set of tools and utilities and utilities for maintaining and enabling certain features of Linux on Power. %prep %setup -q -n %{name}-%{realversion} %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %if 0%{?sle_version} <= 120400 || 0%{?sle_version} == 150000 %patch5 -p1 %endif %patch6 -p1 %patch7 -p1 %build autoreconf -fvi %configure \ --disable-silent-rules \ --with-systemd=%{buildroot}%{_unitdir} make CFLAGS="%{optflags}" %{?_smp_mflags} %install %make_install \ rasdir=%{_sbindir} \ mandir=%{_mandir} mkdir %{buildroot}/sbin ln -sf %{_sbindir}/lsprop %{buildroot}/sbin/lsprop install -m 755 %{SOURCE1} %{buildroot}%{_sbindir}/nvsetenv ln -sf serv_config %{buildroot}%{_sbindir}/uspchrp ln -sf %{_mandir}/man8/serv_config.8 %{buildroot}%{_mandir}/man8/uspchrp.8 ln -sf drmgr %{buildroot}%{_sbindir}/drslot_chrp_slot ln -sf drmgr %{buildroot}%{_sbindir}/drslot_chrp_pci ln -sf drmgr %{buildroot}%{_sbindir}/drslot_chrp_cpu ln -sf drmgr %{buildroot}%{_sbindir}/drslot_chrp_phb ln -sf drmgr %{buildroot}%{_sbindir}/drslot_chrp_mem ln -sf drmgr %{buildroot}%{_sbindir}/drslot_chrp_hea ln -sf drmgr %{buildroot}%{_sbindir}/drmig_chrp_pmig ln -s service %{buildroot}%{_sbindir}/rcsmt_off # remove docu installed by make_install as we hand-install them in %files rm -rf %{buildroot}%{_docdir}/%{name}/* %pre %service_add_pre smt_off.service %post %service_add_post smt_off.service %preun %service_del_preun smt_off.service %postun %service_del_postun smt_off.service %files %license COPYING %doc README Changelog %{_mandir}/man*/* %{_sbindir}/* %{_bindir}/* /sbin/lsprop %attr(644, -, -) %{_unitdir}/smt_off.service %changelog ++++++ 0001-powerpc-utils-Suppress-errors-reading-kernel-files.patch ++++++ >From 73839d6bab4da24350a60105b7b2c3a6cc7d3a15 Mon Sep 17 00:00:00 2001 From: Michael Bringmann <m...@linux.vnet.ibm.com> Date: Fri, 26 Jul 2019 09:10:51 -0500 Subject: [PATCH] powerpc-utils: Suppress errors reading kernel files A problem was observed with the evaluation of the '${devspec} by the script 'ofpathname'. The problem occurred during installation to an nvme device as follows: 02:29:41,669 INF program: Running... ofpathname /dev/nvme0n1p1 02:29:41,922 INF program: /sbin/ofpathname: line 684: warning: command substitution: ignored null byte in input Detailed examination showed that instances of the device-tree property "/namespace/name" within one or more of the PCI devices contained null bytes which were echoed along with the value e.g. [root device-tree]# cat /proc/device-tree/pci@800000020000029/pci1014,637@0/namespace/name | hexdump -C 00000000 6e 61 6d 65 73 70 61 63 65 00 |namespace.| 0000000a [root device-tree]# This patch provides improves handling of errors within that script, and by some of the follow-on uses of the tool by the 'bootlist' script. * Deal with error messages returned sometimes by evaluation of ${devspec} in 'ofpathname'. * Strip embedded nulls from values provided by kernel files. * Redirect more error messages to /dev/null Signed-off-by: Michael Bringmann <m...@linux.vnet.ibm.com> Signed-off-by: Tyrel Datwyler <tyr...@linux.vnet.ibm.com> --- scripts/bootlist | 8 ++++---- scripts/ofpathname | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) Index: powerpc-utils-1.3.7/scripts/bootlist =================================================================== --- powerpc-utils-1.3.7.orig/scripts/bootlist +++ powerpc-utils-1.3.7/scripts/bootlist @@ -207,11 +207,11 @@ show_bootlist() local devlist=$1 local i - for i in `$NVRAM --print-config=${devlist} | sed 's/ /\n/g'`; do + for i in `$NVRAM --print-config=${devlist} 2> /dev/null | sed 's/ /\n/g'`; do if [[ $TRANSLATE_NAMES = "yes" ]]; then name=`get_logical_device_name $i` if [[ -z $name ]]; then - echo "Could not translate $i to logical device name" + echo "Could not translate $i to logical device name" >&2 else case $name in eth*) parse_eth_info $name $i ;; @@ -230,7 +230,7 @@ show_bootlist() . $PSERIES_PLATFORM if [[ $platform != $PLATFORM_PSERIES_LPAR ]]; then - echo "bootlist: is not supported on the $platform_name platform" + echo "bootlist: is not supported on the $platform_name platform" >&2 exit 1 fi Index: powerpc-utils-1.3.7/scripts/ofpathname =================================================================== --- powerpc-utils-1.3.7.orig/scripts/ofpathname +++ powerpc-utils-1.3.7/scripts/ofpathname @@ -656,7 +656,7 @@ l2of_nvme() goto_dir $PWD "device/devspec" - devspec=`$CAT $PWD/device/devspec` + devspec=`$CAT $PWD/device/devspec | tr -d '\000'` if [[ -n $devspec ]]; then found=1 break @@ -681,7 +681,7 @@ l2of_nvme() # Device type is usually 'namespace'. # Get it from device-tree just in case. - devtype=`$CAT /proc/device-tree${devspec}/namespace/name` + devtype=`$CAT /proc/device-tree${devspec}/namespace/name | tr -d '\000'` 2> /dev/null if [[ -z $devtype ]]; then err $ERR_NO_OFPATH fi ++++++ Revert-lparstat-Show-available-physical-processors-i.patch ++++++ Index: powerpc-utils-1.3.7/man/lparstat.8 =================================================================== --- powerpc-utils-1.3.7.orig/man/lparstat.8 +++ powerpc-utils-1.3.7/man/lparstat.8 @@ -83,9 +83,6 @@ Shows the percentage of the entitled cap lbusy Shows the percentage of logical processor(s) utilization that occurred while executing at the user and system level. .TP -app -Shows the available physical processors in the shared pool. -.TP phint Shows the number of phantom (targeted to another shared partition in this pool) interruptions received. .SH OPTIONS Index: powerpc-utils-1.3.7/src/lparstat.c =================================================================== --- powerpc-utils-1.3.7.orig/src/lparstat.c +++ powerpc-utils-1.3.7/src/lparstat.c @@ -126,32 +126,6 @@ int get_time_base() return 0; } -void get_sys_uptime(struct sysentry *unused_se, char *uptime) -{ - FILE *f; - char buf[80]; - - f = fopen("/proc/uptime", "r"); - if (!f) { - fprintf(stderr, "Could not open /proc/uptime\n"); - sprintf(uptime, SE_NOT_VALID); - return; - } - - if ((fgets(buf, 80, f)) != NULL) { - char *value; - - value = strchr(buf, ' '); - *value = '\0'; - sprintf(uptime, "%s", buf); - } else { - sprintf(uptime, SE_NOT_VALID); - } - - fclose(f); -} - - void get_cpu_physc(struct sysentry *unused_se, char *buf) { struct sysentry *se; @@ -194,44 +168,6 @@ void get_per_entc(struct sysentry *unuse sprintf(buf, "%.2f", atof(physc) / atof(entc) * 100.0); } -void get_cpu_app(struct sysentry *unused_se, char *buf) -{ - struct sysentry *se; - float timebase, app, elapsed_time; - long long new_app, old_app, newtime, oldtime; - char *descr, uptime[32]; - - se = get_sysentry("time"); - if (se->old_value[0] == '\0') { - /* Single report since boot */ - get_sysdata("uptime", &descr, uptime); - - if (!strcmp(uptime, SE_NOT_VALID)) { - sprintf(buf, "-"); - return; - } - elapsed_time = atof(uptime); - } else { - newtime = strtoll(se->value, NULL, 0); - oldtime = strtoll(se->old_value, NULL, 0); - elapsed_time = (newtime - oldtime) / 1000000.0; - } - - se = get_sysentry("timebase"); - timebase = atof(se->value); - - se = get_sysentry("pool_idle_time"); - new_app = strtoll(se->value, NULL, 0); - if (se->old_value[0] == '\0') { - old_app = 0; - } else { - old_app = strtoll(se->old_value, NULL, 0); - } - - app = (new_app - old_app)/timebase/elapsed_time; - sprintf(buf, "%.2f", app); -} - int parse_lparcfg() { FILE *f; @@ -615,14 +551,14 @@ int print_iflag_data() void print_default_output(int interval, int count) { - char *fmt = "%5s %5s %5s %8s %8s %5s %5s %5s %5s %5s\n"; + char *fmt = "%5s %5s %5s %8s %8s %5s %5s %5s %5s\n"; char *descr; char buf[128]; int offset, smt, active_proc; char type[32]; char value[32]; char user[32], sys[32], wait[32], idle[32], physc[32], entc[32]; - char lbusy[32], app[32], vcsw[32], phint[32]; + char lbusy[32], vcsw[32], phint[32]; memset(buf, 0, 128); get_sysdata("shared_processor_mode", &descr, value); @@ -657,9 +593,9 @@ void print_default_output(int interval, fprintf(stdout, "\nSystem Configuration\n%s\n\n", buf); fprintf(stdout, fmt, "\%user", "\%sys", "\%wait", "\%idle", "physc", - "\%entc", "lbusy", "app", "vcsw", "phint"); + "\%entc", "lbusy", "vcsw", "phint"); fprintf(stdout, fmt, "-----", "-----", "-----", "-----", "-----", - "-----", "-----", "-----", "-----", "-----"); + "-----", "-----", "-----", "-----"); do { if (interval) { @@ -676,10 +612,9 @@ void print_default_output(int interval, get_sysdata("physc", &descr, physc); get_sysdata("per_entc", &descr, entc); get_sysdata("phint", &descr, phint); - get_sysdata("app", &descr, app); fprintf(stdout, fmt, user, sys, wait, idle, physc, entc, - lbusy, app, vcsw, phint); + lbusy, vcsw, phint); fflush(stdout); } while (--count > 0); } Index: powerpc-utils-1.3.7/src/lparstat.h =================================================================== --- powerpc-utils-1.3.7.orig/src/lparstat.h +++ powerpc-utils-1.3.7/src/lparstat.h @@ -46,8 +46,6 @@ extern void get_smt_mode(struct sysentry extern void get_cpu_stat(struct sysentry *, char *); extern void get_cpu_physc(struct sysentry *, char *); extern void get_per_entc(struct sysentry *, char *); -extern void get_cpu_app(struct sysentry *, char *); -extern void get_sys_uptime(struct sysentry *, char *); struct sysentry system_data[] = { /* System Names */ @@ -227,9 +225,6 @@ struct sysentry system_data[] = { {.name = "per_entc", .descr = "Entitled CPU Consumed", .get = &get_per_entc}, - {.name = "app", - .descr = "Available physical CPUs in pool", - .get = &get_cpu_app}, /* Time */ {.name = "time", @@ -243,11 +238,6 @@ struct sysentry system_data[] = { {.name = "phint", .descr = "Phantom Interrupts"}, - /* /proc/uptime */ - {.name = "uptime", - .descr = "System Uptime", - .get = &get_sys_uptime}, - {.name[0] = '\0'}, }; ++++++ bug-1158312-parse-ibm-drc-info-property.patch ++++++ >From b0586b5938e9d371e55671422b2f0a5d2cd10c54 Mon Sep 17 00:00:00 2001 From: Michael Bringmann <m...@linux.vnet.ibm.com> Date: Wed, 2 Oct 2019 16:54:52 -0500 Subject: [PATCH] powerpc-utils/devtree: Parse 'ibm,drc-info' property Parse new DRC Info: Define data structures to support parsing the new "ibm,drc-info" device tree property. Integrate the new property information into the existing search mechanisms of the userspace 'drmgr' driver. Signed-off-by: Michael Bringmann <m...@linux.vnet.ibm.com> Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com> --- src/drmgr/common_ofdt.c | 223 ++++++++++++++++++++++++++++++++++------ 1 file changed, 194 insertions(+), 29 deletions(-) diff --git a/src/drmgr/common_ofdt.c b/src/drmgr/common_ofdt.c index 8c9e224..c110bc0 100644 --- a/src/drmgr/common_ofdt.c +++ b/src/drmgr/common_ofdt.c @@ -41,6 +41,16 @@ struct drc_prop_grp { struct of_list_prop drc_domains; }; +struct drc_info { + char *drc_type; + char *drc_name_prefix; + int drc_index_start; + int drc_name_suffix_start; + int n_seq_elems; + int seq_inc; + int drc_power_domain; +}; + struct dr_connector *all_drc_lists = NULL; /** @@ -186,6 +196,169 @@ build_connectors_list(struct drc_prop_grp *group, int n_entries, return 0; } +/** + * drc_info_connectors_v1 + * + * @param full_path + * @param ofdt_path + * @param list + * @returns 0 on success, !0 otherwise + */ +static int drc_info_connectors_v1(char *full_path, char *ofdt_path, + struct dr_connector **list) +{ + struct dr_connector *out_list = NULL; + struct drc_prop_grp prop_grp; + struct of_list_prop *drc_names; + int n_drcs; + int rc = 0; + + rc = get_drc_prop_grp(full_path, &prop_grp); + if (rc) { + say(DEBUG, + "Could not find DRC property group in path: %s.\n", + full_path); + goto done; + } + + drc_names = &prop_grp.drc_names; + n_drcs = drc_names->n_entries; + + out_list = zalloc(n_drcs * sizeof(struct dr_connector)); + if (out_list == NULL) + goto done; + + build_connectors_list(&prop_grp, n_drcs, out_list); + +done: + if (rc) { + free_drc_props(&prop_grp); + free(out_list); + } else { + snprintf(out_list->ofdt_path, DR_PATH_MAX, "%s", ofdt_path); + *list = out_list; + } + + return rc; +} + +/** + * drc_info_connectors_v2 + * + * @param full_path + * @param ofdt_path + * @param list + * @returns 0 on success, !0 otherwise + */ +static int drc_info_connectors_v2(char *full_path, char *ofdt_path, + struct dr_connector **list) +{ + struct dr_connector *out_list = NULL; + struct drc_info info; + char *prop_name = "ibm,drc-info"; + char *prop_data, *data_ptr; + int i, j, n_entries, size, connector_size, ics, rc; + + size = get_property_size(full_path, prop_name); + prop_data = zalloc(size); + if (prop_data == NULL) + return -1; + rc = get_property(full_path, prop_name, prop_data, size); + if (rc) { + free(prop_data); + return -1; + } + + /* Num of DRC-info sets */ + data_ptr = prop_data; + n_entries = be32toh(*(uint *)data_ptr); + data_ptr += 4; + + /* Extract drc-info data */ + for (j = 0, connector_size = 0; j < n_entries; j++) { + info.drc_type = data_ptr; + data_ptr += strlen(info.drc_type)+1; + info.drc_name_prefix = data_ptr; + data_ptr += strlen(info.drc_name_prefix)+1; + data_ptr += 4; /* Skip drc-index-start */ + data_ptr += 4; /* Skip drc-name-suffix-start */ + info.n_seq_elems = be32toh(*(uint *)data_ptr); + data_ptr += 4; /* Advance over n-seq-elems */ + data_ptr += 4; /* Skip sequential-increment */ + data_ptr += 4; /* Skip drc-power-domain */ + if (info.n_seq_elems <= 0) + continue; + connector_size += info.n_seq_elems; + } + + /* Allocate list entry */ + out_list = zalloc(connector_size * sizeof(struct dr_connector)); + if (out_list == NULL) { + rc = -1; + goto done; + } + + /* Extract drc-info data */ + data_ptr = prop_data; + data_ptr += 4; + for (j = 0, ics = 0; j < n_entries; j++) { + info.drc_type = data_ptr; + data_ptr += strlen(info.drc_type)+1; + info.drc_name_prefix = data_ptr; + data_ptr += strlen(info.drc_name_prefix)+1; + + info.drc_index_start = be32toh(*(uint *)data_ptr); + data_ptr += 4; + + info.drc_name_suffix_start = be32toh(*(uint *)data_ptr); + data_ptr += 4; + + info.n_seq_elems = be32toh(*(uint *)data_ptr); + data_ptr += 4; + + info.seq_inc = be32toh(*(uint *)data_ptr); + data_ptr += 4; + + info.drc_power_domain = be32toh(*(uint *)data_ptr); + data_ptr += 4; + + /* Build connector list */ + if (info.n_seq_elems <= 0) + continue; + + for (i = 0; i < info.n_seq_elems; i++, ics++) { + out_list[ics].index = info.drc_index_start+ + (i*info.seq_inc); + out_list[ics].powerdomain = info.drc_power_domain; + + sprintf(out_list[ics].name, "%s%d", + info.drc_name_prefix, + info.drc_name_suffix_start+(i*info.seq_inc)); + + strncpy(out_list[ics].type, info.drc_type, DRC_STR_MAX); + + out_list[ics].next = &out_list[ics+1]; + } + } + if (ics > 0) + out_list[ics-1].next = NULL; + +done: + if (prop_data) + free(prop_data); + + if (rc) { + free(out_list); + *list = NULL; + } else { + snprintf(out_list->ofdt_path, DR_PATH_MAX, "%s", ofdt_path); + *list = out_list; + } + + return rc; +} + + /** * of_to_full_path * @@ -232,11 +405,12 @@ of_to_full_path(const char *of_path) struct dr_connector * get_drc_info(const char *of_path) { - struct dr_connector *list = NULL; - struct of_list_prop *drc_names; - struct drc_prop_grp prop_grp; + struct stat sbuf; + char fname[DR_PATH_MAX]; + char ofdt_path[DR_PATH_MAX]; char *full_path = NULL; - int rc, n_drcs; + struct dr_connector *list = NULL; + int rc; for (list = all_drc_lists; list; list = list->all_next) { if (! strcmp(list->ofdt_path, of_path)) @@ -246,33 +420,24 @@ get_drc_info(const char *of_path) full_path = of_to_full_path(of_path); if (full_path == NULL) return NULL; - - rc = get_drc_prop_grp(full_path, &prop_grp); - if (rc) { - say(DEBUG, "Could not find DRC property group in path: %s.\n", - full_path); - goto done; - } - drc_names = &prop_grp.drc_names; - n_drcs = drc_names->n_entries; - - list = zalloc(n_drcs * sizeof(struct dr_connector)); - if (list == NULL) - goto done; - - /* XXX Unchecked rc */ - rc = build_connectors_list(&prop_grp, n_drcs, list); - - snprintf(list->ofdt_path, DR_PATH_MAX, "%s", of_path); - - list->all_next = all_drc_lists; - all_drc_lists = list; + /* ibm,drc-info vs the old implementation */ + sprintf(fname, "%s/%s", full_path, "ibm,drc-info"); + snprintf(ofdt_path, DR_PATH_MAX, "%s", of_path); + rc = stat(fname, &sbuf); + if (rc) + rc = drc_info_connectors_v1(full_path, ofdt_path, &list); + else + rc = drc_info_connectors_v2(full_path, ofdt_path, &list); -done: - free_drc_props(&prop_grp); - if (full_path) - free(full_path); + if (rc == 0) { + list->all_next = all_drc_lists; + all_drc_lists = list; + } else { + if (full_path) + free(full_path); + list = NULL; + } return list; } ++++++ libvirt-service-dep.patch ++++++ Index: powerpc-utils-1.3.4/systemd/smt_off.service.in =================================================================== --- powerpc-utils-1.3.4.orig/systemd/smt_off.service.in +++ powerpc-utils-1.3.4/systemd/smt_off.service.in @@ -1,6 +1,6 @@ [Unit] Description=ppc64 set SMT off -Before=libvirt-bin.service +Before=libvirtd.service [Service] Type=oneshot ++++++ nvsetenv ++++++ #!/bin/sh if [ "$1" = "--version" ]; then echo This version of nvsetenv is just a wrapper to invoke nvram exit 0 fi if [ -z "$1" ]; then nvram --print-config elif [ -z "$2" ]; then nvram --print-config="$1" else nvram --update-config "$1"="$2" fi exit $? ++++++ ofpathname_powernv.patch ++++++ Index: powerpc-utils-1.3.7/scripts/ofpathname =================================================================== --- powerpc-utils-1.3.7.orig/scripts/ofpathname +++ powerpc-utils-1.3.7/scripts/ofpathname @@ -1632,7 +1632,7 @@ of2l_nvme() . $PSERIES_PLATFORM if [[ $platform = $PLATFORM_POWERNV ]]; then echo "$OFPATHNAME: is not supported on the $platform_name platform" 1>&2 - exit 1 + exit 0 fi if [[ "$#" -eq 0 ]]; then ++++++ powerpc-utils-lsprop.patch ++++++ Index: powerpc-utils-1.3.4/src/lsprop.c =================================================================== --- powerpc-utils-1.3.4.orig/src/lsprop.c +++ powerpc-utils-1.3.4/src/lsprop.c @@ -30,7 +30,7 @@ #endif int recurse; -int maxbytes = 128; +int maxbytes = 64 * 1024; int words_per_line = 0; unsigned char *buf; ++++++ systemd-dir.patch ++++++ Index: powerpc-utils-1.3.7/Makefile.am =================================================================== --- powerpc-utils-1.3.7.orig/Makefile.am +++ powerpc-utils-1.3.7/Makefile.am @@ -181,7 +181,7 @@ src_drmgr_lsslot_LDADD = -lrtas if WITH_SYSTEMD install-data-hook: systemd/smt_off.service - $(MKDIR_P) @prefix@${systemd_unit_dir} - $(INSTALL_SCRIPT) $< @prefix@${systemd_unit_dir}/ - sed -i -e 's,$${exec_prefix},@sbindir@,g' @prefix@${systemd_unit_dir}/smt_off.service + $(MKDIR_P) ${systemd_unit_dir} + $(INSTALL_SCRIPT) $< ${systemd_unit_dir}/ + sed -i -e 's,$${exec_prefix},@sbindir@,g' ${systemd_unit_dir}/smt_off.service endif