aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu_2.10.1.bb
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-12-06 12:03:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-10 22:41:43 +0000
commit82f37aa4c5152f104897fff04f09ad55c20c2a3f (patch)
tree1f12cceb9390f7d3715d2d9cfbeaecfbcedf1e51 /meta/recipes-devtools/qemu/qemu_2.10.1.bb
parentd9b59df1230a20c7a5c9f4fb0325bb9216025a16 (diff)
downloadopenembedded-core-contrib-82f37aa4c5152f104897fff04f09ad55c20c2a3f.tar.gz
qemu: use upstream swtpm support
Upstream finally accepted and merged a different approach for connecting QEMU to swtpm: instead of a custom cuse-tpm device, a normal chardev connects to swtpm, and that chardev then is used by the TPM device. For now we have to backport those patches, but the next major QEMU update will have them. However, the chardev-connect-socket-to-a-spawned-command.patch is something that OE will have to carry permanently. It simplifies starting and stopping swtpm when invoking QEMU through runqemu without having to teach that script about the additional process. Upstream rejected the patch because they want to keep the complexity of starting additional processes out of QEMU. A recent enough swtpm is needed. The one currently used by meta-security fails to communicate properly with QEMU, leading to this failure: qemu-system-x86_64: -tpmdev emulator,id=tpm0,chardev=chrtpm0: tpm-emulator: Failed to send CMD_SET_DATAFD: Input/output error qemu-system-x86_64: -tpmdev emulator,id=tpm0,chardev=chrtpm0: tpm-emulator: Could not cleanly shutdown the TPM: Invalid argument With a recent enough swtpm, one can create a TPM device like this: - bitbake swtpm-native - create a TPM instance and initialize it with: $ mkdir -p my-machine/myvtpm0 $ tmp*/work/*/swtpm-wrappers-native/*/swtpm_setup_oe.sh --tpm-state my-machine/myvtpm0 --createek Starting vTPM manufacturing as root:root @ Wed 06 Dec 2017 10:03:14 AM CET TPM is listening on TCP port 34613. Successfully created EK. Successfully authored TPM state. Ending vTPM manufacturing @ Wed 06 Dec 2017 10:03:14 AM CET - runqemu "qemuparams=-chardev 'socket,id=chrtpm0,cmd=exec swtpm_oe.sh socket --terminate --ctrl type=unixio,,clientfd=0 --tpmstate dir=... --log level=10,,file=.../swtpm.log --tpm2' -tpmdev emulator,id=tpm0,chardev=chrtpm0 -device tpm-tis,tpmdev=tpm0" ... Beware that the double commas are intentional. They are needed to embed commas in the "cmd" value. swtpm_oe.sh is from swtpm-wrappers-native. In the example it is invoked without the full path for the sake of brevity. In practice, one has to use the full path (tmp*/work/*/swtpm-wrappers-native/*/swtpm_oe.sh). With the TPM2-preview version of swtpm, the same works for TPM2 by adding the --tpm2 parameter when invoking swtpm_setup_oe.sh and swtpm_oe.sh. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu_2.10.1.bb')
-rw-r--r--meta/recipes-devtools/qemu/qemu_2.10.1.bb17
1 files changed, 13 insertions, 4 deletions
diff --git a/meta/recipes-devtools/qemu/qemu_2.10.1.bb b/meta/recipes-devtools/qemu/qemu_2.10.1.bb
index 5ac221c9ed..71cc74ebc7 100644
--- a/meta/recipes-devtools/qemu/qemu_2.10.1.bb
+++ b/meta/recipes-devtools/qemu/qemu_2.10.1.bb
@@ -19,10 +19,19 @@ SRC_URI = "http://wiki.qemu-project.org/download/${BP}.tar.bz2 \
file://pathlimit.patch \
file://qemu-2.5.0-cflags.patch \
file://glibc-2.25.patch \
- file://0001-Provide-support-for-the-CUSE-TPM.patch \
- file://0002-Introduce-condition-to-notify-waiters-of-completed-c.patch \
- file://0003-Introduce-condition-in-TPM-backend-for-notification.patch \
- file://0004-Add-support-for-VM-suspend-resume-for-TPM-TIS-v2.9.patch \
+ file://0001-tpm-Clean-up-driver-registration-lookup.patch \
+ file://0002-tpm-Clean-up-model-registration-lookup.patch \
+ file://0003-tpm-backend-Remove-unneeded-member-variable-from-bac.patch \
+ file://0004-tpm-backend-Move-thread-handling-inside-TPMBackend.patch \
+ file://0005-tpm-backend-Initialize-and-free-data-members-in-it-s.patch \
+ file://0006-tpm-backend-Made-few-interface-methods-optional.patch \
+ file://0007-tpm-backend-Add-new-api-to-read-backend-TpmInfo.patch \
+ file://0008-tpm-backend-Move-realloc_buffer-implementation-to-tp.patch \
+ file://0009-tpm-passthrough-move-reusable-code-to-utils.patch \
+ file://0010-tpm-Added-support-for-TPM-emulator.patch \
+ file://0011-tpm-Move-tpm_cleanup-to-right-place.patch \
+ file://0012-tpm-Use-EMSGSIZE-instead-of-EBADMSG-to-compile-on-Op.patch \
+ file://chardev-connect-socket-to-a-spawned-command.patch \
file://apic-fixup-fallthrough-to-PIC.patch \
file://ppc_locking.patch \
"