ieee1275 : extended support in options vector5
PATCH 1/1 ieee1275 : extended support in options vector5
This patch enables the multiple options in Options Vector5.
--- grub-core/kern/ieee1275/init.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)
grub-core/kern/ieee1275/init.c +42 -1
@@ -72,6 +72,42 @@ extern char _end[];grub_addr_t grub_ieee1275_original_stack;#endif +/* Options vector5 properties */ + +#define LPAR 0x80 +#define SPLPAR 0x40 +#define DYN_RCON_MEM 0x20 +#define LARGE_PAGES 0x10 +#define DONATE_DCPU_CLS 0x2 +#define PCI_EXP 0x1 +#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 0x4 +#define HPT_RESIZE 0x1 +#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 ) {
@@ -511,6 +547,11 @@ struct option_vector5grub_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
@@ -573,7 +614,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 ,ASSOCIATIVITY ,BIN_OPTS ,0 ,0 ,MAX_CPU ,0 ,0 ,PLATFORM_FACILITIES ,SUB_PROCESSORS ,BYTE22 } };
Signature · 1 line
2.31.1
Hello,
Quoted 68 lines · Avnish Chouhan
This patch enables the multiple options in Options Vector5.
Signed-off-by Avnish Chouhan <[email protected]>Reviewed-by Brian King <[email protected]>--- grub-core/kern/ieee1275/init.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)grub-core/kern/ieee1275/init.c +41
-0@@ -72,6 +72,42 @@ extern char _end[];grub_addr_t grub_ieee1275_original_stack;#endif +/* Options vector5 properties */ + +#define LPAR 0x80 +#define SPLPAR 0x40 +#define DYN_RCON_MEM 0x20 +#define LARGE_PAGES 0x10 +#define DONATE_DCPU_CLS 0x2 +#define PCI_EXP 0x1 +#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 0x4 +#define HPT_RESIZE 0x1 +#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 ) {@@ -511,6 +547,11 @@ struct option_vector5grub_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
grub-core/kern/ieee1275/init.c grub_ieee1275_ibm_cas (void) · line 617
Quoted 5 lines
grub-core/kern/ieee1275/init.c +1
-1@@ -573,7 +614,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 ,ASSOCIATIVITY ,BIN_OPTS ,0 ,0 ,MAX_CPU ,0 ,0 ,PLATFORM_FACILITIES ,SUB_PROCESSORS ,BYTE22
Thanks for adding the named constants, that makes the initialization much more readable.
Thanks
Michal
Quoted 6 lines
grub-core/kern/ieee1275/init.c +0
-0} };Signature · 1 line
2.31.1
Quoted 1 line · Avnish Chouhan
This patch enables the multiple options in Options Vector5.
May I ask you to add an explanation to the commit message why this patch is needed? Additionally, please name and, at least shortly, explain all added options.
Quoted 2 lines
Signed-off-by Avnish Chouhan <[email protected]>Reviewed-by Brian King <[email protected]>
I have not seen Brian adding this in public. Please do not add any RBs which were never ever given in public.
Quoted 9 lines
--- grub-core/kern/ieee1275/init.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)grub-core/kern/ieee1275/init.c +0
-0
grub-core/kern/ieee1275/init.c extern char _end[]; · line 81
Quoted 10 lines
grub-core/kern/ieee1275/init.c +7
-0@@ -72,6 +72,42 @@ extern char _end[];grub_addr_t grub_ieee1275_original_stack;#endif +/* Options vector5 properties */ + +#define LPAR 0x80 +#define SPLPAR 0x40 +#define DYN_RCON_MEM 0x20 +#define LARGE_PAGES 0x10 +#define DONATE_DCPU_CLS 0x2
s/0x2/0x02/
grub-core/kern/ieee1275/init.c extern char _end[]; · line 82
Quoted 1 line
grub-core/kern/ieee1275/init.c +1
-0+#define PCI_EXP 0x1
s/0x1/0x01/
grub-core/kern/ieee1275/init.c extern char _end[]; · line 95
Quoted 13 lines
grub-core/kern/ieee1275/init.c +13
-0+#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 0x4 +#define HPT_RESIZE 0x1
Please add as many zeros as needed before [14] as above.
And now I think I would split this patch into two. In the first patch I would convert existing plain numbers to constants. Then I would add new options in the second patch.
Daniel