From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7649AC433F5 for ; Sun, 7 Nov 2021 10:55:02 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4CDED6108E for ; Sun, 7 Nov 2021 10:55:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4CDED6108E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 89D0E837CE; Sun, 7 Nov 2021 11:54:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="BydlaHXc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9B74D837CF; Sun, 7 Nov 2021 11:54:56 +0100 (CET) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 03901837CC for ; Sun, 7 Nov 2021 11:54:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1636282467; bh=HXXy/dNtNyNwcV4pq/w1GnAlk9KsgC+Ufa/GZxPR4II=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=BydlaHXcvpocElRHtUAOO+4pnovnHDmugn6E7NSfIhKuixTenCX9FoWDkh7MZnftg +zMaLTNC4DhlkxrJONmiwWYNa9qdDMh104MnZSrDsawQo2SyUD6y6yqpch51KZhS6W lpAr9Qwhqm8oRbEI/B6UvUMoilZ53frxAzKR7IMc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.35] ([88.152.144.157]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MHXBp-1mwXys1oIL-00Dbmf; Sun, 07 Nov 2021 11:54:27 +0100 Message-ID: <35e47ac9-84d8-dac9-cb56-3f6d4681269f@gmx.de> Date: Sun, 7 Nov 2021 11:54:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH 0/6 v5] TPM cleanups and MMIO driver Content-Language: en-US To: Ilias Apalodimas Cc: trini@konsulko.com, Rick Chen , Sean Anderson , Simon Glass , Masahisa Kojima , u-boot@lists.denx.de References: <20211105190517.233079-1-ilias.apalodimas@linaro.org> From: Heinrich Schuchardt In-Reply-To: <20211105190517.233079-1-ilias.apalodimas@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:RDhfOkFxAJJwMPrXNdWPrQmBPQUZvVQUumxICmBWI60WUFk9MrE I0OF215enRZxjXrs4qcb3xj7bXEvAQJ8GfGsdJTMRYmpvf833IiMmY7KDfKOZPIWtafKm9T ziEHafxjo/C3NyBqacwkCILa/co91NYpk+WbjxB6bdJfw9mpQLq4+cnhUxH3X3z6gn0dyB1 yZGsN5/F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GpC214NI9cbBEwtS XFOSkg1EL66QSbIrzWGNbHlG0C5D3YvMEZnmLFpsycXqB6bDcsQYMheYHXyu6whDPW5CJqTim gQXbPanspKRPbE= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 11/5/21 20:05, Ilias Apalodimas wrote: > Hi! > This is the update for [1]. > > Changes since v4: > - renamed struct udevice *udev -> struct udevice *dev > - added comments on struct tpm_tis_phy_ops > - removed duplicate defines from tpm2_tis_spi driver (now in tpm_tis.h) > - moved API function description for the .c to the .h file > - added Reviewed-by tags from Simon and Heinrich > Changes since v3: > - Coverted SPI TPM to use the API as well > - moved some log_info to log_debug > - Added documentation on how to run QEMU and enabled TPM by default o > arm qemu builds > Changes since v2: > - Add myself as a maintainer on TPM drivers > Changes since v1: > - split off the tis core code into a different file > I am running qemu_arm64_defconfig puls CONFIG_CMD_TPM=3Dy with this series applied: swtpm socket \ =2D-tpmstate dir=3D/tmp/mytpm1 \ =2D-ctrl type=3Dunixio,path=3D/tmp/mytpm1/swtpm-sock (swtpm version 6.1, libtpms version 0.8.2-1ubuntu1) qemu-system-aarch64 -machine virt -m 1G -smp cores=3D2 -bios u-boot.bin -cpu cortex-a53 -nographic -gdb tcp::1234 -netdev user,id=3Deth0,tftp=3Dtf= tp -device e1000,netdev=3Deth0 -device virtio-rng-pci -chardev socket,id=3Dchrtpm,path=3D/tmp/mytpm1/swtpm-sock -tpmdev emulator,id=3Dtpm0,chardev=3Dchrtpm -device tpm-tis-device,tpmdev=3Dtpm0 =3D> tpm2 info tpm_tis@0 v2.0: VendorID 0x1014, DeviceID 0x0001, RevisionID 0x01 [closed] =3D> bootefi hello Found 0 disks No EFI system partition Cannot install EFI_TCG2_PROTOCOL tpm2_get_capability(dev, TPM2_CAP_PCRS, 0, response, 1); returns 10. Why does the the TPM emulation fail? Best regards Heinrich > Ilias Apalodimas (6): > tpm2: Introduce TIS tpm core > tpm2: Add a TPMv2 MMIO TIS driver > tpm: Use the new API on tpm2 spi driver > configs: Enable tpmv2 mmio on qemu for arm/arm64 > doc: qemu: Add instructions for swtpm usage > MAINTAINERS: Add entry for TPM drivers > > [1] https://lore.kernel.org/u-boot/20211103150910.69732-1-ilias.apalodim= as@linaro.org/ > > Ilias Apalodimas (6): > tpm2: Introduce TIS tpm core > tpm2: Add a TPMv2 MMIO TIS driver > tpm: Use the new API on tpm2 spi driver > configs: Enable tpmv2 mmio on qemu for arm/arm64 > doc: qemu: Add instructions for swtpm usage > MAINTAINERS: Add entry for TPM drivers > > MAINTAINERS | 5 + > configs/qemu_arm64_defconfig | 2 + > configs/qemu_arm_defconfig | 2 + > doc/board/emulation/qemu-arm.rst | 25 ++ > drivers/tpm/Kconfig | 9 + > drivers/tpm/Makefile | 3 +- > drivers/tpm/tpm2_tis_core.c | 463 +++++++++++++++++++++++++++++++ > drivers/tpm/tpm2_tis_mmio.c | 152 ++++++++++ > drivers/tpm/tpm2_tis_spi.c | 447 +++-------------------------- > drivers/tpm/tpm_tis.h | 128 +++++++++ > include/tpm-v2.h | 1 + > 11 files changed, 820 insertions(+), 417 deletions(-) > create mode 100644 drivers/tpm/tpm2_tis_core.c > create mode 100644 drivers/tpm/tpm2_tis_mmio.c >