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 66F98C433EF for ; Fri, 5 Nov 2021 02:06:57 +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 E5F2B60E97 for ; Fri, 5 Nov 2021 02:06:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E5F2B60E97 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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 A99A183746; Fri, 5 Nov 2021 03:05:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CJOFWKsm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A43C283711; Fri, 5 Nov 2021 03:03:54 +0100 (CET) Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D52D583736 for ; Fri, 5 Nov 2021 03:03:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ot1-x332.google.com with SMTP id g91-20020a9d12e4000000b0055ae68cfc3dso8271157otg.9 for ; Thu, 04 Nov 2021 19:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rPhVsjNOGKPfhQDXRKxBpNayKphSewDIIUj3zkszfW0=; b=CJOFWKsmRmj0QUqUIabMXOOg/Oo+kxWfXHDMW9L14fgf0aiF7ta+lQ0W51yPVDBXGl IpdDMAb9cjasqab9YcfkLsvNv8FV/N2w2+BJFs83+5rbnE+Sdr1x58pTIOw4aPZKX4hi NmUpLumecl7r9zrfbD1rlGD+Q8c5vJ0320TZ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rPhVsjNOGKPfhQDXRKxBpNayKphSewDIIUj3zkszfW0=; b=S+bWinM1M4r+YkKHfboQtKLUg86bqtM0jOWeQIsiUlNz898qErTv7dR1AK7kyaUxHb Jsk7OAuAIk4wKMnAom8Sk/nzC9NptBWXP2Mo0LKZZEh5NBUxcP1SQe8cVrqZ+oWaXaEx vFZkPmziuIn5peTivdXrKvotk8pRAVINB99M5R3YVTa53TJSv5yC+mg4TfvY9Bqt6cXt MR+WWfFpP/cbjKIYezivOMndP6z8jKErbuEF4KuSyYacyNckfs5cVZaMFUEAVkuri4Xi ZcL3hHK09Vr2z+zhjNWV3AxTX+V/djL9QOV7FSzCB/D2fNOSRbSVF8qvl9dj5xlNnj29 kqDA== X-Gm-Message-State: AOAM532uILbO2TvFDd3MBLQZPIZI1081GJsz0qmXgdU+EeDQbGkg7Aru tX1Mtu2K6hl/iNsArHasaqlmqfE/2Xefv9F7/klxzQ== X-Google-Smtp-Source: ABdhPJxn7iA1kBy0zaseKXtKSGms9j5VvofNlqShr9s0uZk7ch/2qkjWP0efN8mtsF2dNpiX8gTY3HqBlQrRhkGo5FY= X-Received: by 2002:a9d:37e3:: with SMTP id x90mr35577811otb.11.1636077803091; Thu, 04 Nov 2021 19:03:23 -0700 (PDT) MIME-Version: 1.0 References: <20211103150910.69732-1-ilias.apalodimas@linaro.org> <20211103150910.69732-6-ilias.apalodimas@linaro.org> In-Reply-To: <20211103150910.69732-6-ilias.apalodimas@linaro.org> From: Simon Glass Date: Thu, 4 Nov 2021 20:02:23 -0600 Message-ID: Subject: Re: [PATCH 5/6 v4] doc: qemu: Add instructions for swtpm usage To: Ilias Apalodimas Cc: u-boot@lists.denx.de, trini@konsulko.com, Rick Chen , Sean Anderson , Heinrich Schuchardt , Masahisa Kojima Content-Type: text/plain; charset="UTF-8" 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 Wed, 3 Nov 2021 at 09:09, Ilias Apalodimas wrote: > > A previous patch added support for an mmio based TPM. > Add an example in QEMU on it's usage > > Signed-off-by: Ilias Apalodimas > --- > doc/board/emulation/qemu-arm.rst | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > Reviewed-by: Simon Glass Any particular QEMU version? We should enable this in CI. > diff --git a/doc/board/emulation/qemu-arm.rst b/doc/board/emulation/qemu-arm.rst > index 8d7fda10f15e..584ef0a7e150 100644 > --- a/doc/board/emulation/qemu-arm.rst > +++ b/doc/board/emulation/qemu-arm.rst > @@ -81,6 +81,31 @@ can be enabled with the following command line parameters: > > These have been tested in QEMU 2.9.0 but should work in at least 2.5.0 as well. > > +Enabling TPMv2 support > +---------------------- > + > +To emulate a TPM the swtpm package may be used. It can be built from the > +following repositories: > + > + https://github.com/stefanberger/swtpm.git > + > +Swtpm provides a socket for the TPM emulation which can be consumed by QEMU. > + > +In a first console invoke swtpm with:: > + > + swtpm socket --tpmstate dir=/tmp/mytpm1 \ > + --ctrl type=unixio,path=/tmp/mytpm1/swtpm-sock --log level=20 > + > +In a second console invoke qemu-system-aarch64 with:: > + > + -chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \ > + -tpmdev emulator,id=tpm0,chardev=chrtpm \ > + -device tpm-tis-device,tpmdev=tpm0 > + > +Enable the TPM on U-Boot's command line with:: > + > + tpm2 startup TPM2_SU_CLEAR > + > Debug UART > ---------- > > -- > 2.33.1 > Regards, Simon