Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1521355ybj; Fri, 8 May 2020 03:18:55 -0700 (PDT) X-Google-Smtp-Source: APiQypIvPJOj4BAOTEue6HNnCHj2D6XPen42T5YbrpyyVlstiyGAEM4LT+Wmz4EZm2zknqVfGg2Q X-Received: by 2002:a17:906:2458:: with SMTP id a24mr1199542ejb.239.1588933135094; Fri, 08 May 2020 03:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588933135; cv=none; d=google.com; s=arc-20160816; b=EgbDCjKHPv8GggqEYojCP2LUvTGJBV4gV4eeyquXgt8lHS5LYd8n9cVSdap5tdtKLz jGFp/Mz6aYsDpYvIR47RiYQ6+wXiCOp9HxtT2B23ti25Lc8mv1YvSATl0fo+As39h/Fa 2qUcK0WVvOW2YYr8mRVl4b91Cl24FvbyPDO6OARRQYh/cIHTOnhOIOvbiCZsOuDhIiNc fHpIYgjJdTaZ5902dVC1lR6OLCuIjGNP4YChPPh1RPLj4UisyEb+VatM62gs8VGVHu56 rTerDth/Rj/Ti40VJidkxcY1w4KuzDrQNJVQ6dii2VFjrNlJgyjl2RFUnJc2xmcvFwbd GZug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=A4F3tdgxFGn0tAEG/V/qHpFfQul0i58csDRu9fXiQKo=; b=ezJdDd5VE/rAbnC1OO13NNLpXBxY/ZLY8q+R2+gn7rG6xxLCW/QBXNoglh87AAswe0 irtKjwlI89tc45kvLMj/peEEu+o+UgTsECJRIUK74d/vzJCahSRaO3AuEHqwf6XLul8w Hj9x/K8AWZymhBFSguCUYjnw4+YN2hZHZR/t+TivKOqWKp/PEIYTND1i0uP+qj+HGbz9 eovSOT+smnkqxBDKaA3O/tio3MqPl7sFuh/oD8spOJ7W5S2Yt0qVLKjO/KXr4OHazYdy o7hYR8PMlVrTjO9M6c69JPS6WtdDCYiFOnz99FFCyYP8cPwLCBe5TAIPCRqcR22NhuyF UB9A== 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v15si640177edq.394.2020.05.08.03.18.27; Fri, 08 May 2020 03:18:55 -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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbgEHKQI (ORCPT + 99 others); Fri, 8 May 2020 06:16:08 -0400 Received: from mga18.intel.com ([134.134.136.126]:35738 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbgEHKQI (ORCPT ); Fri, 8 May 2020 06:16:08 -0400 IronPort-SDR: a/aWPKeL7xObCOhn7Xex212W5Xp4t0pgJ4QGbqej8Soyvgl7xZqedftSymziVuuO87a+sfWzXj 9FqdH1j6oNlQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 03:16:07 -0700 IronPort-SDR: ZRtL00QWJwbe3OhNC8qJ/IWzZ9+E6yWoA6P8YUxyILJPxDMq8oLsfek/6/T7/p1st1UHCu6To/ M7K4tWVTEsHA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,367,1583222400"; d="scan'208";a="251792934" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga008.fm.intel.com with ESMTP; 08 May 2020 03:16:02 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jX032-005Oei-Ew; Fri, 08 May 2020 13:16:04 +0300 Date: Fri, 8 May 2020 13:16:04 +0300 From: Andy Shevchenko To: Luis Chamberlain Cc: jeyu@kernel.org, akpm@linux-foundation.org, arnd@arndb.de, rostedt@goodmis.org, mingo@redhat.com, aquini@redhat.com, cai@lca.pw, dyoung@redhat.com, bhe@redhat.com, peterz@infradead.org, tglx@linutronix.de, gpiccoli@canonical.com, pmladek@suse.com, tiwai@suse.de, schlad@suse.de, keescook@chromium.org, daniel.vetter@ffwll.ch, will@kernel.org, mchehab+samsung@kernel.org, kvalo@codeaurora.org, davem@davemloft.net, linux-kernel@vger.kernel.org Subject: Re: [RFC] taint: add module firmware crash taint support Message-ID: <20200508101604.GF185537@smile.fi.intel.com> References: <20200508021438.4373-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200508021438.4373-1-mcgrof@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 08, 2020 at 02:14:38AM +0000, Luis Chamberlain wrote: > Device driver firmware can crash, and sometimes, this can leave your > system in a state which makes the device or subsystem completely > useless. Detecting this by inspecting /proc/sys/kernel/tainted instead > of scraping some magical words from the kernel log, which is driver > specific, is much easier. So instead provide a helper which lets drivers > annotate this. > > Once this happens, scrapers can easily scrape modules taint flags. > This will taint both the kernel and respective calling module. > > The new helper module_firmware_crashed() uses LOCKDEP_STILL_OK as > this fact should in no way shape or form affect lockdep. This taint > is device driver specific. ... > +++ b/include/trace/events/module.h > @@ -26,7 +26,8 @@ struct module; > { (1UL << TAINT_OOT_MODULE), "O" }, \ > { (1UL << TAINT_FORCED_MODULE), "F" }, \ > { (1UL << TAINT_CRAP), "C" }, \ > - { (1UL << TAINT_UNSIGNED_MODULE), "E" }) > + { (1UL << TAINT_UNSIGNED_MODULE), "E" }, \ > + { (1UL << TAINT_FIRMWARE_CRASH), "Q" }) Perhaps split out the closing parenthesis to avoid changing additional line in the future? > TRACE_EVENT(module_load, -- With Best Regards, Andy Shevchenko