From 95a2148f7812fc2326255418aa77cb797762f3ed Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 21 Mar 2025 12:38:08 +0100 Subject: [PATCH] - Resolves: RHEL-80729, drmgr: return correct value - Resolves: RHEL-80277, lparstat: print memory mode correctly --- ...ils-fix-return-value-from-do_replace.patch | 31 ++++++++++++ ...lparstat-print-memory-mode-correctly.patch | 47 +++++++++++++++++++ powerpc-utils.spec | 10 +++- 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 powerpc-utils-fix-return-value-from-do_replace.patch create mode 100644 powerpc-utils-lparstat-print-memory-mode-correctly.patch diff --git a/powerpc-utils-fix-return-value-from-do_replace.patch b/powerpc-utils-fix-return-value-from-do_replace.patch new file mode 100644 index 0000000..6703333 --- /dev/null +++ b/powerpc-utils-fix-return-value-from-do_replace.patch @@ -0,0 +1,31 @@ +commit 3a8127ad7fe6615a8c6e8a3f0965addfdf888b38 +Author: Haren Myneni +Date: Fri Feb 14 21:43:33 2025 -0800 + + drmgr/pci: Return 0 for success from do_replace() + + Added replace_add_work() in commit f40a63b15c563 to support + replacement node and the partner node. But this function returns + 0 for user input and 1 for success which caused do_replace() + returns 1. This patch fixes the problem with return 0. + + Fixes: f40a63b15c563 ("drmgr/pci: Add multipath partner device support for hotplug replace") + Signed-off-by: Haren Myneni + Signed-off-by: Tyrel Datwyler + +diff --git a/src/drmgr/drslot_chrp_pci.c b/src/drmgr/drslot_chrp_pci.c +index 4c41fcd..91c08e9 100644 +--- a/src/drmgr/drslot_chrp_pci.c ++++ b/src/drmgr/drslot_chrp_pci.c +@@ -1051,9 +1051,10 @@ static int do_replace(struct dr_node *all_nodes) + } + + usr_prompt = prompt_save; ++ return rc; + } + +- return rc; ++ return 0; + } + + int valid_pci_options(void) diff --git a/powerpc-utils-lparstat-print-memory-mode-correctly.patch b/powerpc-utils-lparstat-print-memory-mode-correctly.patch new file mode 100644 index 0000000..28b2f7a --- /dev/null +++ b/powerpc-utils-lparstat-print-memory-mode-correctly.patch @@ -0,0 +1,47 @@ +commit 4443a68d523043d69195e5a5a27fb9fc7ae8c50f +Author: Shrikanth Hegde +Date: Mon Mar 10 22:29:16 2025 +0530 + + lparstat: print memory mode correctly (revised) + + Starting from power10, active memory sharing(AMS) is not supported. + So from power10 onwards the H_GET_MPP hcall fails and hence + corresponding fields in lparcfg are not populated, such as + entitled_memory_pool_number etc. + + Use HWCAP mechanism and print memory model as dedicated for power10 + onwards. + + Suggested-by: Peter Bergner + Signed-off-by: Shrikanth Hegde + Signed-off-by: Tyrel Datwyler + +diff --git a/src/lparstat.c b/src/lparstat.c +index db22316..8eddd7c 100644 +--- a/src/lparstat.c ++++ b/src/lparstat.c +@@ -37,6 +37,11 @@ + #include "pseries_platform.h" + #include "cpu_info_helpers.h" + #include ++#include ++ ++#ifndef PPC_FEATURE2_ARCH_3_1 ++#define PPC_FEATURE2_ARCH_3_1 0x00040000 ++#endif + + #define LPARCFG_FILE "/proc/ppc64/lparcfg" + #define SE_NOT_FOUND "???" +@@ -794,7 +799,11 @@ void get_memory_mode(struct sysentry *se, char *buf) + struct sysentry *tmp; + + tmp = get_sysentry("entitled_memory_pool_number"); +- if (atoi(tmp->value) == 65535) ++ /* ++ * from power10 onwards Active Memory Sharing(AMS) is not ++ * supported. Hence always display it as dedicated for those ++ */ ++ if (atoi(tmp->value) == 65535 || (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_3_1)) + sprintf(buf, "Dedicated"); + else + sprintf(buf, "Shared"); diff --git a/powerpc-utils.spec b/powerpc-utils.spec index f46d8c9..fccee54 100644 --- a/powerpc-utils.spec +++ b/powerpc-utils.spec @@ -1,6 +1,6 @@ Name: powerpc-utils Version: 1.3.13 -Release: 1%{?dist} +Release: 2%{?dist} Summary: PERL-based scripts for maintaining and servicing PowerPC systems License: GPLv2 @@ -10,7 +10,9 @@ Source1: nx-gzip.udev Patch0: powerpc-utils-1.3.10-manpages.patch # upstream patches - +Patch10: powerpc-utils-fix-return-value-from-do_replace.patch +Patch11: powerpc-utils-lparstat-print-memory-mode-correctly.patch + ExclusiveArch: ppc %{power64} BuildRequires: gcc @@ -211,6 +213,10 @@ systemctl enable hcn-init.service >/dev/null 2>&1 || : %changelog +* Tue Mar 11 2025 Than Ngo - 1.3.13-2 +- Resolves: RHEL-80729, drmgr: return correct value +- Resolves: RHEL-80277, lparstat: print memory mode correctly + * Tue Dec 03 2024 Than Ngo - 1.3.13-1 - Resolves: RHEL-30880, multipath - drmgr support - Resolces: RHEL-61089, lparstat -E Fails to Display Correct Values for %Busy and %Idle States