From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1m967o-0003ej-QX for mharc-grub-devel@gnu.org; Thu, 29 Jul 2021 09:31:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m967n-0003eL-3Y for grub-devel@gnu.org; Thu, 29 Jul 2021 09:30:59 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:30970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m967l-00046y-46 for grub-devel@gnu.org; Thu, 29 Jul 2021 09:30:58 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16TDSKLt064828; Thu, 29 Jul 2021 09:30:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=uJrfkWcwVlL7b7ZbAn5RJ4EkuJziRtRlq058jQfcuq4=; b=hMtz60SkotvAqScdHc6Be1ItH/G/aQqYhNEYDRdcGoH7JEgFxEJ014ghj2iltPrMvIct ZZauvPQ0k6VpGF7cK2oKSezOT/DNaBKpxOhutX3jyFhpdvJ1aHnvjVqEWRVWp4fwUJIa blnoPFVLh/v/7HhMoz4vwyZhcA2MSIcSmHfyeTMrPFSto7pA/4E32Y2X+luTgGpWiIQA mjJaHLSFvde0NkbUNWRusS1mKjNtcPb8fdVdIJ3JDmq57zObit7+Z/g1ctKTkVLEFKdq hAMbeSbOLHOziHgLmo/BdTBVrbRVKlH7XWXMctzIdtk+dAq7q0VD/0j7SYRIP/78Dym7 Qg== Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 3a3w8cr2pe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jul 2021 09:30:52 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16TDHMPv012915; Thu, 29 Jul 2021 13:30:51 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma01wdc.us.ibm.com with ESMTP id 3a2363f682-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jul 2021 13:30:51 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16TDUovC29950342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Jul 2021 13:30:50 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3700F136051; Thu, 29 Jul 2021 13:30:50 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB909136069; Thu, 29 Jul 2021 13:30:49 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 29 Jul 2021 13:30:49 +0000 (GMT) Subject: Re: [PATCH v2 4/4] ibmvtpm: Add support for trusted boot using a vTPM 2.0 To: Daniel Kiper , Stefan Berger Cc: grub-devel@gnu.org, Eric Snowberg References: <20210720211449.572356-1-stefanb@linux.vnet.ibm.com> <20210720211449.572356-5-stefanb@linux.vnet.ibm.com> <20210728132556.xxcu5ua3w6jekcro@tomti.i.net-space.pl> From: Stefan Berger Message-ID: <7c83a897-0694-e70c-f210-c70d9c81cbf5@linux.ibm.com> Date: Thu, 29 Jul 2021 09:30:49 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: <20210728132556.xxcu5ua3w6jekcro@tomti.i.net-space.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-GUID: z9SxP-24pzDu8NrJxBjiGXUchdPgaEHw X-Proofpoint-ORIG-GUID: z9SxP-24pzDu8NrJxBjiGXUchdPgaEHw Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-29_10:2021-07-29, 2021-07-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 adultscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107290084 Received-SPF: pass client-ip=148.163.156.1; envelope-from=stefanb@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.125, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2021 13:30:59 -0000 On 7/28/21 9:25 AM, Daniel Kiper wrote: > On Tue, Jul 20, 2021 at 05:14:49PM -0400, Stefan Berger wrote: > >> +#define IEEE1275_CELL_TRUE ((grub_ieee1275_cell_t) -1) > This smells like global constant. Does not it? If yes could you define it > in a global header and use it? Maybe even replace existing comparisons > in the IEEE1275 code with IEEE1275_CELL_TRUE. But probably then > s/IEEE1275_CELL_TRUE/GRUB_IEEE1275_CELL_TRUE/... I wasn't sure and also had found local #defines in another .c file. #define IEEE1275_PHANDLE_INVALID  ((grub_ieee1275_cell_t) -1) #define IEEE1275_IHANDLE_INVALID  ((grub_ieee1275_cell_t) 0) #define IEEE1275_CELL_INVALID     ((grub_ieee1275_cell_t) -1) https://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/kern/ieee1275/ieee1275.c#n24 I haven't seen the usage of -1 as TRUE in other grub files. So I could move it to a global header file assuming this is commonly used on this platform. I have only seen usage of -1 as TRUE in the SLOF firmware in this file here: https://github.com/aik/SLOF/blob/master/lib/libnvram/libnvram.code#L66 but then of course also here: https://github.com/aik/SLOF/blob/master/lib/libtpm/tcgbios.c#L965    Stefan