From eabc189ee822e192cfd92d86ed320248a1a84d5e Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Mon, 20 Aug 2018 17:53:18 +0200 Subject: [PATCH] add ibpb, ssbd, virt-ssbd, amd-ssbd, amd-no-ssb, pdpe1gb cpu flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit > The following are important CPU features that should be used on > Intel x86 hosts, when available in the host CPU. Some of them > require explicit configuration to enable, as they are not included > by default in some, or all, of the named CPU models listed above. > In general all of these features are included if using “Host > passthrough” or “Host model”. > > pcid: Recommended to mitigate the cost of the Meltdown > (CVE-2017-5754) fix. Included by default in Haswell, Broadwell & > Skylake Intel CPU models. Should be explicitly turned on for > Westmere, SandyBridge, and IvyBridge Intel CPU models. Note that > some desktop/mobile Westmere CPUs cannot support this feature. > > spec-ctrl: Required to enable the Spectre (CVE-2017-5753 and > CVE-2017-5715) fix, in cases where retpolines are not sufficient. > Included by default in Intel CPU models with -IBRS suffix. Must be > explicitly turned on for Intel CPU models without -IBRS suffix. > Requires the host CPU microcode to support this feature before it > can be used for guest CPUs. > > ssbd: Required to enable the CVE-2018-3639 fix. Not included by > default in any Intel CPU model. Must be explicitly turned on for > all Intel CPU models. Requires the host CPU microcode to support > this feature before it can be used for guest CPUs. > > pdpe1gbr: Recommended to allow guest OS to use 1GB size pages.Not > included by default in any Intel CPU model. Should be explicitly > turned on for all Intel CPU models. Note that not all CPU hardware > will support this feature. -- https://www.berrange.com/posts/2018/06/29/cpu-model-configuration-for-qemu-kvm-on-x86-hosts/ --- PVE/QemuServer.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 1c0fba2..015f8f7 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -155,7 +155,7 @@ my $cpu_vendor_list = { max => 'default', }; -my $cpu_flag = qr/[+-](pcid|spec-ctrl)/; +my $cpu_flag = qr/[+-](pcid|spec-ctrl|ibpb|ssbd|virt-ssbd|amd-ssbd|amd-no-ssb|pdpe1gb)/; my $cpu_fmt = { cputype => { @@ -174,7 +174,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'.", + . " Currently supported flags: 'pcid', 'spec-ctrl', 'ibpb', 'ssbd', 'virt-ssbd', 'amd-ssbd', 'amd-no-ssb', 'pdpe1gb'.", format_description => '+FLAG[;-FLAG...]', type => 'string', pattern => qr/$cpu_flag(;$cpu_flag)*/, -- 2.39.2