[pve-devel] [PATCH qemu-server 1/3] Make hv-tlbflush and hv-evmcs optional and merge flag list

Stefan Reiter s.reiter at proxmox.com
Tue Jul 23 13:41:28 CEST 2019


Both flags were causing issues and have been made into optional flags to
be manually selected by the user if needed.

The supported flags have been merged into a single list for convenience.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---

I tested live migration from a machine without the patch (i.e. a VM that's
running with hv_tlbflush enabled, in a setup where it doesn't crash) to one with
the patch applied, and there were no issues.
Tracing KVM showed that the VM was still using hv_tlbflush until the next
reboot (after migration), so it seems that the CPU flag is only checked on guest
boot.

Bluescreens with hv-tlbflush have been reported multiple times:
https://forum.proxmox.com/threads/windows-guest-bluescreen-with-proxmox-6.56053/

 PVE/QemuServer.pm | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 4bde3a7..e1dc14f 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -167,7 +167,20 @@ my $cpu_vendor_list = {
     max => 'default',
 };
 
-my $cpu_flag = qr/[+-](pcid|spec-ctrl|ibpb|ssbd|virt-ssbd|amd-ssbd|amd-no-ssb|pdpe1gb|md-clear)/;
+my @supported_cpu_flags = (
+    'pcid',
+    'spec-ctrl',
+    'ibpb',
+    'ssbd',
+    'virt-ssbd',
+    'amd-ssbd',
+    'amd-no-ssb',
+    'pdpe1gb',
+    'md-clear',
+    'hv-tlbflush',
+    'hv-evmcs'
+);
+my $cpu_flag = qr/[+-](@{[join('|', @supported_cpu_flags)]})/;
 
 my $cpu_fmt = {
     cputype => {
@@ -193,7 +206,7 @@ my $cpu_fmt = {
     flags => {
 	description => "List of additional CPU flags separated by ';'."
 		     . " Use '+FLAG' to enable, '-FLAG' to disable a flag."
-		     . " Currently supported flags: 'pcid', 'spec-ctrl', 'ibpb', 'ssbd', 'virt-ssbd', 'amd-ssbd', 'amd-no-ssb', 'pdpe1gb', 'md-clear'.",
+		     . " Currently supported flags: @{[join(', ', @supported_cpu_flags)]}.",
 	format_description => '+FLAG[;-FLAG...]',
 	type => 'string',
 	pattern => qr/$cpu_flag(;$cpu_flag)*/,
@@ -7237,10 +7250,7 @@ sub add_hyperv_enlightenments {
 	}
 
 	if (qemu_machine_feature_enabled ($machine_type, $kvmver, 3, 1)) {
-	    push @$cpuFlags , 'hv_tlbflush';
 	    push @$cpuFlags , 'hv_ipi';
-	    # FIXME: AMD does not supports this currently, only add with special flag??
-	    #push @$cpuFlags , 'hv_evmcs';
 	}
     }
 }
-- 
2.20.1





More information about the pve-devel mailing list