Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4428218ybb; Tue, 7 Apr 2020 07:21:08 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6/raB1wjEHHgrboc2AACI9C1k84SvkFUgL/ppupuAIT3Y0IK1gvwdTzIUYPmUgkakAmEn X-Received: by 2002:a9d:1b6d:: with SMTP id l100mr1686959otl.70.1586269268295; Tue, 07 Apr 2020 07:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586269268; cv=none; d=google.com; s=arc-20160816; b=kP9eury64xV+IgUm6lfyTXH8YeQGEWli51e5CZwv2w/AoswLrnsKZ6kL0T3nahOLee KNIk8SLy9lALIH19HuHt/dkBB27MGo7Uk1J9wFmpKLKfGcY0SGdFowgPIcvYSMah/5m8 18aj0csFI0bTZbrk8PGotkIb1FMEaZ6uY0+JRt18p532nWFZlccvFvOYYPLO2aZiRaCm +8wIqrMhnRKpseF/yO1SnC3kc6GBda+Of8AIJtmNS25rLUIgnpFEueco1ZwDJn0GWZPJ crmnJibSvuUk4sWKG/IuZLzlk2UW3jdlHPNH0UBS8mxDa1opJZ7xY3PWSurthlKD7nHV sDmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lRzrQwhMU5K1R+FJHTlsmI5L3Ae0ffZFkwYoksiVqAg=; b=BGqdj4e94wVNuY87G38NBEA5mN1fwVfv5ua3O+LoEMSR10QH7mRvUj8DUNuiBFlnT1 2ogWZtuJ0l5+xzxKQQOtqvPpU8kvlH0tS2pwotMivvNEFkJzV5b7u2K4mxJ0NFubROyf WbcN3zKk/HOAChnLcOpuUkZf4jqsltzKfc+itwIRSYReBxLc7cwN6iGWxnykGbIH9zK5 ev0pGWuugpwSfaO5AnzU2s95jpmog3IhdEedqZf3UwOuFgKbbjWeO2WtFxHK0PWZIGKt 1+1B5JW5KbpvzQuBgRjXXgnTI2+mBuw3GE1l/MGrXge5ia382bUw62gRNJ0fITXH0eml Pqnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@firstfloor.org header.s=mail header.b=reAgR5jj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g81si1122018oia.8.2020.04.07.07.20.48; Tue, 07 Apr 2020 07:21:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@firstfloor.org header.s=mail header.b=reAgR5jj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728997AbgDGOUG (ORCPT + 99 others); Tue, 7 Apr 2020 10:20:06 -0400 Received: from one.firstfloor.org ([193.170.194.197]:40912 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728737AbgDGOUG (ORCPT ); Tue, 7 Apr 2020 10:20:06 -0400 Received: by one.firstfloor.org (Postfix, from userid 503) id A6FD78733C; Tue, 7 Apr 2020 16:20:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=firstfloor.org; s=mail; t=1586269203; bh=lRzrQwhMU5K1R+FJHTlsmI5L3Ae0ffZFkwYoksiVqAg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=reAgR5jjyJWwcXa6izYSZ7QW82J41bt4hnpQ9Fr3T6bRdmGKs3HnL4XvvYKvycXVb femjynZgUxgi2MBsoha0TLacKsKqpIB3rcNbd4w6qZRoukub6fI375GwmK857nMhFz +cXTpLXOQ6j7+B/C9TgdB6fJssIIHTDuuFq2UTAY= Date: Tue, 7 Apr 2020 07:20:03 -0700 From: Andi Kleen To: Keno Fischer Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Borislav Petkov , Dave Hansen , Andi Kleen , Kyle Huey , Robert O'Callahan Subject: Re: [RFC PATCH v2] x86/arch_prctl: Add ARCH_SET_XCR0 to set XCR0 per-thread Message-ID: <20200407142002.jxzc3xcuyoznjgkh@two.firstfloor.org> References: <20200407011259.GA72735@juliacomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200407011259.GA72735@juliacomputing.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Thank you in advance for any review comments - I thought the comments > on v1 were quite helpful. I understand this is a tall ask for mainline > inclusion, but the feature is just too useful for me to give up ;). > [1] https://lkml.org/lkml/2018/6/16/134 The rationale from that post should have been in this description. You can already do what you want using the clearcpuid= boot flags using the infrastructure in [1], which is in newer kernels. So to disable AVX512 you would use clearcpuid=304 and the AVX feature set should be the same as Haswell. To disable AVX2 you would use clearcpuid=293 and you get the same feature set as Sandy Bridge. A boot option is not as convenient as a run time setting, but has a lot less weird corner cases. -Andi [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kernel/cpu/cpuid-deps.c?id=0b00de857a648dafe7020878c7a27cf776f5edf4 -Andi