From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwC4l-0000gF-WB for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwC4l-0002i5-BS for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:51:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37462) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bwC4l-0002ht-6V for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:51:51 -0400 From: Eduardo Habkost Date: Mon, 17 Oct 2016 15:51:20 -0200 Message-Id: <1476726698-14661-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1476726698-14661-1-git-send-email-ehabkost@redhat.com> References: <1476726698-14661-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PULL 03/21] target-i386: Disable VME by default with TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Richard Henderson , qemu-devel@nongnu.org VME is already disabled automatically when using TCG. So, instead of pretending it is there when reporting CPU model data on query-cpu-* QMP commands (making every CPU model to be reported as not runnable), we can disable it by default on all CPU models when using TCG. Do that by adding a tcg_default_props array that will work like kvm_default_props. Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index cad2759..25a3d80 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1550,6 +1550,14 @@ static PropValue kvm_default_props[] = { { NULL, NULL }, }; +/* TCG-specific defaults that override all CPU models when using TCG + */ +static PropValue tcg_default_props[] = { + { "vme", "off" }, + { NULL, NULL }, +}; + + void x86_cpu_change_kvm_default(const char *prop, const char *value) { PropValue *pv; @@ -2283,6 +2291,8 @@ static void x86_cpu_load_def(X86CPU *cpu, X86CPUDefinition *def, Error **errp) } x86_cpu_apply_props(cpu, kvm_default_props); + } else if (tcg_enabled()) { + x86_cpu_apply_props(cpu, tcg_default_props); } env->features[FEAT_1_ECX] |= CPUID_EXT_HYPERVISOR; -- 2.7.4