From 5420dbe2275c0c82dbe7509e77134c50893c1913d71891bac53b26ac4245096a Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Fri, 21 Apr 2023 08:21:27 +0000 Subject: [PATCH] Accepting request 1081117 from home:michael-chang:branches:Base:System - Fix PowerVS deployment fails to boot with 90 cores (bsc#1208581) * 0001-kern-ieee1275-init-Convert-plain-numbers-to-constant.patch * 0002-kern-ieee1275-init-Extended-support-in-Vec5.patch OBS-URL: https://build.opensuse.org/request/show/1081117 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=451 --- ...it-Convert-plain-numbers-to-constant.patch | 50 +++++++ ...ee1275-init-Extended-support-in-Vec5.patch | 129 ++++++++++++++++++ grub2.changes | 7 + grub2.spec | 2 + 4 files changed, 188 insertions(+) create mode 100644 0001-kern-ieee1275-init-Convert-plain-numbers-to-constant.patch create mode 100644 0002-kern-ieee1275-init-Extended-support-in-Vec5.patch diff --git a/0001-kern-ieee1275-init-Convert-plain-numbers-to-constant.patch b/0001-kern-ieee1275-init-Convert-plain-numbers-to-constant.patch new file mode 100644 index 0000000..0851176 --- /dev/null +++ b/0001-kern-ieee1275-init-Convert-plain-numbers-to-constant.patch @@ -0,0 +1,50 @@ +From 10f3a89078f9a6da7104e0978e385362e16af971 Mon Sep 17 00:00:00 2001 +From: Avnish Chouhan +Date: Mon, 27 Mar 2023 12:25:39 +0530 +Subject: [PATCH 1/2] kern/ieee1275/init: Convert plain numbers to constants in + Vec5 + +This patch converts the plain numbers used in Vec5 properties to constants. + +1. LPAR: Client program supports logical partitioning and + associated hcall()s. +2. SPLPAR: Client program supports the Shared + Processor LPAR Option. +3. CMO: Enables the Cooperative Memory Over-commitment Option. +4. MAX_CPU: Defines maximum number of CPUs supported. + +Signed-off-by: Avnish Chouhan +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/init.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index e1dbff86a..eaa25d0db 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -61,6 +61,12 @@ extern char _end[]; + grub_addr_t grub_ieee1275_original_stack; + #endif + ++#define LPAR 0x80 ++#define SPLPAR 0x40 ++#define BYTE2 (LPAR | SPLPAR) ++#define CMO 0x80 ++#define MAX_CPU 256 ++ + void + grub_exit (void) + { +@@ -378,7 +384,7 @@ grub_ieee1275_ibm_cas (void) + .vec4 = 0x0001, /* set required minimum capacity % to the lowest value */ + .vec5_size = 1 + sizeof (struct option_vector5) - 2, + .vec5 = { +- 0, 192, 0, 128, 0, 0, 0, 0, 256 ++ 0, BYTE2, 0, CMO, 0, 0, 0, 0, MAX_CPU + } + }; + +-- +2.39.2 + diff --git a/0002-kern-ieee1275-init-Extended-support-in-Vec5.patch b/0002-kern-ieee1275-init-Extended-support-in-Vec5.patch new file mode 100644 index 0000000..daad074 --- /dev/null +++ b/0002-kern-ieee1275-init-Extended-support-in-Vec5.patch @@ -0,0 +1,129 @@ +From 6c9a76053006f7532d9fb3e0e80eb11ebd80df98 Mon Sep 17 00:00:00 2001 +From: Avnish Chouhan +Date: Mon, 27 Mar 2023 12:25:40 +0530 +Subject: [PATCH 2/2] kern/ieee1275/init: Extended support in Vec5 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch enables multiple options in Vec5 which are required and +solves the boot issues seen on some machines which are looking for +these specific options. + +1. LPAR: Client program supports logical partitioning and + associated hcall()s. +2. SPLPAR: Client program supports the Shared + Processor LPAR Option. +3. DYN_RCON_MEM: Client program supports the + “ibm,dynamic-reconfiguration-memory” property and it may be + presented in the device tree. +4. LARGE_PAGES: Client supports pages larger than 4 KB. +5. DONATE_DCPU_CLS: Client supports donating dedicated processor cycles. +6. PCI_EXP: Client supports PCI Express implementations + utilizing Message Signaled Interrupts (MSIs). + +7. CMOC: Enables the Cooperative Memory Over-commitment Option. +8. EXT_CMO: Enables the Extended Cooperative Memory Over-commit Option. + +9. ASSOC_REF: Enables “ibm,associativity” and + “ibm,associativity-reference-points” properties. +10. AFFINITY: Enables Platform Resource Reassignment Notification. +11. NUMA: Supports NUMA Distance Lookup Table Option. + +12. HOTPLUG_INTRPT: Supports Hotplug Interrupts. +13. HPT_RESIZE: Enable Hash Page Table Resize Option. + +14. MAX_CPU: Defines maximum number of CPUs supported. + +15. PFO_HWRNG: Supports Random Number Generator. +16. PFO_HW_COMP: Supports Compression Engine. +17. PFO_ENCRYPT: Supports Encryption Engine. + +18. SUB_PROCESSORS: Supports Sub-Processors. + +19. DY_MEM_V2: Client program supports the “ibm,dynamic-memory-v2” property in the + “ibm,dynamic-reconfiguration-memory” node and it may be presented in the device tree. +20. DRC_INFO: Client program supports the “ibm,drc-info” property definition and it may be + presented in the device tree. + +Signed-off-by: Avnish Chouhan +Reviewed-by: Daniel Kiper +--- + grub-core/kern/ieee1275/init.c | 47 +++++++++++++++++++++++++++++----- + 1 file changed, 41 insertions(+), 6 deletions(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index eaa25d0db..00f892ebe 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -61,11 +61,41 @@ extern char _end[]; + grub_addr_t grub_ieee1275_original_stack; + #endif + +-#define LPAR 0x80 +-#define SPLPAR 0x40 +-#define BYTE2 (LPAR | SPLPAR) +-#define CMO 0x80 +-#define MAX_CPU 256 ++/* Options vector5 properties. */ ++ ++#define LPAR 0x80 ++#define SPLPAR 0x40 ++#define DYN_RCON_MEM 0x20 ++#define LARGE_PAGES 0x10 ++#define DONATE_DCPU_CLS 0x02 ++#define PCI_EXP 0x01 ++#define BYTE2 (LPAR | SPLPAR | DYN_RCON_MEM | LARGE_PAGES | DONATE_DCPU_CLS | PCI_EXP) ++ ++#define CMOC 0x80 ++#define EXT_CMO 0x40 ++#define CMO (CMOC | EXT_CMO) ++ ++#define ASSOC_REF 0x80 ++#define AFFINITY 0x40 ++#define NUMA 0x20 ++#define ASSOCIATIVITY (ASSOC_REF | AFFINITY | NUMA) ++ ++#define HOTPLUG_INTRPT 0x04 ++#define HPT_RESIZE 0x01 ++#define BIN_OPTS (HOTPLUG_INTRPT | HPT_RESIZE) ++ ++#define MAX_CPU 256 ++ ++#define PFO_HWRNG 0x80000000 ++#define PFO_HW_COMP 0x40000000 ++#define PFO_ENCRYPT 0x20000000 ++#define PLATFORM_FACILITIES (PFO_HWRNG | PFO_HW_COMP | PFO_ENCRYPT) ++ ++#define SUB_PROCESSORS 1 ++ ++#define DY_MEM_V2 0x80 ++#define DRC_INFO 0x40 ++#define BYTE22 (DY_MEM_V2 | DRC_INFO) + + void + grub_exit (void) +@@ -328,6 +358,11 @@ struct option_vector5 + grub_uint8_t micro_checkpoint; + grub_uint8_t reserved0; + grub_uint32_t max_cpus; ++ grub_uint16_t base_papr; ++ grub_uint16_t mem_reference; ++ grub_uint32_t platform_facilities; ++ grub_uint8_t sub_processors; ++ grub_uint8_t byte22; + } GRUB_PACKED; + + struct pvr_entry +@@ -384,7 +419,7 @@ grub_ieee1275_ibm_cas (void) + .vec4 = 0x0001, /* set required minimum capacity % to the lowest value */ + .vec5_size = 1 + sizeof (struct option_vector5) - 2, + .vec5 = { +- 0, BYTE2, 0, CMO, 0, 0, 0, 0, MAX_CPU ++ 0, BYTE2, 0, CMO, ASSOCIATIVITY, BIN_OPTS, 0, 0, MAX_CPU, 0, 0, PLATFORM_FACILITIES, SUB_PROCESSORS, BYTE22 + } + }; + +-- +2.39.2 + diff --git a/grub2.changes b/grub2.changes index dad9d7e..59db128 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Apr 21 04:53:54 UTC 2023 - Michael Chang + +- Fix PowerVS deployment fails to boot with 90 cores (bsc#1208581) + * 0001-kern-ieee1275-init-Convert-plain-numbers-to-constant.patch + * 0002-kern-ieee1275-init-Extended-support-in-Vec5.patch + ------------------------------------------------------------------- Tue Apr 18 02:42:23 UTC 2023 - Michael Chang diff --git a/grub2.spec b/grub2.spec index b78d475..20ddd0b 100644 --- a/grub2.spec +++ b/grub2.spec @@ -507,6 +507,8 @@ Patch977: 0001-loader-linux-Ensure-the-newc-pathname-is-NULL-termin.patch Patch978: 0002-Restrict-cryptsetup-key-file-permission-for-better-s.patch Patch979: 0001-openfw-Ensure-get_devargs-and-get_devname-functions-.patch Patch980: 0002-prep_loadenv-Fix-regex-for-Open-Firmware-device-spec.patch +Patch981: 0001-kern-ieee1275-init-Convert-plain-numbers-to-constant.patch +Patch982: 0002-kern-ieee1275-init-Extended-support-in-Vec5.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140