From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6kZm-0001iX-Lp for qemu-devel@nongnu.org; Wed, 29 Aug 2012 11:53:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6kZl-0003d0-GW for qemu-devel@nongnu.org; Wed, 29 Aug 2012 11:53:06 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:35905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6kZl-0003cj-Bx for qemu-devel@nongnu.org; Wed, 29 Aug 2012 11:53:05 -0400 Received: from /spool/local by e4.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Aug 2012 11:52:55 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 9653D38C803F for ; Wed, 29 Aug 2012 11:52:22 -0400 (EDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7TFqKdB142476 for ; Wed, 29 Aug 2012 11:52:20 -0400 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7TFqHBq017708 for ; Wed, 29 Aug 2012 09:52:18 -0600 From: Anthony Liguori Date: Wed, 29 Aug 2012 10:52:07 -0500 Message-Id: <1346255529-16534-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 1/3] target-i386: disable pv eoi to fix migration across QEMU versions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Michael Tsirkin We have a problem with how we handle migration with KVM paravirt features. We unconditionally enable paravirt features regardless of whether we know how to migrate them. We also don't tie paravirt features to specific machine types so an old QEMU on a new kernel would expose features that never existed. The 1.2 cycle is over and as things stand, migration is broken. Michael has another series that adds support for migrating PV EOI and attempts to make it work correctly for different machine types. After speaking with Michael on IRC, we agreed to take this patch plus 1 & 4 from his series. This makes sure QEMU can migrate PV EOI if it's enabled, but does not enable it by default. This also means that we won't unconditionally enable new features for guests future proofing us from this happening again in the future. Signed-off-by: Anthony Liguori --- target-i386/cpu.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 120a2e3..f3cac49 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -33,6 +33,7 @@ #include "hyperv.h" #include "hw/hw.h" +#include /* feature flags taken from "Intel Processor Identification and the CPUID * Instruction" and AMD's "CPUID Specification". In cases of disagreement @@ -887,7 +888,17 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model) memcpy(x86_cpu_def, def, sizeof(*def)); } - plus_kvm_features = ~0; /* not supported bits will be filtered out later */ +#if defined(CONFIG_KVM) + plus_kvm_features = (1 << KVM_FEATURE_CLOCKSOURCE) | + (1 << KVM_FEATURE_NOP_IO_DELAY) | + (1 << KVM_FEATURE_MMU_OP) | + (1 << KVM_FEATURE_CLOCKSOURCE2) | + (1 << KVM_FEATURE_ASYNC_PF) | + (1 << KVM_FEATURE_STEAL_TIME) | + (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT); +#else + plus_kvm_features = 0; +#endif add_flagname_to_bitmaps("hypervisor", &plus_features, &plus_ext_features, &plus_ext2_features, &plus_ext3_features, -- 1.7.5.4