Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp937736pxf; Thu, 25 Mar 2021 18:44:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXSbB4Ba3yGXNcEmUngbaNCeDFMBivDtT8JuVaOptRjAEqKm9s/pSv3Gc72mxileGS84ua X-Received: by 2002:a17:906:4407:: with SMTP id x7mr12631838ejo.546.1616723064457; Thu, 25 Mar 2021 18:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616723064; cv=none; d=google.com; s=arc-20160816; b=eLgG8GTcVoBZ2ZTtBLBnlD3YiDjGdp2Qh1VN0acw70tulzd/mL6ghJXevpKn9aFAOD zTVJ/WQPThRy0CxRE0ly0ue+NNObcK7ConyXRSAKoOpbBLCZDV/WFZBrtkY45mDasA7r MDyzs0qOAgm5h+yHvieJyKVQOMVtyckqteLUfnS+OnkHnxEblq7FHN1+m36s4c0O519u Z5g/fPBrn3dLsdYTffeQc3r4l5DefibXdHhcBXmtZaaIdnsbA7CKgLboh3lMzsaWuTpr JBcwtM7ejQAfWGnA6takmtxEg8ELAkkROzZoPvSR7PGluXccLPf8i/wa2dx2OPZ0z16B /mTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VoWxzVOBi8UJejopi1jfdMN/MMkylaGMwalNlavZIdk=; b=RUIoSRVXCHzcpTq1jVk3NGMXZIli4kzYWs0i3dX6lA4auWfMkEGDhdda/k69Zp6gLf hSD0r2giyKgrV8LTzFZtAmgsPHE7l6aw1LrjzO+VH4FVVnxfEo0dCdLeLfRwI4SWS0+c mWqDvtFzdzVHNZg+BieAD3v+b+i7msOp93Ciln0J2PtG92OlbvinPDR2NGbR+NZ/609T j1+Xxy3ov0Fy5e8UYRTpUIYv0yE/cuSIWRMD/Xq4cU8UOifZSFDDsBWDmuQTYRRNAVce pD7o5+Uxl1EK5Zrr4cUmG2Iz9qUrr2C2vLoMzDOar9Rbq6w/NURTsdZxlz9z4bUsxz5t gciw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IQP5gU6e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si5763002ejr.549.2021.03.25.18.44.02; Thu, 25 Mar 2021 18:44:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IQP5gU6e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230272AbhCZBm1 (ORCPT + 99 others); Thu, 25 Mar 2021 21:42:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:46278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbhCZBmE (ORCPT ); Thu, 25 Mar 2021 21:42:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DF98619F8 for ; Fri, 26 Mar 2021 01:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616722923; bh=lhdlrdc+hU3vE/LlyJ7AsGL023uH4DfKolrpWa1GkuI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IQP5gU6eEk/LsjqI4eUtnZa9SR94HEoEXKJIWFlhwJlKZfrHcJNUIIe82SdzD5C1M mEkSlsIUaMYxnoKGEYp7JzDKMlM6+aQcvRHrP1fGjHCVx+VlF8L4L3pYUFrfcgdR6q MeDDgio5j4owvGT03LpW6ieChOHCk1bxo2Lq8v3aCWKvrCHlQ5+/fZJgyrprR0nLdw iufe3pPP5fIv+7sVfoDucjPgJ2rHfAhKcUjn1QPQMG8riHFfPr3RPVtm3qm9G/MXTl FxZZpmPySGNdx/t7rjzLmu/sawSS9v/+kRCp3GTjfAdMCyMS4k3mh9aDUCuAziS7Wk 7NgPuLDhFj94Q== Received: by mail-ed1-f52.google.com with SMTP id h13so4536572eds.5 for ; Thu, 25 Mar 2021 18:42:03 -0700 (PDT) X-Gm-Message-State: AOAM531mNujl8YpsxZXN+Db6tn7tZuAr2AW+YBKkCK16nP46OelHqf6X +HAuL7/+eUpvLOfWM4qEEaOnBIhLmyQfT9caPdODNg== X-Received: by 2002:a05:6402:382:: with SMTP id o2mr12604595edv.238.1616722922221; Thu, 25 Mar 2021 18:42:02 -0700 (PDT) MIME-Version: 1.0 References: <20210221185637.19281-1-chang.seok.bae@intel.com> <20210221185637.19281-23-chang.seok.bae@intel.com> <871rc9bl3v.fsf@nanos.tec.linutronix.de> In-Reply-To: From: Andy Lutomirski Date: Thu, 25 Mar 2021 18:41:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 22/22] x86/fpu/xstate: Introduce boot-parameters to control state component support To: Len Brown Cc: Thomas Gleixner , "Chang S. Bae" , Borislav Petkov , Andy Lutomirski , Ingo Molnar , X86 ML , "Brown, Len" , Dave Hansen , "Liu, Jing2" , "Ravi V. Shankar" , Linux Kernel Mailing List , Linux Documentation List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 25, 2021 at 3:59 PM Len Brown wrote: > > On Sat, Mar 20, 2021 at 4:57 PM Thomas Gleixner wrote: > > > We won't enable features which are unknown ever. Keep that presilicon > > test gunk where it belongs: In the Intel poison cabinet along with the > > rest of the code which nobody ever want's to see. > > I agree, it would be irresponsible to enable unvalidated features by default, > and pre-silicon "test gunk" should be kept out of the upstream kernel. > > This patch series is intended solely to enable fully validated > hardware features, > with product quality kernel support. > > The reason that the actual AMX feature isn't mentioned until the 16th > patch in this series > is because all of the patches before it are generic state save/restore patches, > that are not actually specific to AMX. > > We call AMX a "simple state feature" -- it actually requires NO KERNEL ENABLING > above the generic state save/restore to fully support userspace AMX > applications. Regardless of what you call AMX, AMX requires kernel enabling. Specifically, it appears that leaving AMX in use in the XINUSE sense degrades system performance and/or power. And the way to handle that in kernel (TILERELEASE) cannot possibly be construed as generic. Here's a little summary of XSTATE features that have failed to be simple: - XMM: seemed simple, but the performance issues switching between legacy and VEX are still unresolved. And they affect the kernel, and people have noticed and complained. - ZMM and the high parts of X/YMM: Intel *still* hasn't documented the actual performance rules. Reports from people trying to reverse engineer it suggest that it's horrible on all but the very newest chips. For some reason, glibc uses it. And it broke sigaltstack. I have NAKked in-kernel AVX-512 usage until Intel answers a long list of questions. No progress yet. - PKRU: makes no sense as an XSAVE feature. - AMX: XFD, as I understand it, has virtualization problems. And the TILERELEASE issue is unresolved. Intel's track record here is poor. If you want the kernel to trust Intel going forward, Intel needs to build trust first. > So after the generic state management support, the kernel enabling of AMX > is not actually required to run applications. Just like when a new instruction > is added that re-uses existing state -- the application or library can check > CPUID and just use it. It is a formality (perhaps an obsolete one), that > we add every feature flag to /proc/cpuid for the "benefit" of userspace. Even this isn't true. AVX-512 already Broke ABI (tm). Sorry for the big evil words, but existing programs that worked on Linux stopped working due to kernel enablement of AVX-512. AMX has the same problem, except more than an order of magnitude worse. No credible resolution has shown up, and the only remotely credible idea anyone has mentioned is to actually mask AMX in XCR0 until an application opts in to an as-yet-undetermined new ABI. --Andy