Received: from eggs.gnu.org ([2001:4830:134:3::10]:56302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhlRy-0001gX-30 for qemu-devel@nongnu.org; Mon, 13 Apr 2015 16:59:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhlRw-0006Bf-1e for qemu-devel@nongnu.org; Mon, 13 Apr 2015 16:59:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhlRv-0006BK-Of for qemu-devel@nongnu.org; Mon, 13 Apr 2015 16:59:19 -0400 From: Eduardo Habkost Date: Mon, 13 Apr 2015 17:57:27 -0300 Message-Id: <1428958648-26462-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1428958648-26462-1-git-send-email-ehabkost@redhat.com> References: <1428958648-26462-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [RFC 1/2] target-i386: Introduce "-cpu custom" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mimu@linux.vnet.ibm.com, borntraeger@de.ibm.com, Igor Mammedov , Paolo Bonzini , Jiri Denemark , =?UTF-8?q?Andreas=20F=C3=A4rber?= , rth@twiddle.net Now that we can configure everything in a CPU using QOM properties, add a new CPU model name that won't load anything from the CPU model table. That means no CPUID field will be initialized with any data that depends on CPU model name, machine-type, or accelerator. This will allow management software to control CPUID data completely using the "-cpu" command-line option, or using global properties. Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 1d97656..d998333 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -3009,7 +3009,9 @@ static void x86_cpu_initfn(Object *obj) } } - x86_cpu_load_def(cpu, xcc->cpu_def, &error_abort); + if (xcc->cpu_def) { + x86_cpu_load_def(cpu, xcc->cpu_def, &error_abort); + } /* init various static tables used in TCG mode */ if (tcg_enabled() && !inited) { @@ -3137,6 +3139,11 @@ static const TypeInfo x86_cpu_type_info = { .class_init = x86_cpu_common_class_init, }; +static const TypeInfo custom_x86_cpu_type_info = { + .name = X86_CPU_TYPE_NAME("custom"), + .parent = TYPE_X86_CPU, +}; + static void x86_cpu_register_types(void) { int i; @@ -3145,6 +3152,7 @@ static void x86_cpu_register_types(void) for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); i++) { x86_register_cpudef_type(&builtin_x86_defs[i]); } + type_register_static(&custom_x86_cpu_type_info); #ifdef CONFIG_KVM type_register_static(&host_x86_cpu_type_info); #endif -- 2.1.0