[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 10/12] hw/arm: introduce xenpv machine
From: |
Alex Bennée |
Subject: |
Re: [PATCH v1 10/12] hw/arm: introduce xenpv machine |
Date: |
Thu, 27 Oct 2022 09:02:54 +0100 |
User-agent: |
mu4e 1.9.1; emacs 28.2.50 |
Vikram Garhwal <vikram.garhwal@amd.com> writes:
<snip>
> Optional: When CONFIG_TPM is enabled, it also creates a tpm-tis-device, adds a
> TPM emulator and connects to swtpm running on host machine via chardev socket
> and support TPM functionalities for a guest domain.
>
> Extra command line for aarch64 xenpv QEMU to connect to swtpm:
> -chardev socket,id=chrtpm,path=/tmp/myvtpm2/swtpm-sock \
> -tpmdev emulator,id=tpm0,chardev=chrtpm \
>
> swtpm implements a TPM software emulator(TPM 1.2 & TPM 2) built on libtpms and
> provides access to TPM functionality over socket, chardev and CUSE interface.
> Github repo: https://github.com/stefanberger/swtpm
> Example for starting swtpm on host machine:
> mkdir /tmp/vtpm2
> swtpm socket --tpmstate dir=/tmp/vtpm2 \
> --ctrl type=unixio,path=/tmp/vtpm2/swtpm-sock &
<snip>
> +static void xen_enable_tpm(void)
> +{
> +/* qemu_find_tpm_be is only available when CONFIG_TPM is enabled. */
> +#ifdef CONFIG_TPM
> + Error *errp = NULL;
> + DeviceState *dev;
> + SysBusDevice *busdev;
> +
> + TPMBackend *be = qemu_find_tpm_be("tpm0");
> + if (be == NULL) {
> + DPRINTF("Couldn't fine the backend for tpm0\n");
> + return;
> + }
> + dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
> + object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
> + object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
> + busdev = SYS_BUS_DEVICE(dev);
> + sysbus_realize_and_unref(busdev, &error_fatal);
> + sysbus_mmio_map(busdev, 0, GUEST_TPM_BASE);
I'm not sure what has gone wrong here but I'm getting:
../../hw/arm/xen_arm.c: In function ‘xen_enable_tpm’:
../../hw/arm/xen_arm.c:120:32: error: ‘GUEST_TPM_BASE’ undeclared (first use
in this function); did you mean ‘GUEST_RAM_BASE’?
120 | sysbus_mmio_map(busdev, 0, GUEST_TPM_BASE);
| ^~~~~~~~~~~~~~
| GUEST_RAM_BASE
../../hw/arm/xen_arm.c:120:32: note: each undeclared identifier is reported
only once for each function it appears in
In my cross build:
# Configured with: '../../configure' '--disable-docs'
'--target-list=aarch64-softmmu' '--disable-kvm' '--enable-xen'
'--disable-opengl' '--disable-libudev' '--enable-tpm'
'--disable-xen-pci-passthrough' '--cross-prefix=aarch64-linux-gnu-'
'--skip-meson'
which makes me wonder if this is a configure failure or a confusion
about being able to have host swtpm implementations during emulation but
needing target tpm for Xen?
--
Alex Bennée
Re: [PATCH v1 10/12] hw/arm: introduce xenpv machine,
Alex Bennée <=
Re: [PATCH v1 10/12] hw/arm: introduce xenpv machine, Alex Bennée, 2022/10/27
[PATCH v1 06/12] xen-hvm: move common functions to hw/xen/xen-hvm-common.c, Vikram Garhwal, 2022/10/15
[PATCH v1 12/12] meson.build: do not set have_xen_pci_passthrough for aarch64 targets, Vikram Garhwal, 2022/10/15
[PATCH v1 01/12] hw/xen: Correct build config for xen_pt_stub, Vikram Garhwal, 2022/10/15