Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1617824pxf; Fri, 26 Mar 2021 10:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0fhe3R8qGrHDwvwzVutjNLqebC04WqtdiE5js3k+uHJWEUmQ/DFtFJ6YN6fSfI8104yAF X-Received: by 2002:a17:906:f283:: with SMTP id gu3mr16516006ejb.91.1616781350859; Fri, 26 Mar 2021 10:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616781350; cv=none; d=google.com; s=arc-20160816; b=nDv0O1M8CjA3yjRmy4FVgJ5dkfUw7laGs/R3HlHoqY2fAlMimeuWTOk4xApfptsC+6 2ufKcltRN0W+eIfDF7NoPyQoA1e7XDV+JLh6u/rzdnsow184xV0of99JIzqcuYcqkm4Y A4MMrkAGdrO4nVbHqpaWlvpWmKU+AO1JZJnlgzbw8eRqwvStto0nMlZFnE58r/XW41ZX j/xfiUH1/E1rUuIXTvKAJMkmjndQGIzWy9bd/kcKJz3z6XfQfRJ535eX3nwucjVRZEYM BEKWy3GzmjQPA+XRCzulwB3naaSWmclXWc8EZB+tkgZO3FGfyyuRGiyZ6MogKeWg1V0V rJpw== 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; bh=X0TLaqtqsYqy5cUnEclBBX/cBG3TFyNiJCvgVTFjh6s=; b=TgalWRbSqpBQcA9l6NOtHW3GFrfedo3DlxCVCeurL8apdGKBXTPDKhHgHQ8tMZtMDT +mtloRM7tbN5xzGQnMU1Qjuy2YlbtrrtJiEmxd3Ld0Dg1QXtdu8MBuZzm5xtDutobuBK cCKN2+xiA51qxWLjNrhL+ffO/uGeSpVyMN0yg8x4kbCWHKnYLjCoC5aHinUhPkrL2igI CQrdUqhV5vPRuW2HRr0XRRNaR4xC4OyundaDx20oLzvJn4envK1latQZnEvAHYvJ9nk1 YwUb/6Vj9ROOmlvDjXpbauxR7bUVjynsp4XmUZk8l84wzey74E6TWTHXdBN6lmYhntXF z+eg== ARC-Authentication-Results: i=1; mx.google.com; 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 hs11si8829869ejc.375.2021.03.26.10.55.28; Fri, 26 Mar 2021 10:55:50 -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; 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 S230288AbhCZRyX (ORCPT + 99 others); Fri, 26 Mar 2021 13:54:23 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:36383 "EHLO mail-ej1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbhCZRyA (ORCPT ); Fri, 26 Mar 2021 13:54:00 -0400 Received: by mail-ej1-f43.google.com with SMTP id a7so9701633ejs.3; Fri, 26 Mar 2021 10:53:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X0TLaqtqsYqy5cUnEclBBX/cBG3TFyNiJCvgVTFjh6s=; b=qSRiaX/8FmwbwAPPAXAGOI0YYWrHDN7mmE9eq1mHiNGbG+aGYNs630H/IQTRwR60pR teDgZLsh/T1Csa94J42WP1hocj2l3v/Mhopz0RLN/lZWBfQSH7wqLpd2bTlq1bIQott5 A2sV3wHBx18AF1x/CXbbP8J1WISrPOuZq0o286kgR9087R6Z09BIhtPQU9EYEKqnlPbJ J0zGdixzdVwgJGZERBOnSpwPzd46eAQTHHpaWEzfXMErz//DOo8M74X4m1sTk30fk7Q4 1HRwUxnNM4YldutB7H4X1c6lA4MBtlTPWjf0CC4aZwDX8Yiz3qP1E+geAy0+j3bviNJo FnjA== X-Gm-Message-State: AOAM531PuV/3fi9Vvsh6587rdzqzm0f1bUFkwv3+pRniSzhx1MvAGQBs nWgHw+Fsgnl1TqtNCutGsYKrzvV1wTH9EpU0rauva5uJ X-Received: by 2002:a17:907:ea3:: with SMTP id ho35mr16851333ejc.219.1616781238988; Fri, 26 Mar 2021 10:53:58 -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: Len Brown Date: Fri, 26 Mar 2021 13:53:47 -0400 Message-ID: Subject: Re: [PATCH v4 22/22] x86/fpu/xstate: Introduce boot-parameters to control state component support To: Andy Lutomirski Cc: Thomas Gleixner , "Chang S. Bae" , Borislav Petkov , 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 Fri, Mar 26, 2021 at 11:48 AM Andy Lutomirski wrote: > > I submit, that after the generic XFD support is in place, > > there is exactly 1 bit that needs to be flipped to enable > > user applications to benefit from AMX. > > The TILERELEASE opcode itself is rather longer than one bit, and the > supporting code to invoke it at the right time, to avoid corrupting > user state, and avoid causing performance regressions merely by > existing will be orders of magnitude more than 1 bit. Of course, all > of this is zero bits in the current series because the code is > missing.entirely. Please explain why the kernel must know about the TILERELEASE instruction in order for an AMX application to run properly. > This isn't just about validation. There's also ABI, performance, and > correctness. Thank you for agreeing that this is not about unvalidated features. > ABI: The AVX-512 enablement *already* broke user ABI. Sadly no one > told anyone in the kernel community until about 5 years after the > fact, and it's a bit late to revert AVX-512. But we don't want to > enable AMX until the ABI has a reasonable chance of being settled. > Ditto for future features. As it stands, if you xstate.enable some > 16MB feature, the system may well simply fail to boot as too many user > processes explode. At Dave's suggestion, we had a 64 *KB* sanity check on this path. Boris forced us to remove it, because we could not tell him how we chose the number 64. I would be delighted to see a check for 64 KB restored, and that it be a rejection, rather than warning. At this point, as there is no way go down that path without manually modifying the kernel, it would devolve into a sanity check for a hardware (CPUID) bug. > Performance: > > We *still* don't know the performance implications of leaving the AMX > features in use inappropriately. Does it completely destroy idle? No. > Will it literally operate CPUs out of spec such that Intel's > reliability estimates will be invalidated? No. > (We had that with NVMe APST. Let's not repeat this with XSTATE.) I acknowledge that the possibility of broken hardware always exists. However, I don't see how the experience with broken NVMe actually applies here, other than general paranoia about new features (which is, arguably, healthy). > The performance impacts > and transitions for AVX-512 are, to put it charitably, forthcoming. I acknowledge the parallels with AVX-512, in that AMX adds new instructions, and it has even bigger registers. I also acknowledge that the AVX-512 rollout (and arguably, its brief existence on client CPUs) was problematic. My understanding is that Intel continues to learn (a lot) from its mistakes. I believe that the AVX-512 credits problem has been largely eliminated on newer Xeons. My understanding is that AMX is implemented only in CPUs that actually have the hardware to properly support AMX. If it were not, then that would be a problem for Intel to deal with in hardware, not a problem for Linux to deal with in software. > Correctness: PKRU via the kernel's normal XSAVE path would simply be > incorrect. Do we really trust that this won't get repeated? Also, > frankly, a command line option that may well break lots of userspace > but that we fully expect Intel to recommend setting is not a good > thing. There is no analogy between AMX and PKRU, except the fact that they are both features, and at one time, both were new. I am unaware of anybody at Intel recommending that any cmdline be set that would break userspace. thanks, Len Brown, Intel Open Source Technology Center