* [U-BOOT-TEST-HOOKS PATCH 1/1] Enable TPMv2 emulation
@ 2021-11-15 10:11 Heinrich Schuchardt
2021-11-24 7:23 ` Ilias Apalodimas
0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2021-11-15 10:11 UTC (permalink / raw)
To: Tom Rini, Stephen Warren
Cc: Tuomas Tynkkynen, Ilias Apalodimas, U-Boot Mailing List,
Heinrich Schuchardt
Provide a QEMU helper script to launch swtpm and add extra parameters to
conf.qemu_arm64_na and conf.qemu_arm_na to provide an emulated TPMv2.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
bin/qemu.swtpm | 19 +++++++++++++++++++
bin/travis-ci/conf.qemu_arm64_na | 3 ++-
bin/travis-ci/conf.qemu_arm_na | 3 ++-
3 files changed, 23 insertions(+), 2 deletions(-)
create mode 100755 bin/qemu.swtpm
diff --git a/bin/qemu.swtpm b/bin/qemu.swtpm
new file mode 100755
index 0000000..089feba
--- /dev/null
+++ b/bin/qemu.swtpm
@@ -0,0 +1,19 @@
+#!/bin/sh
+# SPDX-License-Identifier: BSD-2
+#
+# This script launches swtpm to emulate a TPMv2. The parameter -t makes it
+# unload when the connection to QEMU is terminated. To make use of it add
+#
+# qemu_helper_script="swtpm"
+#
+# to the board script and the following arguments to qemu_extra_args
+#
+# -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock \
+# -tpmdev emulator,id=tpm0,chardev=chrtpm \
+# -device tpm-tis-device,tpmdev=tpm0
+#
+# U-Boot must be built with CONFIG_TPM2_MMIO=y.
+
+mkdir -p /tmp/tpm
+swtpm socket -t --tpmstate dir=/tmp/tpm --tpm2 \
+--ctrl type=unixio,path=/tmp/tpm/swtpm-sock &
diff --git a/bin/travis-ci/conf.qemu_arm64_na b/bin/travis-ci/conf.qemu_arm64_na
index e7c9426..14577d8 100644
--- a/bin/travis-ci/conf.qemu_arm64_na
+++ b/bin/travis-ci/conf.qemu_arm64_na
@@ -22,8 +22,9 @@
console_impl=qemu
qemu_machine="virt"
+qemu_helper_script="swtpm"
qemu_binary="qemu-system-aarch64"
-qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
+qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.bin"
reset_impl=none
flash_impl=none
diff --git a/bin/travis-ci/conf.qemu_arm_na b/bin/travis-ci/conf.qemu_arm_na
index 0f07c80..de0694d 100644
--- a/bin/travis-ci/conf.qemu_arm_na
+++ b/bin/travis-ci/conf.qemu_arm_na
@@ -22,8 +22,9 @@
console_impl=qemu
qemu_machine="virt"
+qemu_helper_script="swtpm"
qemu_binary="qemu-system-arm"
-qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
+qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.bin"
reset_impl=none
flash_impl=none
--
2.32.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [U-BOOT-TEST-HOOKS PATCH 1/1] Enable TPMv2 emulation
2021-11-15 10:11 [U-BOOT-TEST-HOOKS PATCH 1/1] Enable TPMv2 emulation Heinrich Schuchardt
@ 2021-11-24 7:23 ` Ilias Apalodimas
2021-11-24 7:33 ` Heinrich Schuchardt
0 siblings, 1 reply; 5+ messages in thread
From: Ilias Apalodimas @ 2021-11-24 7:23 UTC (permalink / raw)
To: Heinrich Schuchardt
Cc: Tom Rini, Stephen Warren, Tuomas Tynkkynen, U-Boot Mailing List
Hi Heinrich,
On Mon, 15 Nov 2021 at 12:11, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> Provide a QEMU helper script to launch swtpm and add extra parameters to
> conf.qemu_arm64_na and conf.qemu_arm_na to provide an emulated TPMv2.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> bin/qemu.swtpm | 19 +++++++++++++++++++
> bin/travis-ci/conf.qemu_arm64_na | 3 ++-
> bin/travis-ci/conf.qemu_arm_na | 3 ++-
> 3 files changed, 23 insertions(+), 2 deletions(-)
> create mode 100755 bin/qemu.swtpm
>
> diff --git a/bin/qemu.swtpm b/bin/qemu.swtpm
> new file mode 100755
> index 0000000..089feba
> --- /dev/null
> +++ b/bin/qemu.swtpm
> @@ -0,0 +1,19 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: BSD-2
> +#
> +# This script launches swtpm to emulate a TPMv2. The parameter -t makes it
> +# unload when the connection to QEMU is terminated. To make use of it add
> +#
> +# qemu_helper_script="swtpm"
> +#
> +# to the board script and the following arguments to qemu_extra_args
> +#
> +# -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock \
> +# -tpmdev emulator,id=tpm0,chardev=chrtpm \
> +# -device tpm-tis-device,tpmdev=tpm0
> +#
> +# U-Boot must be built with CONFIG_TPM2_MMIO=y.
> +
> +mkdir -p /tmp/tpm
> +swtpm socket -t --tpmstate dir=/tmp/tpm --tpm2 \
> +--ctrl type=unixio,path=/tmp/tpm/swtpm-sock &
Nit pick the & can be '-d'
> diff --git a/bin/travis-ci/conf.qemu_arm64_na b/bin/travis-ci/conf.qemu_arm64_na
> index e7c9426..14577d8 100644
> --- a/bin/travis-ci/conf.qemu_arm64_na
> +++ b/bin/travis-ci/conf.qemu_arm64_na
> @@ -22,8 +22,9 @@
>
> console_impl=qemu
> qemu_machine="virt"
> +qemu_helper_script="swtpm"
> qemu_binary="qemu-system-aarch64"
> -qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
> +qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
> qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.bin"
> reset_impl=none
> flash_impl=none
> diff --git a/bin/travis-ci/conf.qemu_arm_na b/bin/travis-ci/conf.qemu_arm_na
> index 0f07c80..de0694d 100644
> --- a/bin/travis-ci/conf.qemu_arm_na
> +++ b/bin/travis-ci/conf.qemu_arm_na
> @@ -22,8 +22,9 @@
>
> console_impl=qemu
> qemu_machine="virt"
> +qemu_helper_script="swtpm"
> qemu_binary="qemu-system-arm"
> -qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
> +qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
Just a note here 'tpm-tis-device' works for arm. If we evenr need
this on x86 it's 'tpm-tis' ....
> qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.bin"
> reset_impl=none
> flash_impl=none
> --
> 2.32.0
>
Other than that
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [U-BOOT-TEST-HOOKS PATCH 1/1] Enable TPMv2 emulation
2021-11-24 7:23 ` Ilias Apalodimas
@ 2021-11-24 7:33 ` Heinrich Schuchardt
2021-11-27 1:38 ` Tom Rini
0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2021-11-24 7:33 UTC (permalink / raw)
To: Ilias Apalodimas
Cc: Tom Rini, Stephen Warren, Tuomas Tynkkynen, U-Boot Mailing List
On 11/24/21 08:23, Ilias Apalodimas wrote:
> Hi Heinrich,
>
> On Mon, 15 Nov 2021 at 12:11, Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>> Provide a QEMU helper script to launch swtpm and add extra parameters to
>> conf.qemu_arm64_na and conf.qemu_arm_na to provide an emulated TPMv2.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>> ---
>> bin/qemu.swtpm | 19 +++++++++++++++++++
>> bin/travis-ci/conf.qemu_arm64_na | 3 ++-
>> bin/travis-ci/conf.qemu_arm_na | 3 ++-
>> 3 files changed, 23 insertions(+), 2 deletions(-)
>> create mode 100755 bin/qemu.swtpm
>>
>> diff --git a/bin/qemu.swtpm b/bin/qemu.swtpm
>> new file mode 100755
>> index 0000000..089feba
>> --- /dev/null
>> +++ b/bin/qemu.swtpm
>> @@ -0,0 +1,19 @@
>> +#!/bin/sh
>> +# SPDX-License-Identifier: BSD-2
>> +#
>> +# This script launches swtpm to emulate a TPMv2. The parameter -t makes it
>> +# unload when the connection to QEMU is terminated. To make use of it add
>> +#
>> +# qemu_helper_script="swtpm"
>> +#
>> +# to the board script and the following arguments to qemu_extra_args
>> +#
>> +# -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock \
>> +# -tpmdev emulator,id=tpm0,chardev=chrtpm \
>> +# -device tpm-tis-device,tpmdev=tpm0
>> +#
>> +# U-Boot must be built with CONFIG_TPM2_MMIO=y.
>> +
>> +mkdir -p /tmp/tpm
>> +swtpm socket -t --tpmstate dir=/tmp/tpm --tpm2 \
>> +--ctrl type=unixio,path=/tmp/tpm/swtpm-sock &
>
> Nit pick the & can be '-d'
Daemonizing will ensure that we don't get console output. I will change
this.
>
>> diff --git a/bin/travis-ci/conf.qemu_arm64_na b/bin/travis-ci/conf.qemu_arm64_na
>> index e7c9426..14577d8 100644
>> --- a/bin/travis-ci/conf.qemu_arm64_na
>> +++ b/bin/travis-ci/conf.qemu_arm64_na
>> @@ -22,8 +22,9 @@
>>
>> console_impl=qemu
>> qemu_machine="virt"
>> +qemu_helper_script="swtpm"
>> qemu_binary="qemu-system-aarch64"
>> -qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
>> +qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
>> qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.bin"
>> reset_impl=none
>> flash_impl=none
>> diff --git a/bin/travis-ci/conf.qemu_arm_na b/bin/travis-ci/conf.qemu_arm_na
>> index 0f07c80..de0694d 100644
>> --- a/bin/travis-ci/conf.qemu_arm_na
>> +++ b/bin/travis-ci/conf.qemu_arm_na
>> @@ -22,8 +22,9 @@
>>
>> console_impl=qemu
>> qemu_machine="virt"
>> +qemu_helper_script="swtpm"
>> qemu_binary="qemu-system-arm"
>> -qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
>> +qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
>
> Just a note here 'tpm-tis-device' works for arm. If we evenr need
> this on x86 it's 'tpm-tis' ....
This file is ARM specific.
Best regards
Heinrich
>
>> qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.bin"
>> reset_impl=none
>> flash_impl=none
>> --
>> 2.32.0
>>
>
> Other than that
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [U-BOOT-TEST-HOOKS PATCH 1/1] Enable TPMv2 emulation
2021-11-24 7:33 ` Heinrich Schuchardt
@ 2021-11-27 1:38 ` Tom Rini
2021-11-27 10:46 ` Heinrich Schuchardt
0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2021-11-27 1:38 UTC (permalink / raw)
To: Heinrich Schuchardt
Cc: Ilias Apalodimas, Stephen Warren, Tuomas Tynkkynen, U-Boot Mailing List
[-- Attachment #1: Type: text/plain, Size: 3916 bytes --]
On Wed, Nov 24, 2021 at 08:33:42AM +0100, Heinrich Schuchardt wrote:
> On 11/24/21 08:23, Ilias Apalodimas wrote:
> > Hi Heinrich,
> >
> > On Mon, 15 Nov 2021 at 12:11, Heinrich Schuchardt
> > <heinrich.schuchardt@canonical.com> wrote:
> > >
> > > Provide a QEMU helper script to launch swtpm and add extra parameters to
> > > conf.qemu_arm64_na and conf.qemu_arm_na to provide an emulated TPMv2.
> > >
> > > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> > > ---
> > > bin/qemu.swtpm | 19 +++++++++++++++++++
> > > bin/travis-ci/conf.qemu_arm64_na | 3 ++-
> > > bin/travis-ci/conf.qemu_arm_na | 3 ++-
> > > 3 files changed, 23 insertions(+), 2 deletions(-)
> > > create mode 100755 bin/qemu.swtpm
> > >
> > > diff --git a/bin/qemu.swtpm b/bin/qemu.swtpm
> > > new file mode 100755
> > > index 0000000..089feba
> > > --- /dev/null
> > > +++ b/bin/qemu.swtpm
> > > @@ -0,0 +1,19 @@
> > > +#!/bin/sh
> > > +# SPDX-License-Identifier: BSD-2
> > > +#
> > > +# This script launches swtpm to emulate a TPMv2. The parameter -t makes it
> > > +# unload when the connection to QEMU is terminated. To make use of it add
> > > +#
> > > +# qemu_helper_script="swtpm"
> > > +#
> > > +# to the board script and the following arguments to qemu_extra_args
> > > +#
> > > +# -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock \
> > > +# -tpmdev emulator,id=tpm0,chardev=chrtpm \
> > > +# -device tpm-tis-device,tpmdev=tpm0
> > > +#
> > > +# U-Boot must be built with CONFIG_TPM2_MMIO=y.
> > > +
> > > +mkdir -p /tmp/tpm
> > > +swtpm socket -t --tpmstate dir=/tmp/tpm --tpm2 \
> > > +--ctrl type=unixio,path=/tmp/tpm/swtpm-sock &
> >
> > Nit pick the & can be '-d'
>
> Daemonizing will ensure that we don't get console output. I will change
> this.
>
> >
> > > diff --git a/bin/travis-ci/conf.qemu_arm64_na b/bin/travis-ci/conf.qemu_arm64_na
> > > index e7c9426..14577d8 100644
> > > --- a/bin/travis-ci/conf.qemu_arm64_na
> > > +++ b/bin/travis-ci/conf.qemu_arm64_na
> > > @@ -22,8 +22,9 @@
> > >
> > > console_impl=qemu
> > > qemu_machine="virt"
> > > +qemu_helper_script="swtpm"
> > > qemu_binary="qemu-system-aarch64"
> > > -qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
> > > +qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
> > > qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.bin"
> > > reset_impl=none
> > > flash_impl=none
> > > diff --git a/bin/travis-ci/conf.qemu_arm_na b/bin/travis-ci/conf.qemu_arm_na
> > > index 0f07c80..de0694d 100644
> > > --- a/bin/travis-ci/conf.qemu_arm_na
> > > +++ b/bin/travis-ci/conf.qemu_arm_na
> > > @@ -22,8 +22,9 @@
> > >
> > > console_impl=qemu
> > > qemu_machine="virt"
> > > +qemu_helper_script="swtpm"
> > > qemu_binary="qemu-system-arm"
> > > -qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
> > > +qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
> >
> > Just a note here 'tpm-tis-device' works for arm. If we evenr need
> > this on x86 it's 'tpm-tis' ....
>
> This file is ARM specific.
Sure, but it's worth noting since if we can also use these features and
tests on qemu-x86_64 we should. Doesn't need to be to start with tho.
And I will apply this shortly.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [U-BOOT-TEST-HOOKS PATCH 1/1] Enable TPMv2 emulation
2021-11-27 1:38 ` Tom Rini
@ 2021-11-27 10:46 ` Heinrich Schuchardt
0 siblings, 0 replies; 5+ messages in thread
From: Heinrich Schuchardt @ 2021-11-27 10:46 UTC (permalink / raw)
To: Tom Rini
Cc: Ilias Apalodimas, Stephen Warren, Tuomas Tynkkynen,
U-Boot Mailing List, Simon Glass
On 11/27/21 02:38, Tom Rini wrote:
> On Wed, Nov 24, 2021 at 08:33:42AM +0100, Heinrich Schuchardt wrote:
>> On 11/24/21 08:23, Ilias Apalodimas wrote:
>>> Hi Heinrich,
>>>
>>> On Mon, 15 Nov 2021 at 12:11, Heinrich Schuchardt
>>> <heinrich.schuchardt@canonical.com> wrote:
>>>>
>>>> Provide a QEMU helper script to launch swtpm and add extra parameters to
>>>> conf.qemu_arm64_na and conf.qemu_arm_na to provide an emulated TPMv2.
>>>>
>>>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>>>> ---
>>>> bin/qemu.swtpm | 19 +++++++++++++++++++
>>>> bin/travis-ci/conf.qemu_arm64_na | 3 ++-
>>>> bin/travis-ci/conf.qemu_arm_na | 3 ++-
>>>> 3 files changed, 23 insertions(+), 2 deletions(-)
>>>> create mode 100755 bin/qemu.swtpm
>>>>
>>>> diff --git a/bin/qemu.swtpm b/bin/qemu.swtpm
>>>> new file mode 100755
>>>> index 0000000..089feba
>>>> --- /dev/null
>>>> +++ b/bin/qemu.swtpm
>>>> @@ -0,0 +1,19 @@
>>>> +#!/bin/sh
>>>> +# SPDX-License-Identifier: BSD-2
>>>> +#
>>>> +# This script launches swtpm to emulate a TPMv2. The parameter -t makes it
>>>> +# unload when the connection to QEMU is terminated. To make use of it add
>>>> +#
>>>> +# qemu_helper_script="swtpm"
>>>> +#
>>>> +# to the board script and the following arguments to qemu_extra_args
>>>> +#
>>>> +# -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock \
>>>> +# -tpmdev emulator,id=tpm0,chardev=chrtpm \
>>>> +# -device tpm-tis-device,tpmdev=tpm0
>>>> +#
>>>> +# U-Boot must be built with CONFIG_TPM2_MMIO=y.
>>>> +
>>>> +mkdir -p /tmp/tpm
>>>> +swtpm socket -t --tpmstate dir=/tmp/tpm --tpm2 \
>>>> +--ctrl type=unixio,path=/tmp/tpm/swtpm-sock &
>>>
>>> Nit pick the & can be '-d'
>>
>> Daemonizing will ensure that we don't get console output. I will change
>> this.
>>
>>>
>>>> diff --git a/bin/travis-ci/conf.qemu_arm64_na b/bin/travis-ci/conf.qemu_arm64_na
>>>> index e7c9426..14577d8 100644
>>>> --- a/bin/travis-ci/conf.qemu_arm64_na
>>>> +++ b/bin/travis-ci/conf.qemu_arm64_na
>>>> @@ -22,8 +22,9 @@
>>>>
>>>> console_impl=qemu
>>>> qemu_machine="virt"
>>>> +qemu_helper_script="swtpm"
>>>> qemu_binary="qemu-system-aarch64"
>>>> -qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
>>>> +qemu_extra_args="-cpu cortex-a57 -nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
>>>> qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.bin"
>>>> reset_impl=none
>>>> flash_impl=none
>>>> diff --git a/bin/travis-ci/conf.qemu_arm_na b/bin/travis-ci/conf.qemu_arm_na
>>>> index 0f07c80..de0694d 100644
>>>> --- a/bin/travis-ci/conf.qemu_arm_na
>>>> +++ b/bin/travis-ci/conf.qemu_arm_na
>>>> @@ -22,8 +22,9 @@
>>>>
>>>> console_impl=qemu
>>>> qemu_machine="virt"
>>>> +qemu_helper_script="swtpm"
>>>> qemu_binary="qemu-system-arm"
>>>> -qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci"
>>>> +qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci -chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis-device,tpmdev=tpm0"
>>>
>>> Just a note here 'tpm-tis-device' works for arm. If we evenr need
>>> this on x86 it's 'tpm-tis' ....
>>
>> This file is ARM specific.
>
> Sure, but it's worth noting since if we can also use these features and
> tests on qemu-x86_64 we should. Doesn't need to be to start with tho.
> And I will apply this shortly.
>
The current version of this patch is:
[v2,1/1] Enable TPMv2 emulation
https://patchwork.ozlabs.org/project/uboot/patch/20211124081251.59511-1-heinrich.schuchardt@canonical.com/
On x86 we don't have support for the emulated TPM in U-Boot. According
to the QEMU documentation you would have to parse ACPI tables to detect
if a TPM is made available by QEMU. Maybe you could instead define it in
arch/x86/dts/qemu-x86_i440fx.dts.
Cf. https://qemu-project.gitlab.io/qemu/specs/tpm.html#acpi-interface
Once that work is done we should enable the TPM emulation on x86 in the
U-Boot test hooks.
This will be the required settings:
qemu_helper_script="swtpm"
qemu_extra_args="-nographic -cpu qemu64 -netdev
user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0
-chardev socket,id=chrtpm,path=/tmp/tpm/swtpm-sock -tpmdev
emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0"
Best regards
Heinrich
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-11-27 10:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 10:11 [U-BOOT-TEST-HOOKS PATCH 1/1] Enable TPMv2 emulation Heinrich Schuchardt
2021-11-24 7:23 ` Ilias Apalodimas
2021-11-24 7:33 ` Heinrich Schuchardt
2021-11-27 1:38 ` Tom Rini
2021-11-27 10:46 ` Heinrich Schuchardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.