From nobody Mon Feb 9 13:38:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562178443; cv=none; d=zoho.com; s=zohoarc; b=Bit65LB+IpRJ+FPUJSUbn+RPzxKYOQO1mmhj7PxKTRWOQZqCNEBo+4a1ZkYumHUN42OKxzOcAEC0MQtZKJ3N52ZTDmvYWGSvJuVQbZBc6othO+8FB3Uj6o4OhPqbePF/fKvJ/YXJH9JTFtekLlWB13Dbwb2gg4e95gQDibutvJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562178443; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Dno2dw1B+2aJPir6M3SpFr18WRnQKuiTBfjoyIjqRCs=; b=dO0WqT9EwYMHWbi/JE2PBxT5jUeVVgKhPB3VnCChrzVwKxTkvn0F9mLMmxjmdyk2IlfZVUeYV2i9pVw+mV8ZDY+ENM+6yGjMCLV7GXssqnNo2k8G1L0QfQN7SZiLKueMzsuODjHjHY2UUDnrvN4H39JhMWTFUEBhvRvn0wYkWyo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562178443985269.7587011577838; Wed, 3 Jul 2019 11:27:23 -0700 (PDT) Received: from localhost ([::1]:38394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hijyP-0005bs-Ph for importer@patchew.org; Wed, 03 Jul 2019 14:27:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56855) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hijgd-00054g-A4 for qemu-devel@nongnu.org; Wed, 03 Jul 2019 14:08:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hijgb-0000wO-Tn for qemu-devel@nongnu.org; Wed, 03 Jul 2019 14:08:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43594) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hijgb-0000vz-MD for qemu-devel@nongnu.org; Wed, 03 Jul 2019 14:08:53 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 007B0C04FFF6; Wed, 3 Jul 2019 18:08:53 +0000 (UTC) Received: from localhost (ovpn-116-30.gru2.redhat.com [10.97.116.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7B555C5BB; Wed, 3 Jul 2019 18:08:50 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , Paolo Bonzini , qemu-devel@nongnu.org, Marcel Apfelbaum , Richard Henderson Date: Wed, 3 Jul 2019 15:07:19 -0300 Message-Id: <20190703180726.31267-37-ehabkost@redhat.com> In-Reply-To: <20190703180726.31267-1-ehabkost@redhat.com> References: <20190703180726.31267-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 03 Jul 2019 18:08:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL v4 36/43] i386: Define -IBRS, -noTSX, -IBRS versions of CPU models X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Add versions of CPU models that are equivalent to their -IBRS, -noTSX and -IBRS variants. The separate variants will eventually be removed and become aliases for these CPU versions. Signed-off-by: Eduardo Habkost Message-Id: <20190628002844.24894-6-ehabkost@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Eduardo Habkost --- target/i386/cpu.c | 186 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a611c6eae2..99ab6104f4 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1851,6 +1851,20 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_EXT3_LAHF_LM, .xlevel =3D 0x80000008, .model_id =3D "Intel Core i7 9xx (Nehalem Class Core i7)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to Nehalem-IBRS */ + .props =3D (PropValue[]) { + { "spec-ctrl", "on" }, + { "model-id", + "Intel Core i7 9xx (Nehalem Core i7, IBRS update)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "Nehalem-IBRS", @@ -1907,6 +1921,20 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Westmere E56xx/L56xx/X56xx (Nehalem-C)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to Westmere-IBRS */ + .props =3D (PropValue[]) { + { "spec-ctrl", "on" }, + { "model-id", + "Westmere E56xx/L56xx/X56xx (IBRS update)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "Westmere-IBRS", @@ -1971,6 +1999,20 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Intel Xeon E312xx (Sandy Bridge)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to SandyBridge-IBRS */ + .props =3D (PropValue[]) { + { "spec-ctrl", "on" }, + { "model-id", + "Intel Xeon E312xx (Sandy Bridge, IBRS update)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "SandyBridge-IBRS", @@ -2043,6 +2085,20 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Intel Xeon E3-12xx v2 (Ivy Bridge)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to IvyBridge-IBRS */ + .props =3D (PropValue[]) { + { "spec-ctrl", "on" }, + { "model-id", + "Intel Xeon E3-12xx v2 (Ivy Bridge, IBRS)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "IvyBridge-IBRS", @@ -2205,6 +2261,52 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Intel Core Processor (Haswell)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to Haswell-noTSX */ + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { "stepping", "1" }, + { "model-id", "Intel Core Processor (Haswell, no TSX)"= , }, + { /* end of list */ } + }, + }, + { + .version =3D 3, + /* Equivalent to Haswell-IBRS */ + .props =3D (PropValue[]) { + /* Restore TSX features removed by -v2 above */ + { "hle", "on" }, + { "rtm", "on" }, + /* + * Haswell and Haswell-IBRS had stepping=3D4 in + * QEMU 4.0 and older + */ + { "stepping", "4" }, + { "spec-ctrl", "on" }, + { "model-id", + "Intel Core Processor (Haswell, IBRS)" }, + { /* end of list */ } + } + }, + { + .version =3D 4, + /* Equivalent to Haswell-noTSX-IBRS */ + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + /* spec-ctrl was already enabled by -v3 above */ + { "stepping", "1" }, + { "model-id", + "Intel Core Processor (Haswell, no TSX, IBRS)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "Haswell-IBRS", @@ -2375,6 +2477,45 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Intel Core Processor (Broadwell)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to Broadwell-noTSX */ + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { "model-id", "Intel Core Processor (Broadwell, no TSX= )", }, + { /* end of list */ } + }, + }, + { + .version =3D 3, + /* Equivalent to Broadwell-IBRS */ + .props =3D (PropValue[]) { + /* Restore TSX features removed by -v2 above */ + { "hle", "on" }, + { "rtm", "on" }, + { "spec-ctrl", "on" }, + { "model-id", + "Intel Core Processor (Broadwell, IBRS)" }, + { /* end of list */ } + } + }, + { + .version =3D 4, + /* Equivalent to Broadwell-noTSX-IBRS */ + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + /* spec-ctrl was already enabled by -v3 above */ + { "model-id", + "Intel Core Processor (Broadwell, no TSX, IBRS)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "Broadwell-IBRS", @@ -2465,6 +2606,20 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Intel Core Processor (Skylake)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to Skylake-Client-IBRS */ + .props =3D (PropValue[]) { + { "spec-ctrl", "on" }, + { "model-id", + "Intel Core Processor (Skylake, IBRS)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "Skylake-Client-IBRS", @@ -2567,6 +2722,23 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Intel Xeon Processor (Skylake)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to Skylake-Server-IBRS */ + .props =3D (PropValue[]) { + /* clflushopt was not added to Skylake-Server-IBRS */ + /* TODO: add -v3 including clflushopt */ + { "clflushopt", "off" }, + { "spec-ctrl", "on" }, + { "model-id", + "Intel Xeon Processor (Skylake, IBRS)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "Skylake-Server-IBRS", @@ -3082,6 +3254,20 @@ static X86CPUDefinition builtin_x86_defs[] =3D { .xlevel =3D 0x8000001E, .model_id =3D "AMD EPYC Processor", .cache_info =3D &epyc_cache_info, + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + /* Equivalent to EPYC-IBPB */ + .props =3D (PropValue[]) { + { "ibpb", "on" }, + { "model-id", + "AMD EPYC Processor (with IBPB)" }, + { /* end of list */ } + } + }, + { /* end of list */ } + } }, { .name =3D "EPYC-IBPB", --=20 2.18.0.rc1.1.g3f1ff2140