From patchwork Mon Jun 8 19:07:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 481991 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1AC5E140213 for ; Tue, 9 Jun 2015 05:09:20 +1000 (AEST) Received: from localhost ([::1]:59867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z22Q7-0007ye-Cj for incoming@patchwork.ozlabs.org; Mon, 08 Jun 2015 15:09:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z22Op-0005md-Ay for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:07:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z22On-0007zX-Jn for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:07:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z22On-0007zL-DO for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:07:53 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 22365BAEF5; Mon, 8 Jun 2015 19:07:53 +0000 (UTC) Received: from localhost (ovpn-113-204.phx2.redhat.com [10.3.113.204]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t58J7qWS029240; Mon, 8 Jun 2015 15:07:52 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Mon, 8 Jun 2015 16:07:39 -0300 Message-Id: <1433790460-30679-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1433790460-30679-1-git-send-email-ehabkost@redhat.com> References: <1433790460-30679-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 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 Subject: [Qemu-devel] [PATCH 1/2] target-i386: Introduce "-cpu custom" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 4e7cdaa..4677784 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -3052,7 +3052,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) { @@ -3182,6 +3184,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; @@ -3190,6 +3197,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