From 14c89e54e6fca0c3660d1a59b4b17447bf9401d748d2811ad3cd025d0f9d1705 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Mon, 25 Apr 2022 05:04:46 +0000 Subject: [PATCH] Accepting request 972429 from home:michael-chang:branches:Base:System - Fix Power10 LPAR error "The partition fails to activate as partition went into invalid state" (bsc#1198714) * 0001-powerpc-do-CAS-in-a-more-compatible-way.patch OBS-URL: https://build.opensuse.org/request/show/972429 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=413 --- ...erpc-do-CAS-in-a-more-compatible-way.patch | 113 ++++++++++++++++++ grub2.changes | 7 ++ grub2.spec | 1 + 3 files changed, 121 insertions(+) create mode 100644 0001-powerpc-do-CAS-in-a-more-compatible-way.patch diff --git a/0001-powerpc-do-CAS-in-a-more-compatible-way.patch b/0001-powerpc-do-CAS-in-a-more-compatible-way.patch new file mode 100644 index 0000000..f1d5dc4 --- /dev/null +++ b/0001-powerpc-do-CAS-in-a-more-compatible-way.patch @@ -0,0 +1,113 @@ +From 91c9ff5515821fa579961a4c3a411a29384fbfd6 Mon Sep 17 00:00:00 2001 +From: Daniel Axtens +Date: Fri, 8 Apr 2022 12:35:28 +1000 +Subject: [PATCH] powerpc: do CAS in a more compatible way + +I wrongly assumed that the most compatible way to perform CAS +negotiation was to only set the minimum number of vectors required +to ask for more memory. It turns out that this messes up booting +if the minimum VP capacity would be less than the default 10% in +vector 4. + +Linux configures the minimum capacity to be 1%, so copy it for that +and for vector 3 which we now need to specify as well. + +Signed-off-by: Daniel Axtens +--- + grub-core/kern/ieee1275/init.c | 54 +++++++++++++++++++--------------- + 1 file changed, 31 insertions(+), 23 deletions(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index d77d896043..7d7178d3e1 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -298,33 +298,37 @@ grub_ieee1275_total_mem (grub_uint64_t *total) + + /* Based on linux - arch/powerpc/kernel/prom_init.c */ + struct option_vector2 { +- grub_uint8_t byte1; +- grub_uint16_t reserved; +- grub_uint32_t real_base; +- grub_uint32_t real_size; +- grub_uint32_t virt_base; +- grub_uint32_t virt_size; +- grub_uint32_t load_base; +- grub_uint32_t min_rma; +- grub_uint32_t min_load; +- grub_uint8_t min_rma_percent; +- grub_uint8_t max_pft_size; ++ grub_uint8_t byte1; ++ grub_uint16_t reserved; ++ grub_uint32_t real_base; ++ grub_uint32_t real_size; ++ grub_uint32_t virt_base; ++ grub_uint32_t virt_size; ++ grub_uint32_t load_base; ++ grub_uint32_t min_rma; ++ grub_uint32_t min_load; ++ grub_uint8_t min_rma_percent; ++ grub_uint8_t max_pft_size; + } __attribute__((packed)); + + struct pvr_entry { +- grub_uint32_t mask; +- grub_uint32_t entry; ++ grub_uint32_t mask; ++ grub_uint32_t entry; + }; + + struct cas_vector { +- struct { +- struct pvr_entry terminal; +- } pvr_list; +- grub_uint8_t num_vecs; +- grub_uint8_t vec1_size; +- grub_uint8_t vec1; +- grub_uint8_t vec2_size; +- struct option_vector2 vec2; ++ struct { ++ struct pvr_entry terminal; ++ } pvr_list; ++ grub_uint8_t num_vecs; ++ grub_uint8_t vec1_size; ++ grub_uint8_t vec1; ++ grub_uint8_t vec2_size; ++ struct option_vector2 vec2; ++ grub_uint8_t vec3_size; ++ grub_uint16_t vec3; ++ grub_uint8_t vec4_size; ++ grub_uint16_t vec4; + } __attribute__((packed)); + + /* Call ibm,client-architecture-support to try to get more RMA. +@@ -345,13 +349,17 @@ grub_ieee1275_ibm_cas (void) + } args; + struct cas_vector vector = { + .pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */ +- .num_vecs = 2 - 1, ++ .num_vecs = 4 - 1, + .vec1_size = 0, + .vec1 = 0x80, /* ignore */ + .vec2_size = 1 + sizeof(struct option_vector2) - 2, + .vec2 = { + 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48 + }, ++ .vec3_size = 2 - 1, ++ .vec3 = 0x00e0, // ask for FP + VMX + DFP but don't halt if unsatisfied ++ .vec4_size = 2 - 1, ++ .vec4 = 0x0001, // set required minimum capacity % to the lowest value + }; + + INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2); +@@ -364,7 +372,7 @@ grub_ieee1275_ibm_cas (void) + args.ihandle = root; + args.cas_addr = (grub_ieee1275_cell_t)&vector; + +- grub_printf("Calling ibm,client-architecture-support..."); ++ grub_printf("Calling ibm,client-architecture-support from grub..."); + IEEE1275_CALL_ENTRY_FN (&args); + grub_printf("done\n"); + +-- +2.34.1 + diff --git a/grub2.changes b/grub2.changes index fa60204..6aa8bcf 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Apr 21 09:35:15 UTC 2022 - Michael Chang + +- Fix Power10 LPAR error "The partition fails to activate as partition went + into invalid state" (bsc#1198714) + * 0001-powerpc-do-CAS-in-a-more-compatible-way.patch + ------------------------------------------------------------------- Mon Apr 11 11:50:04 UTC 2022 - Ludwig Nussel diff --git a/grub2.spec b/grub2.spec index 9d3a4aa..0d0af56 100644 --- a/grub2.spec +++ b/grub2.spec @@ -371,6 +371,7 @@ Patch845: 0001-mkimage-Fix-dangling-pointer-may-be-used-error.patch Patch846: 0002-Fix-Werror-array-bounds-array-subscript-0-is-outside.patch Patch847: 0003-reed_solomon-Fix-array-subscript-0-is-outside-array-.patch Patch848: 0001-grub-probe-Deduplicate-probed-partmap-output.patch +Patch849: 0001-powerpc-do-CAS-in-a-more-compatible-way.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140