Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp648416ybk; Fri, 15 May 2020 09:56:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6FQ2Il4SPi8uCpYfr5BxNwQjLWPH+7qOLONXfkav9stwRWIyLK35/YwDyMhLVWHx/37dW X-Received: by 2002:a17:906:25cb:: with SMTP id n11mr3821533ejb.37.1589561774750; Fri, 15 May 2020 09:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589561774; cv=none; d=google.com; s=arc-20160816; b=zXWNpEmPiMThx530eOS1VJwwOMcQIRMQgSuZh57WR/6M5o1kY42JFpIpO5xEc5Z+FD GCKgWvm/YQUQ27VbFMEgafDlk+98sn57V7r2W7dJDbIeEuzaQgBUsmquWwti9sBoOvjk 35aJpA6J/1YO3D79BUhAtTeXN7R7cK24G40i8bwZZKqJeZsfsWo7Q12SPe/TI6EwEQHY QkBkXBurP2E484vp0eOirUJWVKviOJM8En4RLZi0zm9CRBuuz9d9fwXg5Ket5NgJRS62 Y41+PCLMNSpAezuW4q7+W11LauLAhw+UTwaX/mfyxHPFYrRCI9sqEV8igRgBK1t/dVRE cs+g== 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 :in-reply-to:references:mime-version:dkim-signature; bh=//QUXJb2hfEP5KSpFr1jCZS2lxtzuUgoxlZm2dmFvFY=; b=Q/gA+TBHjQ8mihdDMJsHdmNQdxa/WmIJBl19pwI5l6EJJPSOvZGb6k+m+uGZNTu5w1 x9Mo2LVPrUOlqMxsTLX4AXBViO6WGNj0K36597p5zn7bDy5svxisfKZvHXqxR5AJEQ3h pp/vQmAmfR0DPd4DHv1yCgLlsIEVccuX2SIJXPcwm2F3WOgkWpnjv/uXFr1dq8346p0H mQ4g1t/8smcIG3l5L5ivx21O7UjvDf70Z/ScWS7magOD6h/15ytq2SisIlTj+i+CZpmT 6HQ6zfWtjB44SOqvjGoIeo98EpyO6OkrP29yUR+03M7btxJNIlBahhL7QZDQJTIheA8h o1Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QVbQZPOq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si1527033ejx.259.2020.05.15.09.55.51; Fri, 15 May 2020 09:56:14 -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=@chromium.org header.s=google header.b=QVbQZPOq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726528AbgEOQwb (ORCPT + 99 others); Fri, 15 May 2020 12:52:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726023AbgEOQwa (ORCPT ); Fri, 15 May 2020 12:52:30 -0400 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 542F5C061A0C for ; Fri, 15 May 2020 09:52:30 -0700 (PDT) Received: by mail-vs1-xe43.google.com with SMTP id y13so1637740vsk.8 for ; Fri, 15 May 2020 09:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=//QUXJb2hfEP5KSpFr1jCZS2lxtzuUgoxlZm2dmFvFY=; b=QVbQZPOqP3I4QaDmNr61NBvJ2m4f0FA0qcnvxdFVkElx5ChUuXTVkiqBWPo1Lc9Svp gfslahjg2HvG56kqiAX8dTsXZpoCex+FFddG1M9rgY2zxl3BsjVqUNAAccrlXYZYnbeU c4XsdUEEqV52JxZSsm03Nz8rVclM6Q6jWWzWI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=//QUXJb2hfEP5KSpFr1jCZS2lxtzuUgoxlZm2dmFvFY=; b=aOxJuqBVoSLUDwL02h8C0Er6PFzrfWgHrsJVai2TE1JFaeGkUtbRlm/BqhBgyXHQQy ziU9yRiMqqtLV4Z7wULc9QMVXX7WE0vKN5RtiT1LqwO6e9ABNw6vlRZ59IR9jm22wGuJ S/JzID8HytvNdfOVk2k4+fPcdr586FjU6co5hwtQwHHHg70YGP0EBeu2liZtS6/ex3kh 0PqVEHuwPXOtDbTsidjW3tEwXBUL87Mm1IOa5CMydSwljeeULRdDzqA5G9tE8RTyZLYJ BTPqMKLLhTHLH/5C5kMcJ0rNBEw7yuAj9IbwDuhvpZo+VRYRktcGHYYxnkAGBSne8paF 2MJg== X-Gm-Message-State: AOAM532Jup6AlYVTC83O9SrzwuUyehh0La8uuSjPgaAaG12WaVemN8RB 4W7uG9thx1DrigMDNZ3M2ydZusW49pU= X-Received: by 2002:a67:f9d0:: with SMTP id c16mr3388262vsq.53.1589561549338; Fri, 15 May 2020 09:52:29 -0700 (PDT) Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com. [209.85.222.47]) by smtp.gmail.com with ESMTPSA id u63sm591149vsc.13.2020.05.15.09.52.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2020 09:52:28 -0700 (PDT) Received: by mail-ua1-f47.google.com with SMTP id k3so1027040ual.8 for ; Fri, 15 May 2020 09:52:28 -0700 (PDT) X-Received: by 2002:ab0:69cc:: with SMTP id u12mr268225uaq.22.1589561548021; Fri, 15 May 2020 09:52:28 -0700 (PDT) MIME-Version: 1.0 References: <1589273314-12060-1-git-send-email-sumit.garg@linaro.org> <20200512142533.ta4uejwmq5gchtlx@holly.lan> <20200514084230.GO17734@linux-b0ei> <20200515085021.GS17734@linux-b0ei> <20200515103308.GD42471@jagdpanzerIV.localdomain> <20200515163638.GI42471@jagdpanzerIV.localdomain> In-Reply-To: <20200515163638.GI42471@jagdpanzerIV.localdomain> From: Doug Anderson Date: Fri, 15 May 2020 09:52:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] printk/kdb: Redirect printk messages into kdb in any context To: Sergey Senozhatsky Cc: Sumit Garg , Petr Mladek , Daniel Thompson , Jason Wessel , kgdb-bugreport@lists.sourceforge.net, Linux Kernel Mailing List , Arnd Bergmann , Andrew Morton , Peter Zijlstra , Steven Rostedt , John Ogness 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 Hi, On Fri, May 15, 2020 at 9:36 AM Sergey Senozhatsky wrote: > > On (20/05/15 17:32), Sumit Garg wrote: > > > Can I please have some context what problem does this solve? > > > > You can find the problem description here [1] which leads to this fix. > > [..] > > > [1] https://lkml.org/lkml/2020/5/12/213 > > Thanks for the link. I'm slightly surprised it took so many years > to notice the addition of printk_nmi/printk_safe :) I haven't looked at all the details, but IIUC we don't normally enter kgdb on the primary CPU through a NMI context, but the secondary ones (on x86) always do. Most things are run on the primary CPU and I think it's relatively unlikely for people to change the primary CPU (though it is possible). Probably things got worse when I changed the way "btc" worked to make it common between all architectures. See commit 9ef50a686b53 ("UPSTREAM: kdb: Fix stack crawling on 'running' CPUs that aren't the master"). Though theoretically someone could have changed masters and reproduced the problem with a simple "bt" before my patch, now a relatively normal command "btc" would tickle the problem. I didn't notice it because I work almost totally on arm/arm64 machines and they don't have NMI (yet). In general I've always wondered about why (historically) kgdb bugs have sometimes gone unnoticed for a period of time. That does seem to be changing, though, and I've seen a few longstanding bugs getting fixed recently. :-) -Doug