* [pve-devel] [PATCH qemu-server] cfg2cmd: use tpm-tis and tpm-tis-device depending on the arch
@ 2025-01-15 13:58 Hannes Duerr
0 siblings, 0 replies; only message in thread
From: Hannes Duerr @ 2025-01-15 13:58 UTC (permalink / raw)
To: pve-devel
When using arch aarch64 for a VM in combination with new enough Windows
OS type the VM start fails:
> qemu-system-aarch64: -device tpm-tis,tpmdev=tpmdev: 'tpm-tis' is not a valid device model name
QEMU uses the `tpm-tis-device` device model for ARM[0] and RISCV[1]
instead of the `tmp-tis` which is used for x86_64.
This patch is a follow-up to [2].
[0] https://www.qemu.org/docs/master/specs/tpm.html#the-qemu-tpm-emulator-device
[1] https://www.qemu.org/docs/master/system/riscv/virt.html#enabling-tpm
[2] https://lore.proxmox.com/pve-devel/20250113135638.88099-1-f.ebner@proxmox.com/
Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
---
PVE/QemuServer.pm | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 43008f3f..f7cb5fcb 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3203,7 +3203,7 @@ sub get_tpm_paths {
}
sub add_tpm_device {
- my ($vmid, $devices, $conf) = @_;
+ my ($vmid, $devices, $conf, $arch) = @_;
return if !$conf->{tpmstate0};
@@ -3211,7 +3211,11 @@ sub add_tpm_device {
push @$devices, "-chardev", "socket,id=tpmchar,path=$paths->{socket}";
push @$devices, "-tpmdev", "emulator,id=tpmdev,chardev=tpmchar";
- push @$devices, "-device", "tpm-tis,tpmdev=tpmdev";
+ if ($arch eq 'x86_64') {
+ push @$devices, "-device", "tpm-tis,tpmdev=tpmdev";
+ } else {
+ push @$devices, "-device", "tpm-tis-device,tpmdev=tpmdev";
+ }
}
sub start_swtpm {
@@ -3838,7 +3842,7 @@ sub config_to_command {
# Add a TPM only if the VM is not a template,
# to support backing up template VMs even if the TPM disk is write-protected.
- add_tpm_device($vmid, $devices, $conf) if (!PVE::QemuConfig->is_template($conf));
+ add_tpm_device($vmid, $devices, $conf, $arch) if (!PVE::QemuConfig->is_template($conf));
my $sockets = 1;
$sockets = $conf->{smp} if $conf->{smp}; # old style - no longer iused
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-01-15 13:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-15 13:58 [pve-devel] [PATCH qemu-server] cfg2cmd: use tpm-tis and tpm-tis-device depending on the arch Hannes Duerr
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.