Hello community, here is the log from the commit of package powerpc-utils for openSUSE:Factory checked in at 2015-07-28 11:42:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old) and /work/SRC/openSUSE:Factory/.powerpc-utils.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerpc-utils" Changes: -------- --- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes 2015-06-11 09:09:14.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.powerpc-utils.new/powerpc-utils.changes 2015-07-28 11:42:56.000000000 +0200 @@ -1,0 +2,14 @@ +Mon Jul 27 08:34:13 UTC 2015 - [email protected] + +- Don't require tgt. Linux as VIO server is not supported + +------------------------------------------------------------------- +Fri Jul 24 10:10:55 UTC 2015 - [email protected] + +- version update to 1.2.26 (FATE#318009) + - see Changelog under powerpc-utils-1.2.26/Changelog + +- removed patches: + * powerpc-utils.ofpathname.bootlist.patch + +------------------------------------------------------------------- Old: ---- powerpc-utils-1.2.24.tar.gz powerpc-utils.ofpathname.bootlist.patch New: ---- powerpc-utils-1.2.26.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerpc-utils.spec ++++++ --- /var/tmp/diff_new_pack.bYbnrj/_old 2015-07-28 11:42:57.000000000 +0200 +++ /var/tmp/diff_new_pack.bYbnrj/_new 2015-07-28 11:42:57.000000000 +0200 @@ -29,18 +29,18 @@ Recommends: powerpc-utils-python BuildRequires: librtas-devel BuildRequires: zlib-devel -Version: 1.2.24 +Version: 1.2.26 Release: 0 -Url: http://downloads.sourceforge.net/project/powerpc-utils +Url: http://sourceforge.net/projects/powerpc-utils Summary: Utilities for PowerPC Hardware License: CPL-1.0 Group: System/Management +PreReq: %insserv_prereq %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: http://downloads.sourceforge.net/project/powerpc-utils/powerpc-utils/%{name}-%{version}.tar.gz +Source0: powerpc-utils-%{version}.tar.gz Source1: nvsetenv Patch1: powerpc-utils-lsprop.patch -Patch2: powerpc-utils.ofpathname.bootlist.patch -Patch3: ofpathname_powernv.patch +Patch2: ofpathname_powernv.patch ExclusiveArch: ppc ppc64 ppc64le %description @@ -51,7 +51,6 @@ %setup -q %patch1 -p1 %patch2 -p1 -%patch3 -p1 %build %configure ++++++ ofpathname_powernv.patch ++++++ --- /var/tmp/diff_new_pack.bYbnrj/_old 2015-07-28 11:42:57.000000000 +0200 +++ /var/tmp/diff_new_pack.bYbnrj/_new 2015-07-28 11:42:57.000000000 +0200 @@ -1,10 +1,10 @@ -Index: powerpc-utils-1.2.24/scripts/ofpathname +Index: powerpc-utils-1.2.26/scripts/ofpathname =================================================================== ---- powerpc-utils-1.2.24.orig/scripts/ofpathname -+++ powerpc-utils-1.2.24/scripts/ofpathname +--- powerpc-utils-1.2.26.orig/scripts/ofpathname ++++ powerpc-utils-1.2.26/scripts/ofpathname @@ -1473,7 +1473,7 @@ of2l_fc() . $PSERIES_PLATFORM - if [[ $platform = $PLATFORM_POWERKVM_HOST ]]; then + if [[ $platform = $PLATFORM_POWERNV ]]; then echo "$OFPATHNAME: is not supported on the $platform_name platform" - exit 1 + exit 0 ++++++ powerpc-utils-1.2.24.tar.gz -> powerpc-utils-1.2.26.tar.gz ++++++ ++++ 1789 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/Changelog new/powerpc-utils-1.2.26/Changelog --- old/powerpc-utils-1.2.24/Changelog 2014-11-25 18:19:19.000000000 +0100 +++ new/powerpc-utils-1.2.26/Changelog 2015-06-23 16:53:36.000000000 +0200 @@ -1,3 +1,291 @@ +powerpc-utils-1.2.26 +===================================================================== +commit 7653d5814de2abb209c198a8b763c99139bf750d +Author: Dinar Valeev <[email protected]> +Date: Wed Jun 17 16:46:48 2015 -0400 + + PowerKVM is a distro, not a platform + + Name OPAL platform correctly.. Bare metal systems are not + PowerKVM (which is IBM distro), but PowerNV. + + Signed-off-by: Dinar Valeev <[email protected]> + Reviewed-by: Vasant Hegde <[email protected]> + +commit 09630ae59954de064f379f085e710ba34b999ae4 +Author: Nathan Fontenot <[email protected]> +Date: Wed Jun 3 08:21:09 2015 -0400 + + drmgr: Correct memory affinity when adding memory + + When adding a LMB we need to update the affinity as part of the add process. + The affinity for the LMB we are adding is conveyed in the + ibm,associativity property for the device tree node of the LMB we are adding + + To clarify, a little history. Previously LMB information in the device tree + was done as a node per LMB in the form memory@XXX, and all of the informatio + about the LMB as properties under this node. When we moved to using the + ibm,dynamic-reconfiguration-memory node to convey LMB information the + ibm,dynamic-memory property provides an index for each LMB into the + ibm,associativity-lookup-arrays property. This is where we determine the + affinity for each LMB. + + In order to update the affinity for a LMB we are adding we have to call + configure connector to get the memory@XXX node and its properties for the + LMB we are adding (yes, rtas did not change this part), find the + ibm,associativity property, then find the entry in the associativity + lookup array that matches it. We then update the ibm,dynamic-memory + property with the proper index into the associativity lookup array. + + Signed-off-by: Nathan Fontenot <[email protected]> + Tested-by: Bharata B Rao <[email protected]> + +commit f95a18deaaaa9c67ca1453e6f12784ecebf45e19 +Author: Michael Roth <[email protected]> +Date: Wed Jun 3 08:19:04 2015 -0400 + + drmgr: allow PHBs to be specified using numerical DRC index + + For each invocation involving '-c phb', if a numerical value is given + for -s do a lookup through PHB list to find the corresponding DRC + name. + + Signed-off-by: Michael Roth <[email protected]> + +commit 2f1227ca13f127005072d856e2f0686e41b83491 +Author: Michael Roth <[email protected]> +Date: Wed Jun 3 08:18:19 2015 -0400 + + drmgr: don't remove PHB's interrupt node unless PHB actually has one + + Currently we fail to release a PHB to firmware if we're unable to remove + the PHB's interrupt-controller node from the guest device tree. + + However, according to update_phb_ic_info(): + + "... there can be more ICs than PHBs on a system. In this case, some + ICs won't have my-drc-index." + + In such cases, we don't assign the 'interrupt-controller*' path to the + PHB's OF node, so simply skip the IC node removal (it either doesn't + exist, or is not not owned by this PHB) when this occurs and proceed + with releasing the PHB. + + Signed-off-by: Michael Roth <[email protected]> + +commit 58d6afbbd4b101b7fe8d7b6edb71d27b5ff50c9e +Author: Michael Roth <[email protected]> +Date: Wed Jun 3 08:17:32 2015 -0400 + + drmgr: improve PHB removal performance by avoiding hp_list rebuild + + Signed-off-by: Michael Roth <[email protected]> + +commit 7c115980147ab4916e25e796ee5ab002287ee3c7 +Author: Michael Roth <[email protected]> +Date: Wed Jun 3 08:14:19 2015 -0400 + + drmgr: allow 'empty' state when disabling hp slot/adapter + + Current code assumes that slots under a PHB are populated during PHB + removal. As a result, we attempt to unconfigure the slot/adapter by + powering it off, then checking for an 'unconfigured' state via + get_hp_adaptor_status/DR_ENTITY_SENSE. However, if the slot is empty + well get an 'emtpy' state instead. + + We can avoid this by simply not attempting to unconfigure/poweroff an + adapter if the slot is empty, but it's possible we rely on this in + some cases to safely power-off slots. Instead, simply allow + DR_ENTITY_SENSE to report 'empty' after power-off in addition to + 'unconfigured'. + + Signed-by-off: Michael Roth <[email protected]> + +commit d7e9a49466143514e8d0b392aadf51f8d377406d +Author: Nathan Fontenot <[email protected]> +Date: Wed Jun 3 08:12:03 2015 -0400 + + lsslot: Enhance memory output + + This patch adds additional information to the output produced + by the lsslot command for dynamic reconfiguration memory. The + default output with this patch will add the address, drc index, + and associativity for each LMB. + + Dynamic Reconfiguration Memory (LMB size 0x10000000) + LMB2: + DRC Index: 80000001 Address: 10000000 + Removable: Yes Associativity: (index: 1) 0 1 2 2 + Section(s): 1 + -- snip -- + + Additionally, this patch allows users to specify the -d 4 option + to lsslot for memory which will print information about all possible + LMBs, not just the LMBs owned by the system. + + This patch also adds the ability to print the information for a specific + LMB by specifyinf its drc index with the -s option. + + Dynamic Reconfiguration Memory (LMB size 0x10000000) + LMB191: + DRC Index: 800000be Address: be0000000 + Removable: No Associativity: (index: 1) 0 1 2 2 + Section(s): 190 + + Signed-off-by: Nathan Fontenot <[email protected]> + +commit 40b7c2847318b5f9d0ac91aa7bbc37b6e4638f6f +Author: Kamalesh Babulal <[email protected]> +Date: Wed Jun 3 08:08:02 2015 -0400 + + scripts/snap: Ignore deprecated /proc/ network files + + Teach snap to ignore deprecated sysctl network files, while + gathering information from /proc. Reading deprecated file, + throws warnings in /var/log/message like: + kernel: process `snap' is using deprecated sysctl (syscall) + net.ipv6.neigh.default.retrans_time; Use net.ipv6.neigh.default.retrans_time + + Signed-off-by: Kamalesh Babulal <[email protected]> + Cc: Vasant Hegde <[email protected]> + Cc: Nathan Fontenot <[email protected]> + Acked-by: Naveen N. Rao <[email protected]> + +commit 7bc6978561aa994f7336318ef693bf8debeaac91 +Author: Bharata B Rao <[email protected]> +Date: Mon May 11 11:23:05 2015 -0400 + + drmgr: Fix LMB lookup by index + + From: Bharata B Rao <[email protected]> + + If drc_index is used with -s option and the drc_index specified + doesn't correspond to the first available unused LMB, get_available_lmb() + ends up returning first available LMB that doesn't match the requested + drc_index. + + Fix this by explicitly checking for drc_index when drc_index is specified + with -s option. + + Signed-off-by: Bharata B Rao <[email protected]> + + +powerpc-utils-1.2.25 +===================================================================== +commit 948bbf83b43c9a3bc00f521326e096ca6c7848c5 +Author: Bharata B Rao <[email protected]> +Date: Mon Apr 13 11:20:00 2015 -0500 + + drmgr: Fix CPU/LMB add/removal using drc_index + + This patch fixes a few things: + + - Removing a CPU using drc_index is currently removing wrong CPU since + CPU removal code doesn't lookup CPU by index. Introduce a routine to + lookup by index and ensure that it gets used from the removal path. + - get_cpu_by_name() does an implicit looking up of index also. Fix this. + - drmgr -s option can mean both drc_index and drc_name. In case of + drc_index, rtas_errd will invoke drmgr without -q option which results + in no CPU or LMB being added. Make 1 as the default count of + CPUs unconditionally which applies to both the cases. + + After these fixes, I am able to get CPU hotplug and removal working + with QEMU on a PowerKVM host. + + Signed-off-by: Bharata B Rao <[email protected]> + +commit 7f1ba6f2cefbc72112ee809d2b5fd90e7525417d +Author: Mamatha Inamdar <[email protected]> +Date: Tue Mar 31 18:27:06 2015 -0400 + + drmgr: Fix to check for drmgr REPLACE (-R) flag + + In drmgr command drmgr -R (REPLACE) flag check was missing, so + this patch is to fix drmgr -R flag in valid_pci_options() interface. + + ************************************************* + Test results: + + before fixing the patch: + The '-r', '-a', or '-i' option must be spcified for PCI operation + + After fixing the patch: + + The specified PCI slot is either invalid + or does not support hot plug operations.xing the patch: + ************************************************************** + + Signed-off-by: Mamatha Inamdar <[email protected]> + +commit a941cdfb9609bba04c5bad18ab8af1c85b7b6a9b +Author: Tyrel Datwyler <[email protected]> +Date: Tue Mar 31 18:23:59 2015 -0400 + + drmgr: Use sysfs migration store to initiate migration when possible + + The sysfs attribute /sys/kernel/mobility/migration has been present for + sometime, but never actually used by drmgr. It can be used to initiate a + migration operation in place of the existing faux ibm,supsend-me rtas call. + Further, newer kernels are capable of doing the device tree update. + + We can test the /sys/kernel/mobility/api_version attribute to determine the + course of action drmgr should take. Newer kernels will return 1 indicating + the kernel is cabable of performing the migration and postmobility fixups. + If the attribute is unreadable or returns 0 drmgr should resort to initiatin + the migration via rtas, and communicate the post mobility device tree update + through the /proc/ppc64/ofdt interface to the kernel. + + Signed-off-by: Tyrel Datwyler <[email protected]> + +commit 62edbba0a29851db8089650e122facb95f40d317 +Author: Henish Patel <[email protected]> +Date: Wed Mar 11 21:34:32 2015 -0500 + + snap: Restrict the usage of snap on RHEL 7 onwards + + snap is not supported on the RHEL 7 onwards, because we have integrated snap + functionality in sosreport. So this patch displays a suitable message. + RHEL 7+ users can use sosreport to collect log data. + + Signed-off-by: Henish Patel <[email protected]> + +commit 63f9d99136c0630008cbb5fd241f46d6618e9b1b +Author: Nathan Fontenot <[email protected]> +Date: Fri Feb 13 10:15:44 2015 -0500 + + ppc64_cpu: Initial man page. + + Initial man page for the ppc64_cpu command. + + Signed-off-by: Nathan Fontenot <[email protected]> + +commit cb0c5c844b384b335cf50e92e20a080b5364e186 +Author: Paulo Flabiano Smorigo <[email protected]> +Date: Fri Feb 13 10:13:03 2015 -0500 + + Add systemd unit (smt_off) to control smt status. + + This patch add a --with-systemd attribute to install a systemd unit + to turn smt on or off (permanently or not). + + After it's installed you can use systemd commands like: status, start, + stop, enable and disable to control it. + + Signed-off-by: Paulo Flabiano Smorigo <[email protected]> + +commit acfa92352e3b2bddf256de23e7ef07ad3a47ec08 +Author: Thomas Falcon <[email protected]> +Date: Wed Jan 7 15:05:45 2015 -0500 + + drmgr/lsslot: Fix broken memory support for little endian + + Commit 493bfdda30b61be46d7d71e5e7bb05df9334ba81 should have removed + some endian conversions included in previous commit. Unfortunately, + they were not removed, causing problems when hotplugging memory. + This patch removes those endian conversions. + + Signed-off-by: Thomas Falcon <[email protected]> + powerpc-utils-1.2.24 ===================================================================== commit cccfb3c8d867e07a8f4b983858f04707e4131383 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/Makefile.am new/powerpc-utils-1.2.26/Makefile.am --- old/powerpc-utils-1.2.24/Makefile.am 2014-11-25 17:18:27.000000000 +0100 +++ new/powerpc-utils-1.2.26/Makefile.am 2015-05-20 23:26:29.000000000 +0200 @@ -40,7 +40,8 @@ man/sys_ident.8 \ man/lparcfg.5 \ man/lparstat.8 \ - man/lsslot.8 + man/lsslot.8 \ + man/ppc64_cpu.8 EXTRA_DIST += $(bin_SCRIPTS) $(sbin_SCRIPTS) $(man_MANS) @@ -49,6 +50,10 @@ doc/nvram.doxycfg doc/rtas_ibm_get_vpd.doxycfg doc/serv_config.doxycfg \ doc/set_poweron_time.doxycfg doc/uesensor.doxycfg +if WITH_SYSTEMD +EXTRA_DIST += systemd/smt_off.service.in +endif + sbin_PROGRAMS += src/nvram src/lsprop src/lparstat src/ppc64_cpu pseries_platform_SOURCES = src/common/pseries_platform.c src/common/pseries_platform.h @@ -145,3 +150,10 @@ $(pseries_platform_SOURCES) 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 +endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/configure.ac new/powerpc-utils-1.2.26/configure.ac --- old/powerpc-utils-1.2.24/configure.ac 2014-11-25 18:20:08.000000000 +0100 +++ new/powerpc-utils-1.2.26/configure.ac 2015-06-23 16:53:36.000000000 +0200 @@ -1,6 +1,6 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -m4_define([ppu_version], 1.2.24) +m4_define([ppu_version], 1.2.26) AC_PREREQ([2.63]) AC_INIT([powerpc-utils], ppu_version, [[email protected]]) @@ -58,6 +58,22 @@ AM_CONDITIONAL([WITH_LIBRTAS], [test "x$with_librtas" = "xyes"]) +# check for systemd +systemd_unit_dir=/usr/lib/systemd/system +AC_ARG_WITH([systemd], + [AC_HELP_STRING([--with-systemd@<:@=DIR@:>@], + [install systemd unit files (not default and unit dir is /usr/lib/systemd/system)])], + [if test "$withval" = "no"; then + with_systemd=0 + else + with_systemd=1 + test $withval != "yes" && systemd_unit_dir=$withval + fi], + with_systemd=0 + ) +AM_CONDITIONAL(WITH_SYSTEMD, [test "$with_systemd" = 1]) +AC_SUBST(systemd_unit_dir) + AC_DEFUN([LOCAL_CHECK_FLAGS],[ AC_REQUIRE([AX_CHECK_LINK_FLAG]) AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) @@ -72,5 +88,5 @@ ]) LOCAL_CHECK_FLAGS -AC_CONFIG_FILES([Makefile powerpc-utils.spec]) +AC_CONFIG_FILES([Makefile powerpc-utils.spec systemd/smt_off.service]) AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/man/lsslot.8 new/powerpc-utils-1.2.26/man/lsslot.8 --- old/powerpc-utils-1.2.24/man/lsslot.8 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/man/lsslot.8 2015-06-23 16:53:36.000000000 +0200 @@ -35,8 +35,9 @@ .B \-p Display caches, valid for "cpu" slots only. .TP -.B \-s <slot> -Display characteristics of the specified slot. +.B \-s [<slot> | <drc index>] +Display characteristics of the specified slot or the LMB with the specified +drc index. .TP .B \-F <delimiter> Specified a single character to delimit the output. The @@ -44,7 +45,8 @@ specified character. .TP .B \-d -Enable debugging output. +Enable debugging output. When displaying memory information this flag will +also enable printing information about LMBs not currently owned by the system. .TP .B \-w <timeout> Specify a timeout when attempting to acquire locks. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/man/ppc64_cpu.8 new/powerpc-utils-1.2.26/man/ppc64_cpu.8 --- old/powerpc-utils-1.2.24/man/ppc64_cpu.8 1970-01-01 01:00:00.000000000 +0100 +++ new/powerpc-utils-1.2.26/man/ppc64_cpu.8 2015-05-20 23:26:29.000000000 +0200 @@ -0,0 +1,108 @@ +.\" +.\" Copyright (C) 2015 International Business Machines +.\" +.TH PPC64_CPU 8 "January 2015" Linux "Linux on Power Service Tools" +.SH NAME +ppc64_cpu \- Display cpu characteristics of PowerPC systems +.SH SYNOPSIS +.B /usr/sbin/ppc64_cpu +[ command ] [ options ] +.SH DESCRIPTION +The +.I ppc64_cpu +command is used to display and set cpu characteristics on PowerPC +platforms. + +.SH OPTIONS +.TP +\fB\-\-smt\fR +Display the current smt setting for the system. The output will state +whether smt is off indicating there is only one thread per core online, smt +is on indicating that all threads of every core is online, the smt is in +a mixed state indicating that the number of threads online varies per core, or +'SMT=X' indicating a specific smt state. + +.TP +\fB\-\-smt\fR={\fIon\fR|\fIoff\fR} +Set the current smt state for the system to either \fIon\fR, which will online +every thread in every core on the system, or \fIoff\fR which will leave each +core on the system with only one thread online. + +.TP +\fB\-\-smt\fR=\fIvalue\fR +Set the smt state for each core to the specified \fIvalue\fR. + +.TP +\fB\-\-cores\-present\fR +Display the number of cores present. + +.TP +\fB\-\-cores\-on\fR +Display the number of cores online. + +.TP +\fB\-\-cores\-on\fR=\fIvalue\fR +Put exactly \fIvalue\fR number of cores online. Note that this will either +online or offline cores to achieve the desired result. + +.TP +\fB\-\-dscr\fR +Display the current Data Stream Control Register (DSCR) setting for the system. + +.TP +\fB\-\-dscr\fR=\fIvalue\fR +Set the DSCR setting for the system to \fIvalue\fr. + +.TP +\fB\-\-dscr\fR [\fIpid\fR] +Display the DSCR setting for process \fIpid\fR. + +.TP +\fB\-\-dscr\fR=\fIvalue\fR [\fIpid\fR] +Set the DSCR to the specified \fIvalue\fR for process \fIpid\fR. + +.TP +\fB\-\-smt\-snooze\-delay\fR +Display the current smt\-snooze\-delay setting. + +.TP +\fB\-\-smt\-snooze\-delay\fR=\fIvalue\fR +Set the smt\-snooze\-delay to the specified \fIvalue\fR. + +.TP +\fB\-\-run-mode\fR +Display the current diagnostics run mode. + +.TP +\fB\-\-run\-mode\fR=\fIvalue\fR +Set the current diagnostics run mode to \fIvalue\fR. + +.TP +\fB\-\-frequency\fR [\-t \fItime\fR] +Determine the cpu frequency. The default sampling period is one second unless +a time is specified with the \fB\-t \fItime\fR option. + +.TP +\fB\-\-subcores\-per\-core\fR +Display the number of subcores per core. + +.TP +\fB\-\-subcores\-per\-core\fR=\fIvalue\fR +Set the number of subcores per core to \fIvalue\fR. + +.TP +\fB\-\-threads\-per\-core\fR +Display the number of threads per core. + +.TP +\fB\-\-info\fR +Display system state information. The output will print a line for each core +and possible sub\-core along with the thread numbers for each thread in the +core with an asterick next to it if the thread is online. + +.TP +\fB\-\-version\fR +Print the version number. + +.SH AUTHOR +Written by Anton Blanchard and Nathan Fontenot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/powerpc-utils.spec.in new/powerpc-utils-1.2.26/powerpc-utils.spec.in --- old/powerpc-utils-1.2.24/powerpc-utils.spec.in 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/powerpc-utils.spec.in 2015-05-20 23:26:29.000000000 +0200 @@ -84,6 +84,7 @@ /usr/share/man/man5/lparcfg.5.gz /usr/share/man/man8/lparstat.8.gz /usr/share/man/man8/lsslot.8.gz +/usr/share/man/man8/ppc64_cpu.8.gz /usr/share/man/man1/amsstat.1.gz %post diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/scripts/ofpathname new/powerpc-utils-1.2.26/scripts/ofpathname --- old/powerpc-utils-1.2.24/scripts/ofpathname 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/scripts/ofpathname 2015-06-23 16:53:36.000000000 +0200 @@ -1471,7 +1471,7 @@ # Main # . $PSERIES_PLATFORM -if [[ $platform = $PLATFORM_POWERKVM_HOST ]]; then +if [[ $platform = $PLATFORM_POWERNV ]]; then echo "$OFPATHNAME: is not supported on the $platform_name platform" exit 1 fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/scripts/pseries_platform new/powerpc-utils-1.2.26/scripts/pseries_platform --- old/powerpc-utils-1.2.24/scripts/pseries_platform 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/scripts/pseries_platform 2015-06-23 16:53:36.000000000 +0200 @@ -3,7 +3,7 @@ SOURCE_FILE="pseries_platform" PLATFORM_FILE=/proc/cpuinfo export PLATFORM_UNKNOWN=0 -export PLATFORM_POWERKVM_HOST=1 +export PLATFORM_POWERNV=1 export PLATFORM_POWERKVM_GUEST=2 export PLATFORM_PSERIES_LPAR=3 @@ -11,10 +11,10 @@ export platform=$PLATFORM_UNKNOWN if grep -q "PowerNV" $PLATFORM_FILE; then - platform_name="PowerKVM Host" - platform=$PLATFORM_POWERKVM_HOST + platform_name="PowerNV Host" + platform=$PLATFORM_POWERNV elif grep -q "IBM pSeries (emulated by qemu)" $PLATFORM_FILE; then - platform_name="PowerKVM pSeries Guest" + platform_name="Power KVM pSeries Guest" platform=$PLATFORM_POWERKVM_GUEST elif grep -q "pSeries" $PLATFORM_FILE; then platform_name="PowerVM pSeries LPAR" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/scripts/rtas_dump new/powerpc-utils-1.2.26/scripts/rtas_dump --- old/powerpc-utils-1.2.24/scripts/rtas_dump 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/scripts/rtas_dump 2015-06-23 16:53:36.000000000 +0200 @@ -73,7 +73,7 @@ $perldumpenv"` =~ /^\s*\{(.*)\}\s*$/mxs; -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV'}) { print "rtas_dump: is not supported on the $ENV{'platform_name'} platform\n"; exit 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/scripts/snap new/powerpc-utils-1.2.26/scripts/snap --- old/powerpc-utils-1.2.24/scripts/snap 2014-11-25 16:37:58.000000000 +0100 +++ new/powerpc-utils-1.2.26/scripts/snap 2015-06-23 16:53:36.000000000 +0200 @@ -34,7 +34,19 @@ my $cmddir = "snap_commands"; # cmd output dir. my $cmdoutdir = "$outdir/$cmddir"; # in outdir dir. my $rsxx_exists = 0; # Does an IBM Flash Adapter exist? -my $distro_file = "/etc/issue" +my $distro_file = "/etc/issue"; +my $redhat_release_file = "/etc/redhat-release"; + +if (-e $redhat_release_file) { + open(RELEASE, "< $redhat_release_file") or die "open: $!\n"; + $_ = <RELEASE>; + my $redhat_version = (split / /, $_)[6]; + if ($redhat_version >= 7.0) { + print "snap is not supported on the RHEL 7 onwards..!\n"; + print "Please use sosreport to collect log data..!! \n"; + exit 1; + } +} our($opt_a, $opt_d, $opt_h, $opt_o, $opt_t, $opt_v); @@ -130,6 +142,12 @@ "rs_cardreport -d 'all'", ); +# Files, which are to be ignored as they are deprecated +my @snap_deprecated_files = ( + "retrans_time", + "base_reachable_time", +); + sub recurse_dir($); # function prototype sub error { @@ -246,6 +264,7 @@ recurse_dir "$dir/$file"; } else { + next if (grep { /$file/ } @snap_deprecated_files); copy "$dir/$file", $outdir."$dir/$file"; } } @@ -329,7 +348,7 @@ exit 1; } -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV_HOST'}) { print "snap: is not supported on the $ENV{'platform_name'} platform\n"; exit 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/scripts/update_flash new/powerpc-utils-1.2.26/scripts/update_flash --- old/powerpc-utils-1.2.24/scripts/update_flash 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/scripts/update_flash 2015-06-23 16:53:36.000000000 +0200 @@ -414,7 +414,7 @@ $PLATFORM_UNKNOWN | $PLATFORM_POWERKVM_GUEST) echo "update_flash: is not supported on the $platform_name platform" exit 1;; - $PLATFORM_POWERKVM_HOST) + $PLATFORM_POWERNV) if [ ! -r "$UPDATE_FLASH_NV" ]; then error $E_PERM "Couldn't find $UPDATE_FLASH_NV file." fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/common/pseries_platform.c new/powerpc-utils-1.2.26/src/common/pseries_platform.c --- old/powerpc-utils-1.2.24/src/common/pseries_platform.c 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/common/pseries_platform.c 2015-06-23 16:53:36.000000000 +0200 @@ -15,8 +15,8 @@ const char *power_platform_name[] = { "Unknown", - "PowerKVM Host", - "PowerKVM pSeries Guest", + "PowerNV", + "Power KVM pSeries Guest", "PowerVM pSeries LPAR", /* Add new platforms name here */ }; @@ -35,7 +35,7 @@ while (fgets(line, LENGTH, fp)) { if (strstr(line, "PowerNV")) { - rc = PLATFORM_POWERKVM_HOST; + rc = PLATFORM_POWERNV; break; } else if (strstr(line, "IBM pSeries (emulated by qemu)")) { rc = PLATFORM_POWERKVM_GUEST; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/common/pseries_platform.h new/powerpc-utils-1.2.26/src/common/pseries_platform.h --- old/powerpc-utils-1.2.24/src/common/pseries_platform.h 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/common/pseries_platform.h 2015-06-23 16:53:36.000000000 +0200 @@ -10,7 +10,7 @@ enum { PLATFORM_UNKNOWN = 0, - PLATFORM_POWERKVM_HOST, + PLATFORM_POWERNV, PLATFORM_POWERKVM_GUEST, PLATFORM_PSERIES_LPAR, /* Add new platforms here */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/common_pci.c new/powerpc-utils-1.2.26/src/drmgr/common_pci.c --- old/powerpc-utils-1.2.24/src/drmgr/common_pci.c 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/common_pci.c 2015-06-23 16:53:36.000000000 +0200 @@ -1433,6 +1433,28 @@ } /** + * release_hp_children_from_node + * + * @param parent_slot dr_node of slot to release children from + * @returns 0 on success, !0 otherwise + */ +int +release_hp_children_from_node(struct dr_node *slot) +{ + struct dr_node *child; + int rc; + + for (child = slot->children; child; child = child->next) { + rc = release_hp_resource(child); + if (rc) + return rc; + } + + return 0; +} + + +/** * release_hp_children * * @param parent_drc_name @@ -1441,7 +1463,7 @@ int release_hp_children(char *parent_drc_name) { - struct dr_node *hp_list, *slot, *child; + struct dr_node *hp_list, *slot; int rc; hp_list = get_hp_nodes(); @@ -1450,16 +1472,13 @@ break; if (slot == NULL) { - free_node(hp_list); - return -EINVAL; + rc = -EINVAL; + goto out; } - for (child = slot->children; child; child = child->next) { - rc = release_hp_resource(child); - if (rc) - return rc; - } + rc = release_hp_children_from_node(slot); +out: free_node(hp_list); return (rc < 0) ? rc : 0; } @@ -1492,9 +1511,12 @@ int disable_hp_children(char *drc_name) { if (get_hp_adapter_status(drc_name) != NOT_CONFIG) { + int status; + set_hp_adapter_status(PHP_UNCONFIG_ADAPTER, drc_name); + status = get_hp_adapter_status(drc_name); - if (get_hp_adapter_status(drc_name) != NOT_CONFIG) + if (status != NOT_CONFIG && status != EMPTY) return 1; } return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/drmgr.c new/powerpc-utils-1.2.26/src/drmgr/drmgr.c --- old/powerpc-utils-1.2.24/src/drmgr/drmgr.c 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/drmgr.c 2015-06-23 16:53:36.000000000 +0200 @@ -312,7 +312,7 @@ switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/drmig_chrp_pmig.c new/powerpc-utils-1.2.26/src/drmgr/drmig_chrp_pmig.c --- old/powerpc-utils-1.2.24/src/drmgr/drmig_chrp_pmig.c 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/drmig_chrp_pmig.c 2015-05-20 23:26:29.000000000 +0200 @@ -28,6 +28,13 @@ }; #define SYSFS_HIBERNATION_FILE "/sys/devices/system/power/hibernate" +#define SYSFS_MIGRATION_FILE "/sys/kernel/mobility/migration" +#define SYSFS_MIGRATION_API_FILE "/sys/kernel/mobility/api_version" + +/* drmgr must call ibm,suspend-me and is responsible for postmobility fixups */ +#define MIGRATION_API_V0 0 +/* drmgr must write to sysfs migration store and allow kernel to do postmobility fixups */ +#define MIGRATION_API_V1 1 static struct pmap_struct *plist; static int action = 0; @@ -559,11 +566,48 @@ int do_migration(uint64_t stream_val) { - int rc; + int rc, fd; + int api_level = 0; + char buf[64]; + + /* If the kernel can also do the device tree update we should let the kernel do all the work. + Check if sysfs migration api_version is readable and use api level to determine how to + perform migration and post-mobility updates. */ + rc = get_int_attribute(SYSFS_MIGRATION_API_FILE, NULL, &api_level, sizeof(&api_level)); + if (rc) + say(DEBUG,"get_int_attribute returned %d for path %s\n", rc, SYSFS_MIGRATION_API_FILE); + + if (api_level == MIGRATION_API_V0) { + say(DEBUG, "about to issue ibm,suspend-me(%llx)\n", stream_val); + rc = rtas_suspend_me(stream_val); + say(DEBUG, "ibm,suspend-me() returned %d\n", rc); + } else if (api_level == MIGRATION_API_V1) { + sprintf(buf, "0x%llx\n", stream_val); + + fd = open(SYSFS_MIGRATION_FILE, O_WRONLY); + if (fd == -1) { + say(ERROR, "Could not open \"%s\" to initiate migration, " + "%m\n", SYSFS_MIGRATION_FILE); + return -1; + } + + say(DEBUG, "Initiating migration via %s with %s\n", + SYSFS_MIGRATION_FILE, buf); + + rc = write(fd, buf, strlen(buf)); + if (rc < 0) { + say(DEBUG, "Write to migration file failed with rc: %d\n", rc); + rc = errno; + } else if (rc > 0) + rc = 0; + + close(fd); + say(DEBUG, "Kernel migration returned %d\n", rc); + } else { + say(ERROR, "Unknown kernel migration api version %d\n", api_level); + rc = -1; + } - say(DEBUG, "about to issue ibm,suspend-me(%llx)\n", stream_val); - rc = rtas_suspend_me(stream_val); - say(DEBUG, "ibm,suspend-me() returned %d\n", rc); return rc; } @@ -604,9 +648,9 @@ char *path; if (action == HIBERNATE) - path = "/sys/devices/system/power/hibernate"; + path = SYSFS_HIBERNATION_FILE; else - path = "/sys/kernel/mobility/migrate"; + path = SYSFS_MIGRATION_API_FILE; /* kernel will return 0 or sysfs attribute will be unreadable if drmgr needs to perform a device tree update */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/drpci.h new/powerpc-utils-1.2.26/src/drmgr/drpci.h --- old/powerpc-utils-1.2.24/src/drmgr/drpci.h 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/drpci.h 2015-06-23 16:53:36.000000000 +0200 @@ -65,6 +65,7 @@ int set_hp_adapter_status(uint, char *); int pci_rescan_bus(); int pci_remove_device(struct dr_node *); +int release_hp_children_from_node(struct dr_node *); int release_hp_children(char *); int dlpar_remove_slot(const char *); int dlpar_add_slot(const char *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/drslot_chrp_cpu.c new/powerpc-utils-1.2.26/src/drmgr/drslot_chrp_cpu.c --- old/powerpc-utils-1.2.24/src/drmgr/drslot_chrp_cpu.c 2014-11-25 17:33:24.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/drslot_chrp_cpu.c 2015-05-20 23:26:29.000000000 +0200 @@ -44,16 +44,25 @@ get_cpu_by_name(struct dr_info *drinfo, const char *name) { struct dr_node *cpu; - uint32_t drc_index; for (cpu = drinfo->all_cpus; cpu; cpu = cpu->next) { - if (strcmp(cpu->drc_name, name) == 0) + if (strcmp(cpu->drc_name, name) == 0) { break; + } + } + + return cpu; +} + +static struct dr_node * +get_cpu_by_index(struct dr_info *drinfo, uint32_t index) +{ + struct dr_node *cpu; - /* See if the drc index was specified */ - drc_index = strtoul(name, NULL, 0); - if (cpu->drc_index == drc_index) + for (cpu = drinfo->all_cpus; cpu; cpu = cpu->next) { + if (cpu->drc_index == index) { break; + } } return cpu; @@ -105,6 +114,13 @@ opts->usr_drc_name); return cpu; + } else if (opts->usr_drc_index) { + cpu = get_cpu_by_index(dr_info, opts->usr_drc_index); + if (!cpu) + say(ERROR, "Could not locate cpu %x\n", + opts->usr_drc_index); + + return cpu; } switch (opts->action) { @@ -261,6 +277,7 @@ smt_threads_func(struct options *opts, struct dr_info *dr_info) { int rc; + struct dr_node *cpu; if (opts->quantity != 1) { say(ERROR, "Quantity option '-q' may not be specified with " @@ -274,8 +291,6 @@ } if (opts->usr_drc_name) { - struct dr_node *cpu; - cpu = get_cpu_by_name(dr_info, opts->usr_drc_name); if (cpu == NULL) { say(ERROR, "Could not find cpu %s\n", @@ -288,6 +303,19 @@ else if (opts->action == REMOVE) rc = cpu_disable_smt(cpu); + } else if (opts->usr_drc_index) { + cpu = get_cpu_by_index(dr_info, opts->usr_drc_index); + if (cpu == NULL) { + say(ERROR, "Could not find cpu %x\n", + opts->usr_drc_index); + return -1; + } + + if (opts->action == ADD) + rc = cpu_enable_smt(cpu, dr_info); + else if (opts->action == REMOVE) + rc = cpu_disable_smt(cpu); + } else { /* no drc name given, action is system-wide */ if (opts->action == ADD) rc = system_enable_smt(dr_info); @@ -302,7 +330,7 @@ valid_cpu_options(struct options *opts) { /* default to a quantity of 1 */ - if ((opts->quantity == 0) && (opts->usr_drc_name == NULL)) + if ((opts->quantity == 0)) opts->quantity = 1; if ((opts->action != ADD) && (opts->action != REMOVE)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/drslot_chrp_mem.c new/powerpc-utils-1.2.26/src/drmgr/drslot_chrp_mem.c --- old/powerpc-utils-1.2.24/src/drmgr/drslot_chrp_mem.c 2014-11-25 17:33:24.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/drslot_chrp_mem.c 2015-06-23 16:53:36.000000000 +0200 @@ -298,11 +298,6 @@ for (i = 0; i < num_entries; i++) { struct dr_node *lmb; - /* convert for LE systems */ - drmem->address = be64toh(drmem->address); - drmem->drc_index = be32toh(drmem->drc_index); - drmem->flags = be32toh(drmem->flags); - for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { if (lmb->drc_index == be32toh(drmem->drc_index)) break; @@ -318,6 +313,7 @@ sprintf(lmb->ofdt_path, DYNAMIC_RECONFIG_MEM); lmb->lmb_size = lmb_sz; lmb->lmb_address = be64toh(drmem->address); + lmb->lmb_aa_index = be32toh(drmem->assoc_index); if (be32toh(drmem->flags) & DRMEM_ASSIGNED) { found++; @@ -507,6 +503,9 @@ if ((strcmp(lmb->drc_name, opts->usr_drc_name)) && (lmb->drc_index != drc_index)) continue; + } else if (opts->usr_drc_index) { + if (lmb->drc_index != opts->usr_drc_index) + continue; } if (lmb->unusable) @@ -545,6 +544,56 @@ return usable_lmb; } +static void update_drconf_affinity(struct dr_node *lmb, + struct drconf_mem *drmem) +{ + struct of_node *node; + struct of_property *prop; + uint32_t assoc_prop_sz; + uint32_t *assoc_prop; + uint32_t assoc_entries; + uint32_t assoc_entry_sz; + uint32_t *prop_val; + int i; + + /* find the ibm,associativity property */ + node = lmb->lmb_of_node; + for (prop = node->properties; prop; prop = prop->next) { + if (!strcmp(prop->name, "ibm,associativity")) + break; + } + + if (!prop) + return; + + /* find the associtivity index atrrays */ + assoc_prop_sz = get_property_size(DYNAMIC_RECONFIG_MEM, + "ibm,associativity-lookup-arrays"); + assoc_prop = zalloc(assoc_prop_sz); + if (!assoc_prop) + return; + + get_property(DYNAMIC_RECONFIG_MEM, "ibm,associativity-lookup-arrays", + assoc_prop, assoc_prop_sz); + + assoc_entries = be32toh(assoc_prop[0]); + assoc_entry_sz = be32toh(assoc_prop[1]); + + prop_val = (uint32_t *)prop->value; + for (i = 0; i < assoc_entries; i++) { + if (memcmp(&assoc_prop[(i * assoc_entry_sz) + 2], &prop_val[1], + assoc_entry_sz * sizeof(uint32_t))) + continue; + + /* found it */ + drmem->assoc_index = htobe32(i); + break; + } + + free(assoc_prop); + return; +} + /** * update_drconf_node * @brief update the ibm,dynamic-memory property for added/removed memory @@ -576,19 +625,17 @@ for (i = 0; i < entries; i++) { - /* convert for LE systems */ - drmem->drc_index = be32toh(drmem->drc_index); - drmem->flags = be32toh(drmem->flags); - - if (drmem->drc_index != lmb->drc_index) { + if (be32toh(drmem->drc_index) != lmb->drc_index) { drmem++; continue; } - if (action == ADD) + if (action == ADD) { drmem->flags |= be32toh(DRMEM_ASSIGNED); - else + update_drconf_affinity(lmb, drmem); + } else { drmem->flags &= be32toh(~DRMEM_ASSIGNED); + } break; } @@ -665,6 +712,12 @@ { int rc; + lmb->lmb_of_node = configure_connector(lmb->drc_index); + if (lmb->lmb_of_node == NULL) { + release_drc(lmb->drc_index, MEM_DEV); + return -1; + } + if (lmb_list->drconf_buf) { errno = 0; rc = update_drconf_node(lmb, lmb_list, ADD); @@ -677,11 +730,6 @@ */ say(DEBUG, "Assuming older kernel, trying to add " "node\n"); - lmb->lmb_of_node = configure_connector(lmb->drc_index); - if (lmb->lmb_of_node == NULL) { - release_drc(lmb->drc_index, MEM_DEV); - return -1; - } sprintf(lmb->ofdt_path, "%s/%s", OFDT_BASE, lmb->lmb_of_node->name); @@ -692,11 +740,6 @@ } } else { /* Add the new nodes to the device tree */ - lmb->lmb_of_node = configure_connector(lmb->drc_index); - if (lmb->lmb_of_node == NULL) { - release_drc(lmb->drc_index, MEM_DEV); - return -1; - } sprintf(lmb->ofdt_path, "%s/%s", OFDT_BASE, lmb->lmb_of_node->name); rc = add_device_tree_nodes(OFDT_BASE, lmb->lmb_of_node); @@ -1211,7 +1254,7 @@ valid_mem_options(struct options *opts) { /* default to a quantity of 1 */ - if ((opts->quantity == 0) && (opts->usr_drc_name == NULL)) + if (opts->quantity == 0) opts->quantity = 1; if ((opts->action != ADD) && (opts->action != REMOVE)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/drslot_chrp_pci.c new/powerpc-utils-1.2.26/src/drmgr/drslot_chrp_pci.c --- old/powerpc-utils-1.2.24/src/drmgr/drslot_chrp_pci.c 2014-11-25 17:33:24.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/drslot_chrp_pci.c 2015-05-20 23:26:29.000000000 +0200 @@ -855,8 +855,8 @@ } if ((opts->action != ADD) && (opts->action != REMOVE) - && (opts->action != IDENTIFY)) { - say(ERROR, "The '-r', '-a', or '-i' option must be spcified " + && (opts->action != IDENTIFY) && (opts->action != REPLACE)) { + say(ERROR, "The '-r', '-a', '-R' or '-i' option must be spcified " "for PCI operations\n"); return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/drslot_chrp_phb.c new/powerpc-utils-1.2.26/src/drmgr/drslot_chrp_phb.c --- old/powerpc-utils-1.2.24/src/drmgr/drslot_chrp_phb.c 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/drslot_chrp_phb.c 2015-06-23 16:53:36.000000000 +0200 @@ -75,9 +75,11 @@ if (rc) return rc; - rc = remove_device_tree_nodes(phb->phb_ic_ofdt_path); - if (rc) - return rc; + if (phb->phb_ic_ofdt_path[0] != '\0') { + rc = remove_device_tree_nodes(phb->phb_ic_ofdt_path); + if (rc) + return rc; + } rc = release_drc(phb->drc_index, PHB_DEV); @@ -247,6 +249,7 @@ { struct dr_node *phb; struct dr_node *child; + struct dr_node *hp_list; int rc = 0; phb = get_node_by_name(opts->usr_drc_name, PHB_NODES); @@ -262,14 +265,24 @@ } /* Now, disable any hotplug children */ + hp_list = get_hp_nodes(); + for (child = phb->children; child; child = child->next) { + struct dr_node *slot; + if (child->dev_type == PCI_HP_DEV) { rc = disable_hp_children(child->drc_name); if (rc) say(ERROR, "failed to disable hotplug children\n"); - rc = release_hp_children(child->drc_name); + /* find dr_node corresponding to child slot's drc_name */ + for (slot = hp_list; slot; slot = slot->next) + if (!strcmp(child->drc_name, slot->drc_name)) + break; + + /* release any hp children from the slot */ + rc = release_hp_children_from_node(slot); if (rc && rc != -EINVAL) { say(ERROR, "failed to release hotplug children\n"); @@ -443,8 +456,14 @@ int valid_phb_options(struct options *opts) { - if (opts->usr_drc_name == NULL) { - say(ERROR, "A drc name must be specified\n"); + /* The -s option can specify a drc name or drc index */ + if (opts->usr_drc_name && !strncmp(opts->usr_drc_name, "0x", 2)) { + opts->usr_drc_index = strtoul(opts->usr_drc_name, NULL, 16); + opts->usr_drc_name = NULL; + } + + if (opts->usr_drc_name == NULL && !opts->usr_drc_index) { + say(ERROR, "A drc name or index must be specified\n"); return -1; } @@ -469,6 +488,18 @@ return rc; } + if (!opts->usr_drc_name) { + struct dr_connector *drc_list = get_drc_info(OFDT_BASE); + opts->usr_drc_name = drc_index_to_name(opts->usr_drc_index, + drc_list); + if (!opts->usr_drc_name) { + say(ERROR, + "Could not locate DRC name for DRC index: 0x%x", + opts->usr_drc_index); + return -1; + } + } + switch(opts->action) { case ADD: rc = add_phb(opts); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/lsslot.c new/powerpc-utils-1.2.26/src/drmgr/lsslot.c --- old/powerpc-utils-1.2.24/src/drmgr/lsslot.c 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/lsslot.c 2015-06-23 16:53:36.000000000 +0200 @@ -64,16 +64,20 @@ "\"pci\" slots only.\n"); fprintf(stderr, " -p Display caches, valid for \"cpu\" " "slots only.\n"); - fprintf(stderr, " -s <slot>\n"); + fprintf(stderr, " -s [<slot> | <drc index>]\n"); fprintf(stderr, " Display characteristics of the " - "specified slot.\n"); + "specified slot or the LMB\n"); + fprintf(stderr, " associated with drc index.\n"); fprintf(stderr, " -F <delimiter>\n"); fprintf(stderr, " Specified a single character to " "delimit the output. The \n"); fprintf(stderr, " heading is not displayed and the " "columns are delimited by the\n"); fprintf(stderr, " specified character.\n"); - fprintf(stderr, " -d Enable debugging output.\n"); + fprintf(stderr, " -d Enable debugging output. When " + "displaying LMB information\n"); + fprintf(stderr, " this will enable printing of LMBs " + "not owned by the system.\n"); fprintf(stderr, " -w <timeout>\n"); fprintf(stderr, " Specify a timeout when attempting to " "acquire locks.\n"); @@ -699,8 +703,88 @@ return 0; } +int print_drconf_mem(struct cmd_opts *opts, struct lmb_list_head *lmb_list) +{ + struct dr_node *lmb; + struct mem_scn *scn; + int scn_offset = strlen("/sys/devices/system/memory/memory"); + char *aa_buf; + __be32 *aa; + int aa_size, aa_list_sz; + int i, rc; + uint32_t drc_index = 0; + + aa_size = get_property_size(DYNAMIC_RECONFIG_MEM, + "ibm,associativity-lookup-arrays"); + aa_buf = zalloc(aa_size); + rc = get_property(DYNAMIC_RECONFIG_MEM, + "ibm,associativity-lookup-arrays", aa_buf, aa_size); + if (rc) { + say(ERROR, "Could not get associativity information.\n"); + return -1; + } + + aa = (__be32 *)aa_buf; + /* skip past the number of associativity lists */ + aa++; + aa_list_sz = be32toh(*aa++); + + if (opts->s_name) + drc_index = strtol(opts->s_name, NULL, 0); + + printf("Dynamic Reconfiguration Memory (LMB size 0x%x)\n", + lmb_list->lmbs->lmb_size); + + for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { + int first = 1; + int aa_start, aa_end; + + if (drc_index && drc_index != lmb->drc_index) + continue; + else if ((output_level < 4) && !lmb->is_owned) + continue; + + printf("%s: %s\n", lmb->drc_name, + lmb->is_owned ? "" : "Not Owned"); + + printf(" DRC Index: %x Address: %lx\n", + lmb->drc_index, lmb->lmb_address); + printf(" Removable: %s Associativity: ", + lmb->is_removable ? "Yes" : "No "); + + if (lmb->lmb_aa_index == 0xffffffff) { + printf("Not Set\n"); + } else { + printf("(index: %d) ", lmb->lmb_aa_index); + aa_start = lmb->lmb_aa_index * aa_list_sz; + aa_end = aa_start + aa_list_sz; + for (i = aa_start; i < aa_end; i++) + printf("%d ", be32toh(aa[i])); + printf("\n"); + } + + if (lmb->is_owned) { + printf(" Section(s):"); + for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { + if (first) { + printf(" %s", + &scn->sysfs_path[scn_offset]); + first = 0; + } else + printf(", %s", + &scn->sysfs_path[scn_offset]); + } + + printf("\n"); + } + } + + free(aa_buf); + return 0; +} + int -lsslot_chrp_mem(void) +lsslot_chrp_mem(struct cmd_opts *opts) { struct lmb_list_head *lmb_list; struct dr_node *lmb; @@ -712,40 +796,40 @@ if (lmb_list == NULL || lmb_list->lmbs == NULL) return -1; - printf("lmb size: 0x%x\n", lmb_list->lmbs->lmb_size); if (lmb_list->drconf_buf) { - printf("ibm,dynamic-reconfiguration-memory\n"); - printf("%-5s %c %s\n", "Name", 'R', "Sections"); - printf("%-5s %c %s\n", "----", '-', "--------"); + print_drconf_mem(opts, lmb_list); } else { + printf("lmb size: 0x%x\n", lmb_list->lmbs->lmb_size); printf("%-20s %-5s %c %s\n", "Memory Node", "Name", 'R', "Sections"); printf("%-20s %-5s %c %s\n", "-----------", "----", '-', "--------"); - } - for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { - int first = 1; + for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { + int first = 1; - if (!lmb->is_owned) - continue; + if (!lmb->is_owned) + continue; - if (!lmb_list->drconf_buf) - printf("%-20s ", &lmb->ofdt_path[lmb_offset]); + if (!lmb_list->drconf_buf) + printf("%-20s ", &lmb->ofdt_path[lmb_offset]); - printf("%-5s %c ", lmb->drc_name, - lmb->is_removable ? 'Y' : 'N'); + printf("%-5s %c ", lmb->drc_name, + lmb->is_removable ? 'Y' : 'N'); - for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { - if (first) { - printf(" %s", &scn->sysfs_path[scn_offset]); - first = 0; - } else - printf(", %s", &scn->sysfs_path[scn_offset]); - } + for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { + if (first) { + printf(" %s", + &scn->sysfs_path[scn_offset]); + first = 0; + } else + printf(", %s", + &scn->sysfs_path[scn_offset]); + } - printf("\n"); + printf("\n"); + } } free_lmbs(lmb_list); @@ -850,7 +934,7 @@ switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); @@ -888,7 +972,7 @@ break; case MEM: - rc = lsslot_chrp_mem(); + rc = lsslot_chrp_mem(&opts); break; case PORT: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/drmgr/ofdt.h new/powerpc-utils-1.2.26/src/drmgr/ofdt.h --- old/powerpc-utils-1.2.24/src/drmgr/ofdt.h 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/drmgr/ofdt.h 2015-06-23 16:53:36.000000000 +0200 @@ -77,12 +77,14 @@ struct mem_info { uint64_t _address; uint32_t _lmb_size; + uint32_t _lmb_aa_index; struct mem_scn *_mem_scns; struct of_node *_of_node; } _smem; #define lmb_address _node_u._smem._address #define lmb_size _node_u._smem._lmb_size +#define lmb_aa_index _node_u._smem._lmb_aa_index #define lmb_mem_scns _node_u._smem._mem_scns #define lmb_of_node _node_u._smem._of_node diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/rtas_event_decode.c new/powerpc-utils-1.2.26/src/rtas_event_decode.c --- old/powerpc-utils-1.2.24/src/rtas_event_decode.c 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/rtas_event_decode.c 2015-06-23 16:53:36.000000000 +0200 @@ -132,7 +132,7 @@ switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/src/set_poweron_time.c new/powerpc-utils-1.2.26/src/set_poweron_time.c --- old/powerpc-utils-1.2.24/src/set_poweron_time.c 2014-11-25 16:27:21.000000000 +0100 +++ new/powerpc-utils-1.2.26/src/set_poweron_time.c 2015-06-23 16:53:36.000000000 +0200 @@ -221,7 +221,7 @@ switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); return 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.24/systemd/smt_off.service.in new/powerpc-utils-1.2.26/systemd/smt_off.service.in --- old/powerpc-utils-1.2.24/systemd/smt_off.service.in 1970-01-01 01:00:00.000000000 +0100 +++ new/powerpc-utils-1.2.26/systemd/smt_off.service.in 2015-05-20 23:26:29.000000000 +0200 @@ -0,0 +1,12 @@ +[Unit] +Description=ppc64 set SMT off +Before=libvirt-bin.service + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=@sbindir@/ppc64_cpu --smt=off +ExecStop=@sbindir@/ppc64_cpu --smt=on + +[Install] +WantedBy=multi-user.target ++++++ powerpc-utils-lsprop.patch ++++++ --- /var/tmp/diff_new_pack.bYbnrj/_old 2015-07-28 11:42:57.000000000 +0200 +++ /var/tmp/diff_new_pack.bYbnrj/_new 2015-07-28 11:42:57.000000000 +0200 @@ -1,7 +1,7 @@ -Index: powerpc-utils-1.2.19/src/lsprop.c +Index: powerpc-utils-1.2.26/src/lsprop.c =================================================================== ---- powerpc-utils-1.2.19.orig/src/lsprop.c -+++ powerpc-utils-1.2.19/src/lsprop.c +--- powerpc-utils-1.2.26.orig/src/lsprop.c ++++ powerpc-utils-1.2.26/src/lsprop.c @@ -16,7 +16,7 @@ #include <endian.h>
