Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1318BC54EBC for ; Tue, 10 Jan 2023 22:11:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB2B28540D; Tue, 10 Jan 2023 23:11:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.b="ak6oe/7+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 889CA855CD; Tue, 10 Jan 2023 23:11:20 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7A8488540C for ; Tue, 10 Jan 2023 23:11:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eajames@linux.ibm.com Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30AKL7VV021162; Tue, 10 Jan 2023 22:11:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=wtDcaplSAYUgGNRb9mC04CIoVrSx1VwWyzYevEnSq60=; b=ak6oe/7+J2BFbPUmGqqMvP0M1LKYDdUe/gJPtMLScs274lJevPBP3GxUrunukTQfXfCN RCOxn+/14m+Mp+42LfhuJHQVnl9X38hKtJM9y82FuqiZE+hQyuBDJea/wbHGGWgNRuuG ohKtebswidbLtK0CIIMDuxXm3UEz6JoAZ2WMBKbACQqlHjpAnNoTScJtfy0EWnL3A01N CCkWSNZ1lStS8N2SxrIjOZdfKD2DrJ4hCeg3CgAqW2D2koF9sBGpiOqXcQtyyWxOUcwm AdGV3zLamCEwrDO3zotjUsVDm2hYZEmeSdkWs6q6C7yM3nDtyHVTGF9rYhkEJ2JmkTR7 PA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3n1eyrtb9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 22:11:13 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 30ALqtvW004721; Tue, 10 Jan 2023 22:11:13 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 3n1eyrtb8w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 22:11:13 +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 30AJBOQX010650; Tue, 10 Jan 2023 22:11:11 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([9.208.130.99]) by ppma03wdc.us.ibm.com (PPS) with ESMTPS id 3my0c7c7p7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Jan 2023 22:11:11 +0000 Received: from smtpav06.wdc07v.mail.ibm.com (smtpav06.wdc07v.mail.ibm.com [10.39.53.233]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30AMBAMf20382380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 22:11:11 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA0865805A; Tue, 10 Jan 2023 22:11:10 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F9AD5804E; Tue, 10 Jan 2023 22:11:10 +0000 (GMT) Received: from [9.65.226.208] (unknown [9.65.226.208]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 10 Jan 2023 22:11:09 +0000 (GMT) Message-ID: Date: Tue, 10 Jan 2023 16:11:09 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement Content-Language: en-US To: Heinrich Schuchardt Cc: ilias.apalodimas@linaro.org, sjg@chromium.org, u-boot@lists.denx.de References: <20230109215525.79046-1-eajames@linux.ibm.com> <20230109215525.79046-6-eajames@linux.ibm.com> <4192c9f7-6b8a-4d94-150f-d48e2be364cf@linux.ibm.com> <9faae166-193f-1c9e-d045-6350e99f943f@gmx.de> From: Eddie James In-Reply-To: <9faae166-193f-1c9e-d045-6350e99f943f@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed X-TM-AS-GCONF: 00 X-Proofpoint-GUID: b-DCcmSIN0MJJY-1tXJcZK8Yjgml44O0 X-Proofpoint-ORIG-GUID: s_cuN2mxc-nQg5ZTtDdlpWyl3gdKmp5O 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.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-10_09,2023-01-10_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 clxscore=1015 phishscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=863 impostorscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100145 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 1/10/23 16:02, Heinrich Schuchardt wrote: > On 1/10/23 17:38, Eddie James wrote: >> >> On 1/9/23 17:26, Heinrich Schuchardt wrote: >>> On 1/10/23 00:13, Heinrich Schuchardt wrote: >>>> On 1/9/23 22:55, Eddie James wrote: >>>>> Use the sandbox TPM driver to measure some boot images in a unit >>>>> test case. >>>>> >>>>> $ ./u-boot -T -c "ut measurement" >>>>> Running 1 measurement tests >>>>> Test: measure: measurement.c >>>>> Failures: 0 >>>>> >>>>> Signed-off-by: Eddie James >>>>> --- >>>>>   arch/sandbox/dts/test.dts | 12 +++++++ >>>>>   configs/sandbox_defconfig |  1 + >>>>>   include/test/suites.h     |  1 + >>>>>   test/boot/Makefile        |  1 + >>>>>   test/boot/measurement.c   | 66 >>>>> +++++++++++++++++++++++++++++++++++++++ >>>>>   test/cmd_ut.c             |  2 ++ >>>>>   6 files changed, 83 insertions(+) >>>>>   create mode 100644 test/boot/measurement.c >>>>> >>>>> diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts >>>>> index dffe10adbf..ad90bf0541 100644 >>>>> --- a/arch/sandbox/dts/test.dts >>>>> +++ b/arch/sandbox/dts/test.dts >>>>> @@ -66,6 +66,17 @@ >>>>>           osd0 = "/osd"; >>>>>       }; >>>>> >>>>> +    reserved-memory { >>>>> +        #address-cells = <1>; >>>>> +        #size-cells = <1>; >>>>> +        ranges; >>>>> + >>>>> +        event_log: tcg_event_log@d0e000 { >>>>> +            no-map; >>>>> +            reg = <0x00d0e000 0x2000>; >>> >>> How should this work if you don't define linux,sml-base and >>> linux,sml-size? >> >> >> I have sent a patch to the linux list for using a reserved memory >> region, as I have also added in the u-boot TPM layer for the event log. >> >> https://patchwork.kernel.org/project/linux-integrity/patch/20230103162010.381214-1-eajames@linux.ibm.com/ >> > > Thank you for the clarification. > > The kernel patch seems to need rework: > https://lore.kernel.org/all/202301040834.YsMHDMpw-lkp@intel.com/ Yes I'll address that. > > Shouldn't the sandbox device-tree support these properties? This will > allow us to write a test application that the sandbox can run via > booti/bootz (depending on bitness) and bootm. This test application can > retrieve the event log and print it via Linux system calls. OK, I can add it to the main sandbox device-tree as well then. It is added to the sandbox test device-tree, used by the unit test case I added. Thanks, Eddie > > Best regards > > Heinrich