|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 4/4] libxl: Add emulated TPM support on ARM
Hi Jason,
> QEMU's ARM "xenpvh" machine runs as an IOREQ server and, when given a
> "tpm-base-addr" machine property, instantiates a TPM TIS sysbus device
> at that address connected to the "tpm0" TPM backend. Hook the existing
Could you add a comment in the code about "tpm0"? To me, "tpm0" in the
previous patch is just a random string internal to libxl, which could be
change.
> tpm_* configuration up to it so ARM guests can use an swtpm-backed TPM.
>
> Reserve GUEST_TPM_BASE/GUEST_TPM_SIZE in the ARM guest memory map and
> add a "tcg,tpm-tis-mmio" node to the guest device tree when a TPM
> version is configured. The xenpvh machine has no CRB device, so TIS is
> the default and only interface allowed for both TPM 1.2 and 2.0.
>
> Add libxl__arch_pv_pvh_machinearg() returning the QEMU -machine argument
> for a PV/PVH guest. x86 returns plain "xenpv", while ARM uses "xenpvh"
"xenpv" and "xenpvh" aren't equivalent machine. And, they aren't arch
specific. Both exist on both x86 and ARM and have different purpose.
I think all the PV backend are only available on "xenpv", and are
missing on "xenpvh". Feel free to check and tell me I'm wrong, as I'm
not completely certain.
> and appends tpm-base-addr when a TPM is configured. uint64_t tpm_base
> in ARM's libxl__arch_pvh_machinearg() is to allow PRIx64 to print the
> value. Otherwise the ull argument mismatches PRIx64's %lx format.
>
> libxl__arch_pv_pvh_machinearg() also handles PV guests. This keeps the
> extra_pv handling identical between PV and PVH guests.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> [ Merge ARM parts with new libxl_dm implementation. ]
> Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
>
> diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
> index c12d2dc4db89..e5952d7e27c6 100644
> --- a/docs/man/xl.cfg.5.pod.in
> +++ b/docs/man/xl.cfg.5.pod.in
> @@ -823,11 +823,16 @@ value is optional if this is a guest domain.
>
> =item B<tpm_version=NUMBER>
>
> -Provides an emulated TPM to a QEMU-based HVM guest, backed by B<swtpm(8)>.
> -The TPM version to emulate is either B<1> for TPM 1.2 or B<2> for TPM 2.0.
> +Provides an emulated TPM to a QEMU-based HVM guest, or to an Arm guest,
> +backed by B<swtpm(8)>. The TPM version to emulate is either B<1> for
> +TPM 1.2 or B<2> for TPM 2.0.
> When this option is not specified, no TPM is provided and the other
> B<tpm_*> options are ignored.
>
> +On Arm, QEMU's B<xenpvh> machine is started as an IOREQ server to emulate
> +a TPM TIS interface, and the guest device tree gains a
> +C<tcg,tpm-tis-mmio> node describing it.
That feels like implementation details that aren't useful in the
manpage, especially about the QEMU machine been used, which could be
changed without impact of the tpm feature... The part about which node
in the device tree is been added might be ok, or also implementation
detail that a user might not need to care about if it is standard. You
haven't say anything about ACPI on the x86 part ;-)
> +
> One of B<tpm_statefile> or B<tpm_statedir> is required, but not both.
>
> =item B<tpm_statefile="PATH">
> diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
> index 843b8e29ebd3..ebdd05586efe 100644
> --- a/tools/libs/light/libxl_dm.c
> +++ b/tools/libs/light/libxl_dm.c
> @@ -3892,6 +3898,12 @@ int libxl__need_xenpv_qemu(libxl__gc *gc,
> libxl_domain_config *d_config)
> goto out;
> }
>
> + /* QEMU provides the emulated TPM, e.g. via the ARM xenpvh machine. */
> + if (d_config->b_info.tpm.version) {
This needs the "xenpvh" machine, the function is about the "xenpv"
machine.
Overall, that patch confuse both QEMU machine xenpv and xenpvh, but I
don't think they are equivalent. They both exist on both x86 and Arm.
The x86 xenpvh machine probably miss the TPM but that could by added I
guess.
I think that Arm guest which both try to use QEMU's PV backend (like
for using a qcow2 storage) and TPM wouldn't work. If that the case, we
might need to start two QEMU, or update QEMU's xenpvh machine to
initialise the PV backend.
Thanks,
--
Anthony Perard | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |