From nobody Sat Apr 27 06:09:53 2024 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; dkim=fail; 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=1574268629; cv=none; d=zoho.com; s=zohoarc; b=JtHDuMm8U2niFnBExD1gBDyvo7mpIIVr6t9jr0H2JkPd8cW5lZxT962BRvy5P4v3Yl4rit2suwc5FLTH6lj7dTY/ZJqPtJhZEoXFgrRq9qLZyT22Yl00TZ/P3Qixp0PIAdrluifPhfot5kWXfqjelTxWKchSuf5rj+aZU2eH0pQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574268629; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=5Dpc1BgQpMogJAbxDLdkCUn1kyxxuliFoIC8+1a85qY=; b=dECsjGp64z+Y0nHV+rlIoELUJcXkesaBSPWoWSRIPbmRmc+yyt/X0zcCQPdITVqAFu3TL8irs2VH1apzsnJcW0cR71oCRanqlAm69mhiQKb9o88oxm/ngT/UY8/bYy7GRq7YjImG84cjt52L+RMs+Be8qg9X41xHT2ab626tcsk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; 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 1574268629537718.3007921312001; Wed, 20 Nov 2019 08:50:29 -0800 (PST) Received: from localhost ([::1]:60588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXTBS-0008TD-L4 for importer@patchew.org; Wed, 20 Nov 2019 11:50:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48541) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXTAQ-0007MQ-Cp for qemu-devel@nongnu.org; Wed, 20 Nov 2019 11:49:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXTAP-0003xU-0Q for qemu-devel@nongnu.org; Wed, 20 Nov 2019 11:49:22 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23402 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iXTAO-0003xH-SX for qemu-devel@nongnu.org; Wed, 20 Nov 2019 11:49:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-40-i4u_zttCP1uoIaLgIIIn3g-1; Wed, 20 Nov 2019 11:49:17 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C746593CE; Wed, 20 Nov 2019 16:49:16 +0000 (UTC) Received: from localhost (ovpn-116-6.gru2.redhat.com [10.97.116.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB0A76BF98; Wed, 20 Nov 2019 16:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574268560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Dpc1BgQpMogJAbxDLdkCUn1kyxxuliFoIC8+1a85qY=; b=QXcEitlFeLLm2rkZ+b9YfjpOMFY+E0R91YZ09wmCj6JhUjLnXsDgMNjxo2bDfGHfUYcFLS G7gwDjGwhUdl7f28lBMlKTNaE3goX07rawBIvL/ULEOmPzKbZR2lWXF2ne8vZUgbABfHqe /P7aif+Sw0PWrUdtmhyORljCXUqDpTk= From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH for-4.2 1/2] i386: Add new versions of Skylake/Cascadelake/Icelake without TSX Date: Wed, 20 Nov 2019 13:49:11 -0300 Message-Id: <20191120164912.32384-2-ehabkost@redhat.com> In-Reply-To: <20191120164912.32384-1-ehabkost@redhat.com> References: <20191120164912.32384-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: i4u_zttCP1uoIaLgIIIn3g-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: , Cc: Paolo Bonzini , Jiri Denemark , Kashyap Chamarthy , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" One of the mitigation methods for TAA[1] is to disable TSX support on the host system. Linux added a mechanism to disable TSX globally through the kernel command line, and many Linux distributions now default to tsx=3Doff. This makes existing CPU models that have HLE and RTM enabled not usable anymore. Add new versions of all CPU models that have the HLE and RTM features enabled, that can be used when TSX is disabled in the host system. References: [1] TAA, TSX asynchronous Abort: https://software.intel.com/security-software-guidance/insights/deep-div= e-intel-transactional-synchronization-extensions-intel-tsx-asynchronous-abo= rt https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/tsx_async_ab= ort.html Signed-off-by: Eduardo Habkost --- target/i386/cpu.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 296b491607..0267e08612 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2474,6 +2474,14 @@ static X86CPUDefinition builtin_x86_defs[] =3D { { /* end of list */ } } }, + { + .version =3D 3, + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + } + }, { /* end of list */ } } }, @@ -2541,6 +2549,14 @@ static X86CPUDefinition builtin_x86_defs[] =3D { { /* end of list */ } } }, + { + .version =3D 3, + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + } + }, { /* end of list */ } } }, @@ -2608,6 +2624,13 @@ static X86CPUDefinition builtin_x86_defs[] =3D { { /* end of list */ } }, }, + { .version =3D 3, + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + }, + }, { /* end of list */ } } }, @@ -2665,6 +2688,18 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Intel Core Processor (Icelake)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + }, + }, + { /* end of list */ } + } }, { .name =3D "Icelake-Server", @@ -2723,6 +2758,18 @@ static X86CPUDefinition builtin_x86_defs[] =3D { CPUID_6_EAX_ARAT, .xlevel =3D 0x80000008, .model_id =3D "Intel Xeon Processor (Icelake)", + .versions =3D (X86CPUVersionDefinition[]) { + { .version =3D 1 }, + { + .version =3D 2, + .props =3D (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + }, + }, + { /* end of list */ } + } }, { .name =3D "Denverton", --=20 2.21.0 From nobody Sat Apr 27 06:09:53 2024 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; dkim=fail; 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=1574268713; cv=none; d=zoho.com; s=zohoarc; b=MF178b9vXhcot/wkpSJE7rkjc3rfzy4MTcW+YCBA5d2Caqkye+9AD2Q/TxGtp+IJAlQuhIQu1QpKPwOK1ROlfNSDA7uJQmiHyCysvJiOsV6MOehdtVFJ4bP3lbahlndh9frRoKpSnBPof1TsLZHRTr9FvI+x98U0hES/FNLDHds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574268713; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=R1RAWgOV2CTblgrdYixaE4iETE7/42c/P03VYu6Ffq0=; b=lW2otbgb8HMCY2+sTSBlbbkn9/9rU1CocN7ls+RShdyhhr9Z3y/RxljBfUzfs9JaDUqTjGbqgRjfB5M2erEZG0DkR9jBV54FOFIlHcP+UusAz9XMgsTMDCOxgAB6JL/Xu5OZBw3kI6U7TUe7mdY+DMnA6AsuehobJBb2t8JnZiU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; 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 1574268713092997.1425965324916; Wed, 20 Nov 2019 08:51:53 -0800 (PST) Received: from localhost ([::1]:60602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXTCp-0001zB-VM for importer@patchew.org; Wed, 20 Nov 2019 11:51:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48552) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXTAR-0007NR-PS for qemu-devel@nongnu.org; Wed, 20 Nov 2019 11:49:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXTAQ-0003xq-Qf for qemu-devel@nongnu.org; Wed, 20 Nov 2019 11:49:23 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:33552 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iXTAQ-0003xm-N6 for qemu-devel@nongnu.org; Wed, 20 Nov 2019 11:49:22 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-5cncTbPON4-lDRjPkoxGvA-1; Wed, 20 Nov 2019 11:49:19 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 514F18024EE; Wed, 20 Nov 2019 16:49:18 +0000 (UTC) Received: from localhost (ovpn-116-6.gru2.redhat.com [10.97.116.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6EE651334; Wed, 20 Nov 2019 16:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574268562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R1RAWgOV2CTblgrdYixaE4iETE7/42c/P03VYu6Ffq0=; b=aKZTUsqyZfRieTLtP6IXeqavxvnUz8lCygyxJ+fOnnQb0OriPG77jSTINU+5ELnA5y2CsG vLRP7KT6+7Sp8oo3gsAk7taoNeC2Xe9XK5mIVZcp/JTTfHGTXAf12WAznKS2TYBoyeQeNL kfrTYPFzfI/PDykOEAHBkck6qf7fGzw= From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH for-4.2 2/2] i386: Add -noTSX aliases for hle=off, rtm=off CPU models Date: Wed, 20 Nov 2019 13:49:12 -0300 Message-Id: <20191120164912.32384-3-ehabkost@redhat.com> In-Reply-To: <20191120164912.32384-1-ehabkost@redhat.com> References: <20191120164912.32384-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 5cncTbPON4-lDRjPkoxGvA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: , Cc: Paolo Bonzini , Jiri Denemark , Kashyap Chamarthy , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We have been trying to avoid adding new aliases for CPU model versions, but in the case of changes in defaults introduced by the TAA mitigation patches, the aliases might help avoid user confusion when applying host software updates. Signed-off-by: Eduardo Habkost Tested-by: Kashyap Chamarthy --- target/i386/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 0267e08612..56eb98ef35 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2476,6 +2476,7 @@ static X86CPUDefinition builtin_x86_defs[] =3D { }, { .version =3D 3, + .alias =3D "Skylake-Client-noTSX-IBRS", .props =3D (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, @@ -2551,6 +2552,7 @@ static X86CPUDefinition builtin_x86_defs[] =3D { }, { .version =3D 3, + .alias =3D "Skylake-Server-noTSX-IBRS", .props =3D (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, @@ -2625,6 +2627,7 @@ static X86CPUDefinition builtin_x86_defs[] =3D { }, }, { .version =3D 3, + .alias =3D "Cascadelake-Server-noTSX", .props =3D (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, @@ -2692,6 +2695,7 @@ static X86CPUDefinition builtin_x86_defs[] =3D { { .version =3D 1 }, { .version =3D 2, + .alias =3D "Icelake-Client-noTSX", .props =3D (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, @@ -2762,6 +2766,7 @@ static X86CPUDefinition builtin_x86_defs[] =3D { { .version =3D 1 }, { .version =3D 2, + .alias =3D "Icelake-Server-noTSX", .props =3D (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, --=20 2.21.0