Received: from eggs.gnu.org ([140.186.70.92]:36173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyQx5-0006NZ-Qa for qemu-devel@nongnu.org; Fri, 17 Feb 2012 11:46:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyQwr-0002GG-MJ for qemu-devel@nongnu.org; Fri, 17 Feb 2012 11:46:31 -0500 Received: from cantor2.suse.de ([195.135.220.15]:47347 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyQwr-0002FP-H7 for qemu-devel@nongnu.org; Fri, 17 Feb 2012 11:46:17 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 17 Feb 2012 17:46:02 +0100 Message-Id: <1329497164-20086-3-git-send-email-afaerber@suse.de> In-Reply-To: <1329497164-20086-1-git-send-email-afaerber@suse.de> References: <1329497164-20086-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/4] target-i386: Introduce x86_cpuid_version_set_model() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: andre.przywara@amd.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= Move the logic for setting the model and extended model fields into a helper function. To make the function self-contained and to prepare for future unordered/multiple uses, mask out any previous model values first. Signed-off-by: Andreas F=C3=A4rber --- target-i386/cpuid.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 598a27c..e76a31b 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -607,6 +607,12 @@ static void x86_cpuid_version_set_family(CPUX86State= *env, int family) } } =20 +static void x86_cpuid_version_set_model(CPUX86State *env, int model) +{ + env->cpuid_version &=3D ~0xf00f0; + env->cpuid_version |=3D ((model & 0xf) << 4) | ((model >> 4) << 16); +} + static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_= model) { unsigned int i; @@ -894,7 +900,7 @@ int cpu_x86_register (CPUX86State *env, const char *c= pu_model) env->cpuid_vendor_override =3D def->vendor_override; env->cpuid_level =3D def->level; x86_cpuid_version_set_family(env, def->family); - env->cpuid_version |=3D ((def->model & 0xf) << 4) | ((def->model >> = 4) << 16); + x86_cpuid_version_set_model(env, def->model); env->cpuid_version |=3D def->stepping; env->cpuid_features =3D def->features; env->cpuid_ext_features =3D def->ext_features; --=20 1.7.7