[pve-devel] [PATCH 1/2] cpuflags : remove -rdtscp for Opteron cpu models

Alexandre Derumier aderumier at odiso.com
Wed Jul 8 10:49:06 CEST 2015


rdtscp is not supported by qemu and with enforce it's not starting
warning: host doesn't support requested feature: CPUID.80000001H:EDX.rdtscp [bit 27]

from to qemu wiki
http://wiki.qemu.org/Features/CPUModels#Disabling_features_that_were_always_disabled_on_KVM
"Fact: currently libvirt runs CPU models having rdtscp without the "enforce" flag, and rdtscp is silently disabled
Consequence: libvirt SHOULD use something like "-cpu Opteron_G5,-rdtscp",
especially when it starts using (or emulating) enforce mode
This will require a solution on libvirt side. QEMU will just provide the mechanisms to report CPU model information
and check what the host and QEMU supports, but the decision to disable rdtscp to be able
to run Opteron_G[2345] needs to be taken by libvirt."

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 28b34d3..6400be6 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2957,6 +2957,8 @@ sub config_to_command {
 
     push @$cpuFlags, '+sep' if $cpu eq 'kvm64' || $cpu eq 'kvm32';
 
+    push @$cpuFlags, '-rdtscp' if $cpu =~ m/^Opteron/;
+
     if (qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 3)) {
 
 	push @$cpuFlags , '+kvm_pv_unhalt' if !$nokvm;
-- 
2.1.4




More information about the pve-devel mailing list