From e96140f3a06a561eb7bda17bf6579a4ca8603194 Mon Sep 17 00:00:00 2001 From: Roman Rakus Date: Jun 15 2010 13:15:03 +0000 Subject: Correct the parameter handling of ppc64_cpu when setting the run-mode --- diff --git a/powerpc-utils-run_mode.patch b/powerpc-utils-run_mode.patch new file mode 100644 index 0000000..3c3f97f --- /dev/null +++ b/powerpc-utils-run_mode.patch @@ -0,0 +1,42 @@ +This patch corrects the parameter handling of ppc64_cpu when setting the +run-mode. The PAPR specifies that the rtas_[get|set]_system_parameter calls +take a char buffer, but for the run mode it actually wants integer values in +the buffer, not strings. This updates the handling of the values to be +integers. + +This patch also add an additional error message to indicate failure when a +partition is not authorized to set the run mode. + +Signed-off-by:Nathan Fontenot +--- + +Index: powerpc-utils-1.2.2/src/ppc64_cpu.c +=================================================================== +--- powerpc-utils-1.2.2.orig/src/ppc64_cpu.c 2010-06-10 13:22:02.000000000 -0500 ++++ powerpc-utils-1.2.2/src/ppc64_cpu.c 2010-06-10 13:33:09.810455522 -0500 +@@ -416,11 +416,11 @@ + printf("Could not retrieve current diagnostics " + "mode\n"); + } else +- printf("run-mode=%c\n", mode[2]); ++ printf("run-mode=%d\n", mode[2]); + } else { +- signed char rmode = *run_mode; ++ short rmode = atoi(run_mode); + +- if (rmode < '0' || rmode > '3') { ++ if (rmode < 0 || rmode > 3) { + printf("Invalid run-mode=%c\n", rmode); + return -1; + } +@@ -433,6 +433,9 @@ + if (rc == -3) + printf("Machine does not support diagnostic " + "run mode\n"); ++ else if (rc == -9002) ++ printf("Machine is not authorized to set " ++ "diagnostic run mode\n"); + else + printf("Could not set diagnostics mode\n"); + } + diff --git a/powerpc-utils.spec b/powerpc-utils.spec index 6b5ef1d..2c8671c 100644 --- a/powerpc-utils.spec +++ b/powerpc-utils.spec @@ -1,6 +1,6 @@ Name: powerpc-utils Version: 1.2.2 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Utilities for PowerPC platforms Group: System Environment/Base @@ -45,6 +45,8 @@ Patch9: powerpc-utils-cpudscr.patch # 599719, Correct cpu dlpar capable check Patch10: powerpc-utils-cpu_dlpar_check.patch +# Corrects the parameter handling of ppc64_cpu when setting the run-mode +Patch11: powerpc-utils-run_mode.patch # This is done before release of F12 Obsoletes: powerpc-utils-papr < 1.1.6-3 @@ -70,7 +72,7 @@ Utilities for PowerPC platforms. %patch8 -p1 -b .threads %patch9 -p1 -b .cpudscr %patch10 -p1 -b .cpu_dlpar_check - +%patch11 -p1 -b .run_mode %build ./bootstrap.sh @@ -153,6 +155,9 @@ rm -rf $RPM_BUILD_ROOT %preun %changelog +* Tue Jun 15 2010 Roman Rakus - 1.2.2-11 +- Correct the parameter handling of ppc64_cpu when setting the run-mode + * Wed Jun 09 2010 Roman Rakus - 1.2.2-10 - Added some upstream patches - also bump release