SHA256
1
0
forked from pool/grub2
grub2/0002-ieee1275-implement-vec5-for-cas-negotiation.patch
Michael Chang 23aa9ce4c5 Accepting request 1067109 from home:michael-chang:branches:Base:System
- Fix out of memory error on lpar installation from virtual cdrom (bsc#1208024)
  * 0001-ieee1275-Further-increase-initially-allocated-heap-f.patch
  * 0002-tpm-Disable-tpm-verifier-if-tpm-is-not-present.patch
- Fix lpar got hung at grub after inactive migration (bsc#1207684)
  * 0002-ieee1275-implement-vec5-for-cas-negotiation.patch
- Rediff
  * safe_tpm_pcr_snapshot.patch
- Patch supersceded
  * 0001-tpm-Disable-tpm-verifier-if-tpm-is-not-present.patch

OBS-URL: https://build.opensuse.org/request/show/1067109
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=441
2023-02-24 05:42:16 +00:00

84 lines
2.7 KiB
Diff

From 03056f35a73258fa68a809fba4aeab654ff35734 Mon Sep 17 00:00:00 2001
From: Diego Domingos <diegodo@linux.vnet.ibm.com>
Date: Thu, 25 Aug 2022 11:37:56 -0400
Subject: [PATCH] ieee1275: implement vec5 for cas negotiation
As a legacy support, if the vector 5 is not implemented, Power Hypervisor will
consider the max CPUs as 64 instead 256 currently supported during
client-architecture-support negotiation.
This patch implements the vector 5 and set the MAX CPUs to 256 while setting the
others values to 0 (default).
Signed-off-by: Diego Domingos <diegodo@linux.vnet.ibm.com>
Acked-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Avnish Chouhan <avnish@linux.vnet.ibm.com>
---
grub-core/kern/ieee1275/init.c | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index 7d7178d3e..0e902ff62 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -311,7 +311,21 @@ struct option_vector2 {
grub_uint8_t max_pft_size;
} __attribute__((packed));
-struct pvr_entry {
+struct option_vector5
+{
+ grub_uint8_t byte1;
+ grub_uint8_t byte2;
+ grub_uint8_t byte3;
+ grub_uint8_t cmo;
+ grub_uint8_t associativity;
+ grub_uint8_t bin_opts;
+ grub_uint8_t micro_checkpoint;
+ grub_uint8_t reserved0;
+ grub_uint32_t max_cpus;
+} GRUB_PACKED;
+
+struct pvr_entry
+{
grub_uint32_t mask;
grub_uint32_t entry;
};
@@ -329,7 +343,9 @@ struct cas_vector {
grub_uint16_t vec3;
grub_uint8_t vec4_size;
grub_uint16_t vec4;
-} __attribute__((packed));
+ grub_uint8_t vec5_size;
+ struct option_vector5 vec5;
+} GRUB_PACKED;
/* Call ibm,client-architecture-support to try to get more RMA.
We ask for 512MB which should be enough to verify a distro kernel.
@@ -349,7 +365,7 @@ grub_ieee1275_ibm_cas (void)
} args;
struct cas_vector vector = {
.pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */
- .num_vecs = 4 - 1,
+ .num_vecs = 5 - 1,
.vec1_size = 0,
.vec1 = 0x80, /* ignore */
.vec2_size = 1 + sizeof(struct option_vector2) - 2,
@@ -359,7 +375,11 @@ grub_ieee1275_ibm_cas (void)
.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
+ .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
+ }
};
INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2);
--
2.39.1