From nobody Mon Feb 9 08:10:04 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=1562085200; cv=none; d=zoho.com; s=zohoarc; b=Fyv11GfQ3TfKniROelelBdzrlAvOU0/SyfvUjHLnJoZrjHpa8oY+i1S4dHZ7+GxB3RLajszcuT5M7RX/ep2nFNPDeekMoagIN31H9oI8ZU7uIoV7+7vdyRRbqszfk6dRpGrhAxPHnhQ8MoU1UwRoplaZxxe/K5nAV++ixpTqVG8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562085200; 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=PYW4tDRSx7++ZdEaOukQ+dUKbcKJ2Zmr0z79EAYfP0m26GERtdYnUHORvGMNRINjKRJVjukVqIB97vNxzX6kby2Uhkr6c4jxzL4gHIGbmlhHgVtOcMZCpQcg5pAkxg5gG2S/+mZbYsyYCb9BrYMnq9GEQWTXApD3joxoQZ9h4DA= 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 1562085200852245.61732636823558; Tue, 2 Jul 2019 09:33:20 -0700 (PDT) Received: from localhost ([::1]:55056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiLiZ-0008Au-RV for importer@patchew.org; Tue, 02 Jul 2019 12:33:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38169) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiKqb-0000zm-Ii for qemu-devel@nongnu.org; Tue, 02 Jul 2019 11:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiKqY-00072n-Je for qemu-devel@nongnu.org; Tue, 02 Jul 2019 11:37:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54098) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiKqY-0006v1-7s for qemu-devel@nongnu.org; Tue, 02 Jul 2019 11:37:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42D253082B6D; Tue, 2 Jul 2019 15:37:22 +0000 (UTC) Received: from localhost (ovpn-116-30.gru2.redhat.com [10.97.116.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id C848D1001B3A; Tue, 2 Jul 2019 15:37:21 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , Paolo Bonzini , qemu-devel@nongnu.org, Marcel Apfelbaum , Richard Henderson Date: Tue, 2 Jul 2019 12:35:29 -0300 Message-Id: <20190702153535.9851-37-ehabkost@redhat.com> In-Reply-To: <20190702153535.9851-1-ehabkost@redhat.com> References: <20190702153535.9851-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 02 Jul 2019 15:37:22 +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 v3 36/42] 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