From patchwork Sat Apr 9 20:37:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 608406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qj7YD5RlYz9t5s for ; Sun, 10 Apr 2016 06:42:08 +1000 (AEST) Received: from localhost ([::1]:33008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aozhm-0006TR-VL for incoming@patchwork.ozlabs.org; Sat, 09 Apr 2016 16:42:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aozfO-0000qQ-Fj for qemu-devel@nongnu.org; Sat, 09 Apr 2016 16:39:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aozfN-0008TT-HO for qemu-devel@nongnu.org; Sat, 09 Apr 2016 16:39:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aozfN-0008T7-CU for qemu-devel@nongnu.org; Sat, 09 Apr 2016 16:39:37 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A77D3D6; Sat, 9 Apr 2016 20:39:37 +0000 (UTC) Received: from localhost (vpn1-5-109.gru2.redhat.com [10.97.5.109]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u39KdZNC026821; Sat, 9 Apr 2016 16:39:36 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Sat, 9 Apr 2016 17:37:46 -0300 Message-Id: <1460234267-20523-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1460234267-20523-1-git-send-email-ehabkost@redhat.com> References: <1460234267-20523-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 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.7 3/4] target-i386: Set constant model_id for qemu63/qemu32/athlon X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Newer PC machines don't set hw_version, and older machines set model-id on compat_props explicitly, so we don't need the x86_cpudef_setup() code that sets model_id using qemu_hw_version() anymore. Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index ddae932..ccee5c9 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -702,6 +702,7 @@ static X86CPUDefinition builtin_x86_defs[] = { .features[FEAT_8000_0001_ECX] = CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM, .xlevel = 0x8000000A, + .model_id = "QEMU Virtual CPU version " QEMU_HW_VERSION, }, { .name = "phenom", @@ -798,6 +799,7 @@ static X86CPUDefinition builtin_x86_defs[] = { .features[FEAT_1_ECX] = CPUID_EXT_SSE3, .xlevel = 0x80000004, + .model_id = "QEMU Virtual CPU version " QEMU_HW_VERSION, }, { .name = "kvm32", @@ -894,6 +896,7 @@ static X86CPUDefinition builtin_x86_defs[] = { .features[FEAT_8000_0001_EDX] = CPUID_EXT2_MMXEXT | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT, .xlevel = 0x80000008, + .model_id = "QEMU Virtual CPU version " QEMU_HW_VERSION, }, { .name = "n270", @@ -2263,28 +2266,8 @@ void cpu_clear_apic_feature(CPUX86State *env) #endif /* !CONFIG_USER_ONLY */ -/* Initialize list of CPU models, filling some non-static fields if necessary - */ void x86_cpudef_setup(void) { - int i, j; - static const char *model_with_versions[] = { "qemu32", "qemu64", "athlon" }; - - for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) { - X86CPUDefinition *def = &builtin_x86_defs[i]; - - /* Look for specific "cpudef" models that */ - /* have the QEMU version in .model_id */ - for (j = 0; j < ARRAY_SIZE(model_with_versions); j++) { - if (strcmp(model_with_versions[j], def->name) == 0) { - pstrcpy(def->model_id, sizeof(def->model_id), - "QEMU Virtual CPU version "); - pstrcat(def->model_id, sizeof(def->model_id), - qemu_hw_version()); - break; - } - } - } } void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,