* [pve-devel] [PATCH qemu-server 1/3] query cpu flags: fix detecting KVM support
2026-01-27 16:14 [pve-devel] [PATCH-SERIES qemu-server 0/3] query cpu flags: support aarch64 host Fiona Ebner
@ 2026-01-27 16:14 ` Fiona Ebner
2026-01-27 16:15 ` [pve-devel] [PATCH qemu-server 2/3] query cpu flags: query correct model for TCG Fiona Ebner
2026-01-27 16:15 ` [pve-devel] [PATCH qemu-server 3/3] query cpu flags: support aarch64 host Fiona Ebner
2 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2026-01-27 16:14 UTC (permalink / raw)
To: pve-devel
KVM can only be used when the host arch matches the vCPU arch.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 7a0a2606..ebb6ae19 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -2939,7 +2939,8 @@ sub vga_conf_has_spice {
sub query_supported_cpu_flags {
my ($arch) = @_;
- $arch //= get_host_arch();
+ my $host_arch = get_host_arch();
+ $arch //= $host_arch;
my $default_machine = PVE::QemuServer::Machine::default_machine_for_arch($arch);
my $flags = {};
@@ -2949,7 +2950,7 @@ sub query_supported_cpu_flags {
die "QEMU/KVM cannot detect CPU flags on ARM (aarch64)\n"
if $arch eq "aarch64";
- my $kvm_supported = defined(kvm_version());
+ my $kvm_supported = defined(kvm_version()) && $arch eq $host_arch;
my $qemu_cmd = PVE::QemuServer::Helpers::get_command_for_arch($arch);
my $fakevmid = -1;
my $pidfile = PVE::QemuServer::Helpers::vm_pidfile_name($fakevmid);
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* [pve-devel] [PATCH qemu-server 2/3] query cpu flags: query correct model for TCG
2026-01-27 16:14 [pve-devel] [PATCH-SERIES qemu-server 0/3] query cpu flags: support aarch64 host Fiona Ebner
2026-01-27 16:14 ` [pve-devel] [PATCH qemu-server 1/3] query cpu flags: fix detecting KVM support Fiona Ebner
@ 2026-01-27 16:15 ` Fiona Ebner
2026-01-27 16:15 ` [pve-devel] [PATCH qemu-server 3/3] query cpu flags: support aarch64 host Fiona Ebner
2 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2026-01-27 16:15 UTC (permalink / raw)
To: pve-devel
With TCG, there is no 'host' model. Use the 'max' model instead. Note
that this does not actually change the result on x86_64 but is
required for aarch64.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index ebb6ae19..9ab25c49 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -2988,7 +2988,7 @@ sub query_supported_cpu_flags {
$fakevmid,
'query-cpu-model-expansion',
type => 'full',
- model => { name => 'host' },
+ model => { name => $kvm ? 'host' : 'max' },
);
my $props = $cmd_result->{model}->{props};
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* [pve-devel] [PATCH qemu-server 3/3] query cpu flags: support aarch64 host
2026-01-27 16:14 [pve-devel] [PATCH-SERIES qemu-server 0/3] query cpu flags: support aarch64 host Fiona Ebner
2026-01-27 16:14 ` [pve-devel] [PATCH qemu-server 1/3] query cpu flags: fix detecting KVM support Fiona Ebner
2026-01-27 16:15 ` [pve-devel] [PATCH qemu-server 2/3] query cpu flags: query correct model for TCG Fiona Ebner
@ 2026-01-27 16:15 ` Fiona Ebner
2 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2026-01-27 16:15 UTC (permalink / raw)
To: pve-devel
Note that for ARM, the 'host' model can only be queried when it is
also used on the commandline. This doesn't change the result for x86_64
either.
The mentioned commit for ARM in the FIXME has long been merged in QEMU
as e19afd5667 ("target/arm/monitor: Introduce
qmp_query_cpu_model_expansion").
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 9ab25c49..1b49e9fd 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -2945,11 +2945,6 @@ sub query_supported_cpu_flags {
my $flags = {};
- # FIXME: Once this is merged, the code below should work for ARM as well:
- # https://lists.nongnu.org/archive/html/qemu-devel/2019-06/msg04947.html
- die "QEMU/KVM cannot detect CPU flags on ARM (aarch64)\n"
- if $arch eq "aarch64";
-
my $kvm_supported = defined(kvm_version()) && $arch eq $host_arch;
my $qemu_cmd = PVE::QemuServer::Helpers::get_command_for_arch($arch);
my $fakevmid = -1;
@@ -2978,6 +2973,8 @@ sub query_supported_cpu_flags {
if (!$kvm) {
push @$cmd, '-accel', 'tcg';
+ } else {
+ push @$cmd, '-cpu', 'host';
}
my $rc = run_command($cmd, noerr => 1, quiet => 0);
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread