Received: by 10.223.176.5 with SMTP id f5csp1956456wra; Sun, 28 Jan 2018 10:34:55 -0800 (PST) X-Google-Smtp-Source: AH8x224EgiqoKMvJQ1wJ7wvC/J9UrKy1XMnhEFBPGVJAK9Fu8eiuZlY1yc2Lpp9TvBWMjbgYYob2 X-Received: by 10.99.111.68 with SMTP id k65mr19967806pgc.446.1517164495488; Sun, 28 Jan 2018 10:34:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517164495; cv=none; d=google.com; s=arc-20160816; b=TesVjDEqboBzKi6IkiArktLZHoM+jpAsht7KSxuRBRgWFbSGf5dX84NNvIklev0oLF Pu1zZn/lMAXs7SFYy9+cF1iVRjTJwMk0HGsClXtfF1YohoBRrdiSNxDDMAFNHd1hPzz7 Q2DCiPNVNhyt0gL3mx+B2TiTrSR9HrJtydskMYVQys+dsfI6nGis1M0XPXDoQHQzCuKM lhzDNwAxBWmCOYrzD0CXvhjSfGD+4pmWDrXCWQCZDkBZyhStPzQCmJ+u8qKly84ociC8 GWMy75sTUt4kTkdnVoyvjRl/hWUVTxSuOfd5mpxVTuA9MSPnVJDWd9YlvcgfnWpQo2+f wGrg== 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:arc-authentication-results; bh=yNQ5rNefHX8PqarGCrWwdoiiqpV5Nwnkfisx2jR1MTU=; b=BrpPXcf9Kp7EPrl1lh1oCC9UZsB+fmpHg3Ij3nGqeKOZigEwRcLQ4H8uq5NVScH5hE +QgAKDpgLRDD88ZFb6j915fgjluvBOF7AnzmUpKaPvF+x3As8QTWD6NM8tDQV21B+oA1 LFyPkZCyJ1ENADsEya/cdMFTXd+7IfBBZ6hNWRyMtjouXazCz9lZPg7cFW3bLFnZ+w7z c3DXZEpqJMDtvJnIrlXyOEmfJjJdOgHt9cjSFvh+243tFpYAXeKKMKMJ+yGehwCAGHYt J+fPrRY8IqlAhjy1NG+MZwUBTnLhQxAtXDz/8Bj5f6xasDD/TpCdCE3Fwe+VMqEuuNtk sRtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tKyXR6KQ; 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 y1-v6si3108484pln.220.2018.01.28.10.34.41; Sun, 28 Jan 2018 10:34:55 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=tKyXR6KQ; 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 S1752180AbeA1SdQ (ORCPT + 99 others); Sun, 28 Jan 2018 13:33:16 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:36100 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbeA1SdO (ORCPT ); Sun, 28 Jan 2018 13:33:14 -0500 Received: by mail-wm0-f48.google.com with SMTP id f3so29694789wmc.1; Sun, 28 Jan 2018 10:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yNQ5rNefHX8PqarGCrWwdoiiqpV5Nwnkfisx2jR1MTU=; b=tKyXR6KQpPsJPgJouIJY0LStEbJZSD5pI8EYt7ireilovxJqQiQvn5uVg6aMJkxKGD Jefq7w2Mze4A6nozMfY402Y9WZBSC5IfzTAfkzIGVoJkC5e21ojGX7gaiDxrlWobk1OB kxjqu+YOndYVqTifd2WWMOI2vH0laNCHZ9mpYMdiQskpVUdONRuiHsoG6tmIzZJKV9Ka Zvo3sWCX0H6e3tIiVrF2+b9qNyfaR+yyEnVnZK8q/GXXW2eEOZl5qHDenCRS7h9Si8rO SQMTAdsUn8aJO3GbsJXJVHkY7cSYEfm937PqgGhhInPsIZcKCN6LqMqDSkh23IwKbCgm /gjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=yNQ5rNefHX8PqarGCrWwdoiiqpV5Nwnkfisx2jR1MTU=; b=JX/heveO/4UyKbZYdFU//9O6+tU6lrKDroArnfuvifPgSN7blf9L1Qy91SjaOkJvI4 FICDR9l+6a5n/c/nP06kSSTkz/goYhVx3WkgulU3IWTrq2KQjOqBNXvpK+SAMTO3TTnZ igrUn5d7ExQw72H5Ih/ULeX90mX/oIrDnxdkmwL0PwUv0pOb/yOAyfl7beckU/JrhRvW t4EHz1HjH6bjP/7J95ldPcv1TJrjVqVpKp7Y4jy5pWDrNL/we02hpI05WzAsBH0UMRPz edXIOoki4kugnVz7pAOiY9CSzXzv3SplzHi0EKUUVw/ZTt+YE8NBvomk31ZGtIkKKjdf mdgw== X-Gm-Message-State: AKwxyte/HS9zL+m+byu33UsJ+J1mAbQ/4tGzR/q8RSr66MsQM5Pnq1mq fnltjsLg59h1tQtkFFxCzIU= X-Received: by 10.28.186.132 with SMTP id k126mr15110591wmf.159.1517164392908; Sun, 28 Jan 2018 10:33:12 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id g64sm7211504wmf.20.2018.01.28.10.33.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jan 2018 10:33:12 -0800 (PST) Date: Sun, 28 Jan 2018 19:33:09 +0100 From: Ingo Molnar To: Dan Williams Cc: Thomas Gleixner , linux-arch , Cyril Novikov , Kernel Hardening , Peter Zijlstra , Catalin Marinas , X86 ML , Will Deacon , Russell King , Ingo Molnar , Greg KH , "H. Peter Anvin" , Linus Torvalds , Alan Cox , Linux Kernel Mailing List Subject: Re: [PATCH v5 02/12] array_idx: sanitize speculative array de-references Message-ID: <20180128183309.j7zkoyqblich4zhq@gmail.com> References: <151703971300.26578.1185595719337719486.stgit@dwillia2-desk3.amr.corp.intel.com> <151703972396.26578.7326612698912543866.stgit@dwillia2-desk3.amr.corp.intel.com> <20180128085500.djlm5rlbhjlpfj4i@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Dan Williams wrote: > Thomas, Peter, and Alexei wanted s/nospec_barrier/ifence/ and I just checked past discussions, and I cannot find that part, got any links or message-IDs? PeterZ's feedback on Jan 8 was: > On Sun, Jan 07, 2018 at 06:24:11PM -0800, Alexei Starovoitov wrote: > > How about: > > CONFIG_SPECTRE1_WORKAROUND_INDEX_MASK > > CONFIG_SPECTRE1_WORKAROUND_LOAD_FENCE > > INSTRUCTION_FENCE if anything. LFENCE for Intel (and now also for AMD as > per 0592b0bce169) is a misnomer, IFENCE would be a better name for it. Which in that context clearly talked about the config space and how to name the instruction semantics in light of the confusion of LFENCE and MFENCE opcodes on Intel and AMD CPUs... Also, those early reviews were fundamentally low level feedback related to the actual functionality of the barriers and their mapping to the hardware. But the fact is, the current series introduces an inconsistent barrier namespace extension of: barrier() barrier_data() mb() rmb() wmb() store_mb() read_barrier_depends() ... + ifence() + array_idx() + array_idx_mask() This isn't bikeshed painting: _ALL_ existing barrier API names have 'barrier' or its abbreviation 'mb' (memory barrier) somewhere in their names, which makes it pretty easy to recognize them at a glance. I'm giving you high level API naming feedback because we are now growing the size of the barrier API. array_idx() on the other hand is pretty much close to a 'worst possible' name: - it's named in an overly generic, opaque fashion - doesn't indicate it at all that it's a barrier for something ... and since we want all kernel developers to use these facilities correctly, we want the names to be good and suggestive as well. I'd accept pretty much anything else that adds 'barrier' or 'nospec' to the name: array_idx_barrier() or array_idx_nospec(). (I'm slightly leaning towards 'nospec' because it's more indicative of what is being done, and it also is what we do for get uaccess APIs.) ifence() is a similar departure from existing barrier naming nomenclature, and I'd accept pretty much any other variant: barrier_nospec() ifence_nospec() The kernel namespace cleanliness rules are clear and consistent, and there's nothing new about them: - the name of the API should unambiguously refer back to the API category. For barriers this common reference is 'barrier' or 'mb'. - use postfixes or prefixes consistently: pick one and don't mix them. If we go with a _nospec() variant for the uaccess API names then we should use a similar naming for array_idx() and for the new barrier as well - no mixing. > You can always follow on with a patch to fix up the names and placements to your > liking. While they'll pick on my name choices, they won't pick on yours, because > I simply can't be bothered to care about a bikeshed color at this point after > being bounced around for 5 revisions of this patch set. Sorry, this kind of dismissive and condescending attitude won't cut it. Thanks, Ingo