Blame SOURCES/0316-ieee1275-implement-vec5-for-cas-negotiation.patch

fd0330
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
fd0330
From: Diego Domingos <diegodo@linux.vnet.ibm.com>
fd0330
Date: Mon, 6 Feb 2023 10:03:23 -0500
fd0330
Subject: [PATCH] ieee1275: implement vec5 for cas negotiation
fd0330
fd0330
As a legacy support, if the vector 5 is not implemented, Power Hypervisor will
fd0330
consider the max CPUs as 64 instead 256 currently supported during
fd0330
client-architecture-support negotiation.
fd0330
fd0330
This patch implements the vector 5 and set the MAX CPUs to 256 while setting the
fd0330
others values to 0 (default).
fd0330
fd0330
Signed-off-by: Diego Domingos <diegodo@linux.vnet.ibm.com>
fd0330
Acked-by: Daniel Axtens <dja@axtens.net>
fd0330
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
fd0330
Signed-off-by: Avnish Chouhan <avnish@linux.vnet.ibm.com>
fd0330
(cherry picked from commit 942f19959fe7465fb52a1da39ff271a7ab704892)
fd0330
---
fd0330
 grub-core/kern/ieee1275/init.c | 21 ++++++++++++++++++++-
fd0330
 1 file changed, 20 insertions(+), 1 deletion(-)
fd0330
fd0330
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
fd0330
index 85af8fa97b..72d4fed312 100644
fd0330
--- a/grub-core/kern/ieee1275/init.c
fd0330
+++ b/grub-core/kern/ieee1275/init.c
fd0330
@@ -502,6 +502,19 @@ struct option_vector2
fd0330
   grub_uint8_t max_pft_size;
fd0330
 } GRUB_PACKED;
fd0330
 
fd0330
+struct option_vector5
fd0330
+{
fd0330
+  grub_uint8_t byte1;
fd0330
+  grub_uint8_t byte2;
fd0330
+  grub_uint8_t byte3;
fd0330
+  grub_uint8_t cmo;
fd0330
+  grub_uint8_t associativity;
fd0330
+  grub_uint8_t bin_opts;
fd0330
+  grub_uint8_t micro_checkpoint;
fd0330
+  grub_uint8_t reserved0;
fd0330
+  grub_uint32_t max_cpus;
fd0330
+} GRUB_PACKED;
fd0330
+
fd0330
 struct pvr_entry
fd0330
 {
fd0330
   grub_uint32_t mask;
fd0330
@@ -523,6 +536,8 @@ struct cas_vector
fd0330
   grub_uint16_t vec3;
fd0330
   grub_uint8_t vec4_size;
fd0330
   grub_uint16_t vec4;
fd0330
+  grub_uint8_t vec5_size;
fd0330
+  struct option_vector5 vec5;
fd0330
 } GRUB_PACKED;
fd0330
 
fd0330
 /*
fd0330
@@ -547,7 +562,7 @@ grub_ieee1275_ibm_cas (void)
fd0330
   struct cas_vector vector =
fd0330
   {
fd0330
     .pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */
fd0330
-    .num_vecs = 4 - 1,
fd0330
+    .num_vecs = 5 - 1,
fd0330
     .vec1_size = 0,
fd0330
     .vec1 = 0x80, /* ignore */
fd0330
     .vec2_size = 1 + sizeof (struct option_vector2) - 2,
fd0330
@@ -558,6 +573,10 @@ grub_ieee1275_ibm_cas (void)
fd0330
     .vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if unsatisfied */
fd0330
     .vec4_size = 2 - 1,
fd0330
     .vec4 = 0x0001, /* set required minimum capacity % to the lowest value */
fd0330
+    .vec5_size = 1 + sizeof (struct option_vector5) - 2,
fd0330
+    .vec5 = {
fd0330
+      0, 192, 0, 128, 0, 0, 0, 0, 256
fd0330
+    }
fd0330
   };
fd0330
 
fd0330
   INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2);