From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752539AbbBRWxx (ORCPT ); Wed, 18 Feb 2015 17:53:53 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:41517 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751837AbbBRWxw (ORCPT ); Wed, 18 Feb 2015 17:53:52 -0500 Date: Wed, 18 Feb 2015 23:53:47 +0100 From: Ingo Molnar To: Slava Pestov Cc: Peter Zijlstra , Ingo Molnar , Andrew Morton , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Slava Pestov Subject: Re: [PATCH] taint on lockdep warning with new TAINT_LOCKDEP Message-ID: <20150218225347.GA31816@gmail.com> References: <1422568226-18449-1-git-send-email-sp@daterainc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1422568226-18449-1-git-send-email-sp@daterainc.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Slava Pestov wrote: > This helps when writing automated tests, since they can fail the > test if the kernel was tainted instead of manually scraping dmesg > for interesting strings. > > Signed-off-by: Slava Pestov > --- > include/linux/kernel.h | 1 + > kernel/locking/lockdep.c | 31 +++++++++++++++++++++++++++++++ > kernel/panic.c | 2 ++ > 3 files changed, 34 insertions(+) > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index 5449d2f..c46e24e 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -471,6 +471,7 @@ extern enum system_states { > #define TAINT_OOT_MODULE 12 > #define TAINT_UNSIGNED_MODULE 13 > #define TAINT_SOFTLOCKUP 14 > +#define TAINT_LOCKDEP 15 > > extern const char hex_asc[]; > #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] > diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c > index 88d0d44..4916a32 100644 > --- a/kernel/locking/lockdep.c > +++ b/kernel/locking/lockdep.c > @@ -382,6 +382,8 @@ static unsigned long stack_trace[MAX_STACK_TRACE_ENTRIES]; > > static void print_lockdep_off(const char *bug_msg) > { > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); > + add_taint(TAINT_LOCKDEP, LOCKDEP_NOW_UNRELIABLE); If only we had a function that turns lockdep off in a single place, instead of having to crap all over lockdep.c? ;-) Thanks, Ingo