Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp407743pxf; Thu, 8 Apr 2021 05:47:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4LatdPeHJmBDqiMidPE7SkOM3GfHYnpqYzMVWI+t6lDdLthUIq3i/Iznv2lKorepe82ku X-Received: by 2002:a17:902:525:b029:e8:e347:b07f with SMTP id 34-20020a1709020525b02900e8e347b07fmr7564149plf.34.1617886037767; Thu, 08 Apr 2021 05:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617886037; cv=none; d=google.com; s=arc-20160816; b=kqRt0INkLOsAYvgeFmChWw0u0gDCfVYFZg/GYfCrU+VasOL6hpqFbq16MJDRRGvfDc XaT1ymrM1uh5GsRvFrKgmilXs12NP2TXbiBiD9SMwIVcKqJ1f0MK08XmaHTgawkOXD0M Xwwj0VoGIuTAMa1YBr76nA7VhESrI3oHpEJDJFCWML78DiV0nnfjHOmB8fm5r6oarIpQ xVpCPj0owz4odic1FlylFOM3zz0KlhAmRI2qMYvFii7f55rCleHvPH844N92YWZ8MvHD 4AhCOQuG5GqsR/WB5C4rcG9MQ4IbAe0hRRPBc0AtrwmTw/vummuIeUZwah1lWULd0S/e 7k3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=UMuAklHy/tPt7YPBozpvIQsmWDAIa3a/la6+zoUVcdI=; b=Db+kCWjotPyahNfgOWNlFbzoYdWwAHGIEPIMDnPAVw8J0X7+aypVCgN4Rdof01EerE OxprcPyBpfRjeJhMqM1OFB6ja8tMMj4KfPT1g0LU/ieoPxiP0IaxYMb0H+9uESeUBIbA EShtda3MH5ya8VVK3pmYxJEizdqorNuB5mOhOQmCm3MylIgYttsJhqPqkyhDQUw+rkov jpY1y3PVXXULimF7featzyN2hvpJigp2O2Ph63mf4XO99Hq3Z/51fbZORX5xerSyY4Jo tFcKEJnA5L5oCjJVxagSAxamxeKdw28BKqR7ddizsTSKhY/Z63xoSy8ahMPjGRhozsWA tIFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=JXlbvdv6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si28308714pgq.547.2021.04.08.05.47.05; Thu, 08 Apr 2021 05:47:17 -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=@rasmusvillemoes.dk header.s=google header.b=JXlbvdv6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231221AbhDHMp2 (ORCPT + 99 others); Thu, 8 Apr 2021 08:45:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbhDHMp1 (ORCPT ); Thu, 8 Apr 2021 08:45:27 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C779C061764 for ; Thu, 8 Apr 2021 05:45:16 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id e14so2773613ejz.11 for ; Thu, 08 Apr 2021 05:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UMuAklHy/tPt7YPBozpvIQsmWDAIa3a/la6+zoUVcdI=; b=JXlbvdv6BKxL2QLt+A6EZMYCjKur7zKVGHA+SPjjhttU3LjU5J8CTsvMPL70CwGYsq CUXz1jkKLkBNcttlxCmAirFDD+kjBSkQXhxTFfLF/zDE+suTqi1E02kHIf/SGivtkXXC r7MEDlKMlo41vpb3rOrLkq/HnnmBY745AuXsE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UMuAklHy/tPt7YPBozpvIQsmWDAIa3a/la6+zoUVcdI=; b=iCKQH5gp5wWn0vOi33zaMQZ79CBIQs2i889MiiBqIxMGxIzAJ/MQV1frU5er1r/8pt AknqQ8/RXJ3w3GrOIGdQYPB6GiDc2RwrXUxwNDpKqSWwdns/FarsDwrwtSgtNrVgyW0/ b+3HLj+xkxrTgy4b6rj/91xT+TC4qh/pN/aITwKX49Gp//5mTzyFuBlmZ5MRLWYdKNRq fWaE4ULI3mipP0uTyOXzR5tE1pQzJqIvntCbnQr1z5H/FuWqUeqmjDiEz3votnZmG38G GBggLi2/Gr2G2jGPFHBqyZ+OdDB4cGUxYAPh/wXeI7sMwgfwt4C80flnozMQ4SKcIbGi qTfw== X-Gm-Message-State: AOAM531rGaR0t6oQACierpjjkulYoTDBBh2u82CxVKhGsHfFmrOVzivl YYOialwrUwrHy1c9jMF9ehGJnA== X-Received: by 2002:a17:906:1fd7:: with SMTP id e23mr400958ejt.528.1617885914623; Thu, 08 Apr 2021 05:45:14 -0700 (PDT) Received: from [192.168.1.149] ([80.208.71.248]) by smtp.gmail.com with ESMTPSA id r4sm14262813ejd.125.2021.04.08.05.45.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Apr 2021 05:45:14 -0700 (PDT) Subject: Re: [PATCH v1 1/1] kernel.h: Split out panic and oops helpers To: Andy Shevchenko , Michael Ellerman , Joerg Roedel , Wei Liu , Michael Kelley , Mike Rapoport , Corey Minyard , Bjorn Andersson , Mathieu Poirier , Andrew Morton , Tetsuo Handa , Vlastimil Babka , "Paul E. McKenney" , "Steven Rostedt (VMware)" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, openipmi-developer@lists.sourceforge.net, linux-remoteproc@vger.kernel.org, linux-arch@vger.kernel.org, kexec@lists.infradead.org, rcu@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Corey Minyard , Ohad Ben-Cohen , Arnd Bergmann , Eric Biederman , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Luis Chamberlain , Kees Cook , Iurii Zaikin References: <20210406133158.73700-1-andriy.shevchenko@linux.intel.com> From: Rasmus Villemoes Message-ID: <03be4ed9-8e8d-e2c2-611d-ac09c61d84f9@rasmusvillemoes.dk> Date: Thu, 8 Apr 2021 14:45:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210406133158.73700-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/04/2021 15.31, Andy Shevchenko wrote: > kernel.h is being used as a dump for all kinds of stuff for a long time. > Here is the attempt to start cleaning it up by splitting out panic and > oops helpers. Yay. Acked-by: Rasmus Villemoes > At the same time convert users in header and lib folder to use new header. > Though for time being include new header back to kernel.h to avoid twisted > indirected includes for existing users. I think it would be good to have some place to note that "This #include is just for backwards compatibility, it will go away RealSoonNow, so if you rely on something from linux/panic.h, include that explicitly yourself TYVM. And if you're looking for a janitorial task, write a script to check that every file that uses some identifier defined in panic.h actually includes that file. When all offenders are found and dealt with, remove the #include and this note.". > + > +struct taint_flag { > + char c_true; /* character printed when tainted */ > + char c_false; /* character printed when not tainted */ > + bool module; /* also show as a per-module taint flag */ > +}; > + > +extern const struct taint_flag taint_flags[TAINT_FLAGS_COUNT]; While you're doing this, nothing outside of kernel/panic.c cares about the definition of struct taint_flag or use the taint_flags array, so could you make the definition private to that file and make the array static? (Another patch, of course.) > +enum lockdep_ok { > + LOCKDEP_STILL_OK, > + LOCKDEP_NOW_UNRELIABLE, > +}; > + > +extern const char *print_tainted(void); > +extern void add_taint(unsigned flag, enum lockdep_ok); > +extern int test_taint(unsigned flag); > +extern unsigned long get_taint(void); I know you're just moving code, but it would be a nice opportunity to drop the redundant externs. Rasmus