Received: by 10.223.176.5 with SMTP id f5csp3100676wra; Mon, 29 Jan 2018 08:46:31 -0800 (PST) X-Google-Smtp-Source: AH8x225KhA9Xw654O4U6zNeggJj+SOXLqOaAWcB6Cla1VLdaLN5tYHPLrBHOCqiexx4NOSzsLMct X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr22218630plk.109.1517244390970; Mon, 29 Jan 2018 08:46:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517244390; cv=none; d=google.com; s=arc-20160816; b=LAPDp3b1ZdvaOJUUQ39j7q7TnTA3Y4vf+h3b2eO0SC06XcTeG/ZTZgDL4TKeDsx4wj hcauQMRjl1bmEufIr8fw4i6ANsmZn7+nP4skFypHO4j2ot3LYs77P0xfoJrjYptedYSu QUQwmbTxATEb4cyqM8P04jwwtI2k9RxJXJ3qJzGg5Lox/Dt+Ttfpt5FEHMQAEMvjaB0F mf91IUgVihhl5nX+zmdZWIg8hoNUT94xqksQi5Zvf56F/rykvrlJRB6NMgQW7/p5kkm5 FwfdNLlskwe2RbUMp3levXADsOnEN+nNsWDUIJRbMWIiYBsuUq+u2q/hkIh8TzyX7EEp rgdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=zdZpPAPcAebGXQktA0kRi4NK/f2rsTvr++wx40cuSuI=; b=mjTGH9FOVzq2qn8RrQwbOUVHIMeUTPiRZ6mPm9QRf+KCfQsH4efRgCvBHGQ/W1kHRF p7mpgw7RR4GjFGa/GM0rXajhZeZRbTJMpFAKaT+5MOmUn1RSDWJE6EicSnmQKFyK6DTu xIV2uqH8dkHZJ9RBHQ59U4BBdxrFUhP7ADqa69OjkGCy+D7YO8yv0qwpLi3tzz1Jg63y WoNbOfgCJjLNlVjLZcsojnyN78acH0dtscyc8DqqyC+sigp5Kbfb4AIWn6KACjHfknxK V/JiEQ7zRhCThaRIpaPDVohHsKQMnVcl+8WQrQCqYzrhs7ZXxfmUgqU23mn1yVPebGqn 2W4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=M7Kifane; 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 o16si855375pgd.125.2018.01.29.08.46.16; Mon, 29 Jan 2018 08:46:30 -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=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=M7Kifane; 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 S1751408AbeA2Qpl (ORCPT + 99 others); Mon, 29 Jan 2018 11:45:41 -0500 Received: from mail-ot0-f172.google.com ([74.125.82.172]:34135 "EHLO mail-ot0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbeA2Qpj (ORCPT ); Mon, 29 Jan 2018 11:45:39 -0500 Received: by mail-ot0-f172.google.com with SMTP id x15so7140711ote.1 for ; Mon, 29 Jan 2018 08:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zdZpPAPcAebGXQktA0kRi4NK/f2rsTvr++wx40cuSuI=; b=M7KifaneLOV0Ud64SCb5WV/Xc127k+AGhcpNfv9VXo/UIKc3/W7j7MyZuvax/OuwYD aGmei4nEDyemRkCBFAscPU5wDmZjiT7lNNoNSgxudpmu/lJtyprDfJfOY0CypPhxz2ga orlqLDec9lsMZwn/Pty6zq4yMsQqejqIGrICYBi1Nl/AvlvKT8Ip5yQY/fx4NFzZubjl 4s4ub6fwf27YDkai0Hr2rbEQFeB8vIfcQc/tl+K1wmOaW1jAp0MY1AaiGuHHH72WKO9R mlUnc6bAVI3yWi/Xubi9dTRJZTtjOMgpEXTibVvZNBzJ/r4oWltyRqwdbENchb5J4Bst A7FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zdZpPAPcAebGXQktA0kRi4NK/f2rsTvr++wx40cuSuI=; b=Ocg9UmGm0GqkU/XOfdFG+h8lI39j935iyv+ZGywiHAAdvSk3V9JYkkigkUe3ze+A2s dt4vqgCUjXJfVGvefP2ExCNyZ/9HD/NqUQ9EfKu3Sm8zOS5ZfC/5R9zVhMOjaFrZ5HM+ F+VQobmrFiNuNK/MvuO0P+MBaX0CKfHh9UaXA57nT5vaoy37w5H/cp8bPn8vlmh/hkKT y2bY3G8xej4tkjCak15UPzpfxfWV34eaW3RvKP48jix+y2HI0skxWWkmtWt+ak5Pbm1I Og1+nrxReMAQrQZ0BsttmbIBg6rDWwH8qpS6pJryxqEPi676giikkegn0LKCX6+aFr4U s1fQ== X-Gm-Message-State: AKwxytcplgyfCP3PAN2eIjnnIU9mdvW46DoS37ig43PZDy8QNeF78ebu 2w0au5QWXz0aiN4Fedg8M2MAx+Ag3+O2AMnnjfFppA== X-Received: by 10.157.35.61 with SMTP id j58mr1220966otb.220.1517244338713; Mon, 29 Jan 2018 08:45:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.62.91 with HTTP; Mon, 29 Jan 2018 08:45:38 -0800 (PST) In-Reply-To: <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> <20180128183309.j7zkoyqblich4zhq@gmail.com> From: Dan Williams Date: Mon, 29 Jan 2018 08:45:38 -0800 Message-ID: Subject: Re: [PATCH v5 02/12] array_idx: sanitize speculative array de-references To: Ingo Molnar 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 28, 2018 at 10:33 AM, Ingo Molnar wrote: > > * 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. This is the feedback I can take action with, thank you. > >> 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. I reacted to your "for heaven's sake", I'll send a v6.