Received: by 10.213.65.68 with SMTP id h4csp2888311imn; Mon, 9 Apr 2018 10:36:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/XIr3ufxzA/kXg57/tGd8IULiK+JOidpTUwC44uwDwPxEm9R4Cn9RCHFPqV1iziEuDYzdb X-Received: by 10.98.172.15 with SMTP id v15mr9565115pfe.129.1523295376028; Mon, 09 Apr 2018 10:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523295375; cv=none; d=google.com; s=arc-20160816; b=GCJa2QIr0mm7WwDq5fYUATe6C2832/yVJMhnJdxyoTf53YQxiUizwkQzv4Hqr9gERX mTViYOqpyXUYMdcz3bsM9y8Lsi8ZRI8TZtQ0Kvt5CnylTpkdgwTkUAivRkr0+7e0ZNjP pN5uwkjhXeqKvBKACHAEVYLxND/iQ/JQsmJfIRBNE1qxAMNATFIqCzqFNH7DGqRlKDv3 U0u12TVnfJgqa21SmJKI/m7/t5xlBbFaR7sK1Jgd7OI/55f+ac6MGERa5nsPBJLHHuzY NrdWza7t39rCRy5Ea3vpRaelXPfWD+7UGU2YIgeI0+9ZmyeIHN7gfLj2s6JeZ0a3zh6d qp+Q== 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:dkim-signature :arc-authentication-results; bh=PDaxqT2uf9s+Xu4+3lTUGe8KJQe1YXyiD1FZDUT1QPQ=; b=o9+h7qi4CfTxafEosEGje3hYuJyLmCOkx+DqLvXjMO+dmhF0dNa7l2tBwgAbUxbjd/ vCd49qbneiaW218CUDz338F7bdHZSf/LHFSx4qND7fzt3lwTY8QQ38mkHvtDKLVGfgnD x+KhgNfJn3pH8QObuXH7MN0Tkt/or7o3MQvhkY7ruobBYFDKtVL2mpyfSfPgpwN0t9qR U937LDt3C9068hExO6nhy8b3shEAwE7pxBjpkUiTInfI/IaVIqcLtVvY6t9FfiHv1Ve1 NvongfAJMgjW0hEDJvKe8y0N/l+wziytfZb0lmcP3BHtTqtf8OfSmSEB+Ixz8YUP0Nrt HRVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=B4oLVS+x; dkim=fail header.i=@linux-foundation.org header.s=google header.b=S1ULv0OS; 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 y70si530342pfg.121.2018.04.09.10.35.38; Mon, 09 Apr 2018 10:36:15 -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=fail header.i=@gmail.com header.s=20161025 header.b=B4oLVS+x; dkim=fail header.i=@linux-foundation.org header.s=google header.b=S1ULv0OS; 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 S1752422AbeDIRc4 (ORCPT + 99 others); Mon, 9 Apr 2018 13:32:56 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:40394 "EHLO mail-it0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbeDIRcz (ORCPT ); Mon, 9 Apr 2018 13:32:55 -0400 Received: by mail-it0-f42.google.com with SMTP id u62-v6so11267452ita.5 for ; Mon, 09 Apr 2018 10:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PDaxqT2uf9s+Xu4+3lTUGe8KJQe1YXyiD1FZDUT1QPQ=; b=B4oLVS+x/Bqp5Bu+SEQONqt4hcDFLI8jCX5XOkUj2HxKi51yz/TEqHwyKfiVaYv+o/ jPXhcWgmOTG04U3jHzR3QY257FBWQMiwNdAfjBPzhRcsZo2EuKt6wdXr4aYPe8Q5s5eC WkAkK72xEnkVWjavDQFXdHeYiOTaAq5gom5KexMjQWBPKg0OvGBdyL9hGBGMME/ed3Eb hN+0CysgvWN+Ry0uVln6lQGx2Rnza3ddrPZXcY2SVump/TzOHP9IJt9P9NlDyZz9p0Do cNKCY55xgDo6BAUXi1rP/4oZU2bmB5k/wwMZ+C+h4ImckobOQKU5D51SLLgsbh8++rzA OHSw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PDaxqT2uf9s+Xu4+3lTUGe8KJQe1YXyiD1FZDUT1QPQ=; b=S1ULv0OSGqQvsaBT2kYBr4D/u4wv7/1J7/cFtVSV23bB3rBFwPybEmF1qJfc1IpweQ cUP4bILQsWdduL3E7yolR43EtkIV2bmOFUuOeGxGdehHJwepFy222D2Eegb30EBx8oE3 g1j7VeIiBhCu8Iv+WTL6J9x/+4sQQew/SxS1w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PDaxqT2uf9s+Xu4+3lTUGe8KJQe1YXyiD1FZDUT1QPQ=; b=eQkTEKCiRhD3VITkOzpD90NHCEbkQpGJ4uNULje5h5F3LBSA8TojPpyHlcYDDgchS1 28h0SiI292nyjTPNXPChVWdFpw0fHTZ3sCCchx8tRKn1lYbJguM78FW8ytXhTBi/MTYp E3Xhwt3JDzTHBH/wUimVWBWHdCEKs9D587z+7fJk4LBoA/gdNH+c75LTP0XRhfj1es3Y 2WeuV+RsWBQFORiZB/udni4nv+eNh+ne8KUOviCFz4xMIpiexZ9tDBJSgJzpMg9GCOw5 uVCmsbOadoZUSuNu0SSuDOXP/14gM6wHG0UAtQBiOS5PsFmf3kIgKNRnpYdG1rAJpkiT fxTg== X-Gm-Message-State: ALQs6tD8bQTbuNnqHJAE6Wi2/j2wfAcNjA5VjACKuGjbrJRBNYmIsaQO pRt2yjv/H/lssXGBaOlQylus9uD1FGhqIxWS/Wk= X-Received: by 2002:a24:7693:: with SMTP id z141-v6mr944455itb.113.1523295174204; Mon, 09 Apr 2018 10:32:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.95.15 with HTTP; Mon, 9 Apr 2018 10:32:53 -0700 (PDT) In-Reply-To: References: From: Linus Torvalds Date: Mon, 9 Apr 2018 10:32:53 -0700 X-Google-Sender-Auth: _kN8-mqOcDMVD2dHhIzSFlnqusI Message-ID: Subject: Re: [bisected] 3c8ba0d61d04ced9f8d9ff93977995a9e4e96e91 oopses on s390 To: Sebastian Ott Cc: Kees Cook , Sebastian Ott , LKML , Heiko Carstens , Martin Uecker , Ingo Molnar , Miguel Ojeda 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 Mon, Apr 9, 2018 at 10:14 AM, Linus Torvalds wrote: > > Ugh, I find that really nasty to read, but it was obviously done > because we hit this before. Side note, we have a *lof* of those "__x" and "__y" names in the helper macros. Clearly min/max was the only one we really had ever hit (because it used to have that UNIQUE_ID thing), and the patch I sent hopefully fixes the only real problem, but it would be good to perhaps look at this in general. And no, -Wshadow still isn't the right answer, because while it warns about this, it also warns about a lot of perfectly normal cases where we have shadowing of names but it doesn't really matter. Maybe "make __UNIQUE_ID easier to use and encourage that model" is the right answer. Right now "__UNIQUE_ID" is actually really nasty in several ways: (1) the already mentioned "the fallback is broken for same-line use" This doesn't really matter because both gcc and clang have _true_ unique macros, but we should probably remove the fallback as "know broken and not really guaranteed to give a unique ID" (2) The argument you give to __UNIQUE_ID() is pointless. The only reason it exists is because the broken fallback case is so broken and by definition __LINE__ will be the same not only if two different macros are used on the same line, but for trivial and common case of *one* macro using it. That second problem is a problem only because it encourages crazy naming. For example, in the patch I sent I used "__UNIQUE_ID(__x)". If we actually just wanted a prefix, it would be more logical to just use "__UNIQUE_ID(x)" instead, but then macro arghument expansion means that you don't really get "x" as the prefix, but whatever the _arghument_ x was. So then I have to use "__x" or something just to avoid argument expansion. Maybe I should just have used a plain number (which cannot have the argument expansion issue), but that doesn't work because the prefix is directly attached to the unique number, so using __UNIQUE_ID(1) and __UNIQUE_ID(2) is actually unsafe _too_, because the numbers can end up not being unique at all. I really do dislike __UNIQUE_ID() for all these reasons. It has various really subtle problems that make it unnecessarily hard to use and/or have odd nasty issues. I think there's a reason why __UNIQUE_ID() really isn't used much. Linus