Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pP33K-00021b-OH for mharc-grub-devel@gnu.org; Mon, 06 Feb 2023 10:05:06 -0500 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 1pP33H-0001vp-O8 for grub-devel@gnu.org; Mon, 06 Feb 2023 10:05:04 -0500 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 1pP33E-0007iz-AT for grub-devel@gnu.org; Mon, 06 Feb 2023 10:05:02 -0500 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 316F4pJl010317; Mon, 6 Feb 2023 15:04:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=GMnJqDkSnMU5aabymJNX/EgvtOCNnUAIca7id6cVnOg=; b=nEmwxClDOtXTywEnqP8BP1boKy+zScB7oSaoV+dCnu3kA/SP8Zht50HokAPrO0OlCInb gwrnRQ/ILeBj03E/lq2znEvflunV3wj9/WurYH/drEvSpbuH+U5Dv1sM+/LR0gmQGeCY pnGHdJ2yZKgm8myXb2NNjwnJ9Gq09N4zgs6QlzYDu6POYLvJEnD8HtTS1yF+iI+4k7iM wnILguJqlGyiqWnasb1wjXI7unbaxfBGPiq29f/Lfe1/jVFy8hcXSMcBDvZ26CyrhD+A Kbu26g5C8w/LM09eoihbkgD+OtVw3f8Qxxk+21blWzzzZAlN/pziAd441AJyZhXFJGKO cQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk3rm8866-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 15:04:57 +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 316ExBIF015116; Mon, 6 Feb 2023 15:04:56 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk3rm87g2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 15:04:54 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316CCE1J006119; Mon, 6 Feb 2023 15:03:34 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([9.208.129.114]) by ppma03wdc.us.ibm.com (PPS) with ESMTPS id 3nhf06u8vw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 15:03:34 +0000 Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316F3UmG19989060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 15:03:30 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A75BF58050; Mon, 6 Feb 2023 15:03:30 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CE7D858045; Mon, 6 Feb 2023 15:03:29 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 15:03:29 +0000 (GMT) From: Stefan Berger To: grub-devel@gnu.org, dkiper@net-space.pl Cc: development@efficientek.com, dja@axtens.net, sudhakar@linux.ibm.com, nasastry@in.ibm.com, avnish@imap.linux.ibm.com, rharwood@redhat.com, Stefan Berger Subject: [PATCH v4 0/6] Dynamic allocation of memory regions and IBM vTPM 2.0 Date: Mon, 6 Feb 2023 10:03:19 -0500 Message-Id: <20230206150325.3756840-1-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.39.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: gMVGG0c68e7SVaKwQjlkb1khgswTQqLS X-Proofpoint-ORIG-GUID: 1CJz9XyLiNVZ1FLZAVYAx_Oestl3uxJg Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 spamscore=0 malwarescore=0 clxscore=1015 bulkscore=0 adultscore=0 mlxscore=0 impostorscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060130 Received-SPF: pass client-ip=148.163.158.5; envelope-from=stefanb@linux.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_PASS=-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, 06 Feb 2023 15:05:04 -0000 Hello, This is an addition to the series sent from Daniel Axtens (https://lists.gnu.org/archive/html/grub-devel/2022-04/msg00064.html). Patch 'ieee1275: request memory with ibm,client-architecture-support' implements vectors 1-4 of client-architecture-support negotiation However, during some tests, we found this can be a problem if: - we have more than 64 CPUs - Hardware Management Console (HMC) is configured to minimum of CPUs >64 (for example, min of 200 CPUs) - Grub needs to request memory. If vector 5 is not implemented, Power Hypervisor will consider the default value for vector 5 and 64 will bet set as the maximum number of CPUs supported by the OS, causing the machine to fail to init. Today we support 256 CPUs (max) on Power, so we need to implement vector 5 and set the MAX CPUs bits to this value. Add an IBM/ieee1275 vTPM 2.0 driver that requires the preceeding memory patches due to the grub's TPM subsystem needing large chunks of memory for hashing of files such as initrd and kernel. Stefan v4: - Removed #ifdef MM_DEBUG's from memtool module - Using latest vec5 from Avnish v3: - Added #if defined(__powerpc__) [1/6] - Address possible integer underlow [3/6] - Added comment why tpm_init() function cannot be called from GRUB_MOD_INIT() - Added Reviewed-by tags to {1,2,5,6}/6 v2: - Followed Daniel K.'s list of suggestions checking the list more than twice and adjusted formatting, line breaks, etc. in all patches - Conditional compilation of ppc64-specific code using #ifdef __powerpc__ - Fixing of installation of memtool; adding of warning message for __powerpc__ since it requires a reboot after running memory stress test - Tested it on i386-pc and PowerKVM Daniel Axtens (4): ieee1275: request memory with ibm, client-architecture-support ieee1275: drop len -= 1 quirk in heap_init ieee1275: support runtime memory claiming Add memtool module with memory allocation stress-test Diego Domingos (1): ieee1275: implement vec5 for cas negotiation Stefan Berger (1): ibmvtpm: Add support for trusted boot using a vTPM 2.0 configure.ac | 1 + docs/grub-dev.texi | 7 +- docs/grub.texi | 3 +- grub-core/Makefile.core.def | 13 + grub-core/commands/ieee1275/ibmvtpm.c | 155 +++++++++ grub-core/commands/memtools.c | 152 +++++++++ grub-core/kern/ieee1275/cmain.c | 5 + grub-core/kern/ieee1275/init.c | 445 +++++++++++++++++++++++++- grub-core/kern/mm.c | 4 + include/grub/ieee1275/ieee1275.h | 13 + 10 files changed, 781 insertions(+), 17 deletions(-) create mode 100644 grub-core/commands/ieee1275/ibmvtpm.c create mode 100644 grub-core/commands/memtools.c -- 2.25.1