Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp690499imm; Tue, 15 May 2018 07:47:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrQeFzLfBbvt+2y5n8gUqVR5TiRsCCCawjPTBhiQHue4iLzF+RifIT6dEzPtBWyWBeSUsX/ X-Received: by 2002:a62:1fc8:: with SMTP id l69-v6mr15506326pfj.49.1526395642198; Tue, 15 May 2018 07:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526395642; cv=none; d=google.com; s=arc-20160816; b=LNAc2Kd05mE8Ulk1XDTQeeMTsjJ/KNGAeFFveRrXeB8ZEQwry82lhH4enUf/qtuiym f9c6V0w5npIcXL3EYKnZupb2xDZJdw0pfD/IvmFhZADFuGFiRKNMhM6ymJs+M4Iicabh 7M0tYpZ74babqbtYwKPt4PlFyAIkc0yPFtBffzD8X6Zq56w2aWdUKtjq5XRMmTtfXDQZ rlovLrA4zIOAyABSx3J0Fo+S8uL8/JmX3y8ut4wOPIfmBDELBaISRiqT4wYZueVUC/hQ TdVBcC0g7MDhYwtPSkUXEkwCugnyHvfHYhpMjTF2RADqkbp+suJKPYPjIKDJaFiIpo2Z M3hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=rfo4n1GStovq2jQQ7QSQu97W8j9KWJbqcZ2QsZZqRrk=; b=Tv95Yd880p6TFmiDh4npuyoQqoN+WPKPc1LO8chMpvgnR37G30n9064Ax7W8fA5ff4 qhhifIh51cr54zHaAquAhgrrsdvSena6CyHzOJMYQPmbRTT93rk+S9VY3lBYd0PRCGOL 9+w9G660CPD4k+EMecNKFZw1AJS0thV322DL3Q8UxOTqkBmhnPkjZ7HsKGDPer6HwloI FoJ3CnFwiC35sxRk9fFXS7MKw7ggUMHg7LXa/c73KvP3vfxtkrmWHaHBfpDD/4QvMRJV Kl2+/5aqhbcFEY4PeFnBtM4LjnsO2C68N6vfmt2mC0YaDSLvvtdo+EPu2NyMHqGF8rkf +Uvw== ARC-Authentication-Results: i=1; mx.google.com; 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 w18-v6si186093pfl.359.2018.05.15.07.47.05; Tue, 15 May 2018 07:47:22 -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; 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 S1753952AbeEOOjb (ORCPT + 99 others); Tue, 15 May 2018 10:39:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:53112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752543AbeEOOja (ORCPT ); Tue, 15 May 2018 10:39:30 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4269721726; Tue, 15 May 2018 14:39:29 +0000 (UTC) Date: Tue, 15 May 2018 10:39:27 -0400 From: Steven Rostedt To: Sergey Senozhatsky Cc: Dmitry Vyukov , Tetsuo Handa , Petr Mladek , Sergey Senozhatsky , syzkaller , Fengguang Wu , LKML Subject: Re: printk feature for syzbot? Message-ID: <20180515103927.1be0cafa@gandalf.local.home> In-Reply-To: <20180515052042.GB480@jagdpanzerIV> References: <201805102350.JJH73950.tVJHQLFSOMOOFF@I-love.SAKURA.ne.jp> <20180511014515.GA895@jagdpanzerIV> <201805110238.w4B2cIGH079602@www262.sakura.ne.jp> <20180511062151.GA18160@jagdpanzerIV> <20180511095004.GA6575@jagdpanzerIV> <20180511093716.18329322@gandalf.local.home> <20180515052042.GB480@jagdpanzerIV> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 May 2018 14:20:42 +0900 Sergey Senozhatsky wrote: > > And no, NMI handlers do not nest. Yes, we deal with nested NMIs, but in > > those cases, we just set a bit as a latch, and return, and when the > > first NMI is complete, it checks that bit and if it is set, it executes > > another NMI handler. > > Good to know! > I thought that NMI can nest in some weird cases, like a breakpoint from > NMI. This must be super tricky, given that nested NMI will corrupt the > stack of the previous NMI, etc. Anyway. Well, they do kinda nest, but we work hard not to let them do anything when they do. You can read all about it here: https://lwn.net/Articles/484932/ > > > > Well, hm. __irq_enter() does preempt_count_add(HARDIRQ_OFFSET) and > > > __irq_exit() does preempt_count_sub(HARDIRQ_OFFSET). So, technically, > > > you can store > > > > > > preempt_count() & HARDIRQ_MASK > > > preempt_count() & SOFTIRQ_MASK > > > preempt_count() & NMI_MASK > > > > [..] > > I handle nesting of different contexts in the ftrace ring buffer using > > the preempt count. See trace_recursive_lock/unlock() in > > kernel/trace/ring_buffer.c. > > Thanks. So you are also checking the preempt_count(). > Yes I am. -- Steve