Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pggp2-0005Rh-5u for mharc-grub-devel@gnu.org; Mon, 27 Mar 2023 02:59:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pggp0-0005RV-GA for grub-devel@gnu.org; Mon, 27 Mar 2023 02:59:14 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pggoy-0002Rg-Id for grub-devel@gnu.org; Mon, 27 Mar 2023 02:59:14 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32R608ZF012447; Mon, 27 Mar 2023 06:59:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=4cZg7V7N5EMeYTxZCSXrhs2pt2oHuMdJcgxEgjJglPI=; b=Y5esOrVReeDiVJuM+VggMNaevPXUP1RKr80QBEMI+pP1zkYeY1wOKFyNQssn+t82hjxx B3tAGbfeRAFb1S4CORjka9mhis4o5m4VFMHNpr8UR9EzeW7k1ouaxAl89g4hxAwDWNX7 YK9J2sVB9ciCOLV1FyT2m4cIzPdpXC4O38nWYg33YH6ZYUWOCrKdANTAZpd1RDRBeBan mfZVZ0sBNffXDxHOLgYsySbVnRH6lc+s33reeiNf5dqa2EufrHgxcPKaE/J5EEnpy4O+ 133ZIjGETMzuIVy2EDgZ4GdksDj0bovLGXP8Tc7E0d7E9CQkl4W3RdBm4PFTw0yyUesi fA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pjamm7uby-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 06:59:10 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32R6rViY030914; Mon, 27 Mar 2023 06:59:10 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pjamm7ub8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 06:59:10 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32QIood7020160; Mon, 27 Mar 2023 06:59:08 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma05fra.de.ibm.com (PPS) with ESMTPS id 3phrk6j35h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 06:59:08 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32R6x5ID45482342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Mar 2023 06:59:06 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D0C5020040; Mon, 27 Mar 2023 06:59:05 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43AA920043; Mon, 27 Mar 2023 06:59:03 +0000 (GMT) Received: from li-5fd77d4c-2a67-11b2-a85c-de894c326bed.in.ibm.com (unknown [9.109.242.131]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 27 Mar 2023 06:59:03 +0000 (GMT) From: Avnish Chouhan To: grub-devel@gnu.org Cc: meghanaprakash@in.ibm.com, brking@linux.vnet.ibm.com, mchauras@linux.vnet.ibm.com, mamatha4@linux.vnet.ibm.com, rharwood@redhat.com, mlewando@redhat.com, mchang@suse.com, msuchanek@suse.com, dkiper@net-space.pl, Avnish Chouhan Subject: [PATCH v2 2/2] ieee1275 : extended support in options vector5 Date: Mon, 27 Mar 2023 12:25:40 +0530 Message-Id: <20230327065540.10927-2-avnish@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230327065540.10927-1-avnish@linux.vnet.ibm.com> References: <20230327065540.10927-1-avnish@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0dT1Kxe-Oxbx_TBejQqigEoBSYsErNJ_ X-Proofpoint-GUID: vxZ4m3B3CKJu0zd_SXPSdIu78JRAQoPG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-24_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 priorityscore=1501 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303270053 Received-SPF: none client-ip=148.163.158.5; envelope-from=avnish@linux.vnet.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2023 06:59:14 -0000 This patch enables the multiple options in Options Vector5 which are required and solves the boot issue seen on some machines which are looking for these specific options. 1. LPAR : Client program supports logical partitioning and associated hcall()s. 2. SPLPAR : Client program supports the Shared Processor LPAR Option. 3. DYN_RCON_MEM : Client program supports the “ibm,dynamic-reconfiguration-memory” property and it may be presented in the device tree. 4. LARGE_PAGES : Client supports pages larger than 4 KB. 5. DONATE_DCPU_CLS : Client supports donating dedicated processor cycles. 6. PCI_EXP : Client supports PCI Express implementations utilizing Message Signaled Interrupts (MSIs). 7. CMOC : Enables the Cooperative Memory Over-commitment Option. 8. EXT_CMO : Enables the Extended Cooperative Memory Over-commit Option. 9. ASSOC_REF : Enables “ibm,associativity” and “ibm,associativity-reference-points” properties. 10. AFFINITY : Enables Platform Resource Reassignment Notification. 11. NUMA : Supports NUMA Distance Lookup Table Option. 12. HOTPLUG_INTRPT : Supports Hotplug Interrupts. 13. HPT_RESIZE : Enable Hash Page Table Resize Option. 14. MAX_CPU : Defines maximum number of CPUs supported. 15. PFO_HWRNG : Supports Random Number Generator. 16. PFO_HW_COMP : Supports Compression Engine. 17. PFO_ENCRYPT : Supports Encryption Engine. 18. SUB_PROCESSORS : Supports Sub-Processors. 19. DY_MEM_V2 : Client program supports the “ibm,dynamic-memory-v2” property in the “ibm,dynamic-reconfiguration-memory” node and it may be presented in the device tree. 20. DRC_INFO : Client program supports the “ibm,drc-info” property definition and it may be presented in the device tree. Signed-off-by: Avnish Chouhan --- Change log: V2 - Split the patch as suggested by Daniel Kiper. --- grub-core/kern/ieee1275/init.c | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c index 72474a9..e0f33d4 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -72,11 +72,41 @@ extern char _end[]; grub_addr_t grub_ieee1275_original_stack; #endif -#define LPAR 0x80 -#define SPLPAR 0x40 -#define BYTE2 (LPAR | SPLPAR) -#define CMO 0x80 -#define MAX_CPU 256 +/* Options vector5 properties */ + +#define LPAR 0x80 +#define SPLPAR 0x40 +#define DYN_RCON_MEM 0x20 +#define LARGE_PAGES 0x10 +#define DONATE_DCPU_CLS 0x02 +#define PCI_EXP 0x01 +#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 0x04 +#define HPT_RESIZE 0x01 +#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) @@ -517,6 +547,11 @@ struct option_vector5 grub_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 @@ -579,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, BYTE2, 0, CMO, 0, 0, 0, 0, MAX_CPU + 0, BYTE2, 0, CMO, ASSOCIATIVITY, BIN_OPTS, 0, 0, MAX_CPU, 0, 0, PLATFORM_FACILITIES, SUB_PROCESSORS, BYTE22 } }; -- 2.31.1