From patchwork Wed Apr 25 09:23:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154850 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C4C63B6FA3 for ; Wed, 25 Apr 2012 19:25:33 +1000 (EST) Received: from localhost ([::1]:42846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMyTb-0000CK-Lf for incoming@patchwork.ozlabs.org; Wed, 25 Apr 2012 05:25:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMyRz-0005B7-VO for qemu-devel@nongnu.org; Wed, 25 Apr 2012 05:23:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMyRt-0005OB-0s for qemu-devel@nongnu.org; Wed, 25 Apr 2012 05:23:51 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38163 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMyRs-0005Nr-O1 for qemu-devel@nongnu.org; Wed, 25 Apr 2012 05:23:44 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id A4F01A398D; Wed, 25 Apr 2012 11:23:43 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 25 Apr 2012 11:23:28 +0200 Message-Id: <1335345816-22452-8-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1335345816-22452-1-git-send-email-afaerber@suse.de> References: <1335345816-22452-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori Subject: [Qemu-devel] [PATCH v3 07/15] target-i386: Add "model-id" property to X86CPU 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 Signed-off-by: Andreas Färber Reviewed-by: Eduardo Habkost Reviewed-by: Igor Mammedov --- target-i386/cpu.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 82194dd..bb57345 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -673,8 +673,11 @@ static void x86_cpuid_version_set_stepping(Object *obj, Visitor *v, env->cpuid_version |= value & 0xf; } -static void x86_cpuid_set_model_id(CPUX86State *env, const char *model_id) +static void x86_cpuid_set_model_id(Object *obj, const char *model_id, + Error **errp) { + X86CPU *cpu = X86_CPU(obj); + CPUX86State *env = &cpu->env; int c, len, i; if (model_id == NULL) { @@ -1004,7 +1007,7 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model) env->cpuid_ext3_features &= TCG_EXT3_FEATURES; env->cpuid_svm_features &= TCG_SVM_FEATURES; } - x86_cpuid_set_model_id(env, def->model_id); + object_property_set_str(OBJECT(cpu), def->model_id, "model-id", &error); if (error_is_set(&error)) { error_free(error); return -1; @@ -1543,6 +1546,9 @@ static void x86_cpu_initfn(Object *obj) object_property_add(obj, "stepping", "int", NULL, x86_cpuid_version_set_stepping, NULL, NULL, NULL); + object_property_add_str(obj, "model-id", + NULL, + x86_cpuid_set_model_id, NULL); env->cpuid_apic_id = env->cpu_index; mce_init(cpu);