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

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