Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jEFoO-00070s-6O for mharc-grub-devel@gnu.org; Tue, 17 Mar 2020 13:15:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51496) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEFoM-0006zz-5s for grub-devel@gnu.org; Tue, 17 Mar 2020 13:15:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEFoK-0000Fn-Rk for grub-devel@gnu.org; Tue, 17 Mar 2020 13:15:25 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54776 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jEFoK-0008SM-MM for grub-devel@gnu.org; Tue, 17 Mar 2020 13:15:24 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02HH2TJE006637 for ; Tue, 17 Mar 2020 13:15:23 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ytb4uq8qd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 17 Mar 2020 13:15:23 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02HHAQCT029348 for ; Tue, 17 Mar 2020 17:15:22 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03wdc.us.ibm.com with ESMTP id 2yrpw69wgu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 17 Mar 2020 17:15:22 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02HHFMTJ54133204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Mar 2020 17:15:22 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B00AAE064 for ; Tue, 17 Mar 2020 17:15:22 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F79AAE060 for ; Tue, 17 Mar 2020 17:15:22 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 17:15:22 +0000 (GMT) To: grub-devel@gnu.org From: Stefan Berger Subject: Verifier running out of memory on ieee1275/powerpc64 Message-ID: Date: Tue, 17 Mar 2020 13:15:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-17_06:2020-03-17, 2020-03-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 priorityscore=1501 impostorscore=0 suspectscore=1 malwarescore=0 spamscore=0 clxscore=1011 mlxlogscore=939 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003170067 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id 02HH2TJE006637 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2020 17:15:27 -0000 Hello! =C2=A0I trying to add (v)TPM support for the ieee1275/powerpc64 platform= to=20 grub. The issue I have been running into is that the verifier runs out=20 of memory. At that point it has loaded the (~ 32MB) Linux kernel and now=20 the verifier is invoked to load the file. Unfortunately it cannot load=20 the file since it doesn't have enough memory to grub_malloc. I have=20 played with increasing heap size(es) but it still doesn't work. The=20 kernel and initramfs files on ppc64 can be rather big, thus we do not a=20 lot of memory. The rescue initramfs here is for example 78MB, a regular=20 initramfs from Fedora 31 is ~34MB. The kernel sizes on my system are=20 32MB, though a colleague was using an unstripped kernel of 127MB, so=20 lots of (unfragmented) memory needs to be available to run verifiers. This is the code that's trying to allocate the memory to load the file=20 into:=20 http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/commands/verifie= rs.c#n128 I had increased the GRUB_IEEE_STATIC_HEAP_LEN to 0x4000000, but it=20 didn't resolve the issue:=20 http://git.savannah.gnu.org/cgit/grub.git/tree/include/grub/ieee1275/ieee= 1275.h#n93 I also tried to increase the HEAP_MAX_SIZE to 128 * 1024 * 1024 along=20 with HEAP_MAX_ADDR, but that didn't help, either:=20 http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/kern/ieee1275/in= it.c Does anybody have a suggestion? =C2=A0=C2=A0 Regards, =C2=A0=C2=A0=C2=A0 Stefan