From patchwork Wed Nov 20 16:49:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1198332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="QXcEitlF"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47J7vy4MsFz9sPW for ; Thu, 21 Nov 2019 03:49:50 +1100 (AEDT) Received: from localhost ([::1]:60582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXTAq-0007Ox-A2 for incoming@patchwork.ozlabs.org; Wed, 20 Nov 2019 11:49:48 -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 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= 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) 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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=off. 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-dive-intel-transactional-synchronization-extensions-intel-tsx-asynchronous-abort https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/tsx_async_abort.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[] = { { /* end of list */ } } }, + { + .version = 3, + .props = (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + } + }, { /* end of list */ } } }, @@ -2541,6 +2549,14 @@ static X86CPUDefinition builtin_x86_defs[] = { { /* end of list */ } } }, + { + .version = 3, + .props = (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + } + }, { /* end of list */ } } }, @@ -2608,6 +2624,13 @@ static X86CPUDefinition builtin_x86_defs[] = { { /* end of list */ } }, }, + { .version = 3, + .props = (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + }, + }, { /* end of list */ } } }, @@ -2665,6 +2688,18 @@ static X86CPUDefinition builtin_x86_defs[] = { CPUID_6_EAX_ARAT, .xlevel = 0x80000008, .model_id = "Intel Core Processor (Icelake)", + .versions = (X86CPUVersionDefinition[]) { + { .version = 1 }, + { + .version = 2, + .props = (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + }, + }, + { /* end of list */ } + } }, { .name = "Icelake-Server", @@ -2723,6 +2758,18 @@ static X86CPUDefinition builtin_x86_defs[] = { CPUID_6_EAX_ARAT, .xlevel = 0x80000008, .model_id = "Intel Xeon Processor (Icelake)", + .versions = (X86CPUVersionDefinition[]) { + { .version = 1 }, + { + .version = 2, + .props = (PropValue[]) { + { "hle", "off" }, + { "rtm", "off" }, + { /* end of list */ } + }, + }, + { /* end of list */ } + } }, { .name = "Denverton", From patchwork Wed Nov 20 16:49:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1198334 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="aKZTUsqy"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47J7xw0VPVz9sPf for ; Thu, 21 Nov 2019 03:51:32 +1100 (AEDT) Received: from localhost ([::1]:60598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXTCT-0001Y6-Ur for incoming@patchwork.ozlabs.org; Wed, 20 Nov 2019 11:51:29 -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 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= 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) 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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[] = { }, { .version = 3, + .alias = "Skylake-Client-noTSX-IBRS", .props = (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, @@ -2551,6 +2552,7 @@ static X86CPUDefinition builtin_x86_defs[] = { }, { .version = 3, + .alias = "Skylake-Server-noTSX-IBRS", .props = (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, @@ -2625,6 +2627,7 @@ static X86CPUDefinition builtin_x86_defs[] = { }, }, { .version = 3, + .alias = "Cascadelake-Server-noTSX", .props = (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, @@ -2692,6 +2695,7 @@ static X86CPUDefinition builtin_x86_defs[] = { { .version = 1 }, { .version = 2, + .alias = "Icelake-Client-noTSX", .props = (PropValue[]) { { "hle", "off" }, { "rtm", "off" }, @@ -2762,6 +2766,7 @@ static X86CPUDefinition builtin_x86_defs[] = { { .version = 1 }, { .version = 2, + .alias = "Icelake-Server-noTSX", .props = (PropValue[]) { { "hle", "off" }, { "rtm", "off" },