Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2476310ybk; Sun, 17 May 2020 23:22:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1AIx5TyQa6wNe7ijXir2pKtfOufcwbstZa9kOcTmFMA2CzncGa2U+LXrJJDWm51Cdup7q X-Received: by 2002:a05:6402:783:: with SMTP id d3mr11928514edy.295.1589782959398; Sun, 17 May 2020 23:22:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589782959; cv=none; d=google.com; s=arc-20160816; b=sbCYmuht6Nqq61Hi1BbfDcqJ+ZdsTyCfKOs9wG9i5j18BWBJONsZa/cmkNzPrQMwk+ h5h4rDF4IPgyzwbrtKEcesdWioTghG6ryddU490/sOzwU93mcSklUjMGiWeCG80ucNvU kFtAyYXdX+x9WzBZBwAqJjuM3tWtSZmFSbRQiF0O/RNWlb9PKeGPATuL9jU/p4nEyLs/ VJ9lJKGa+i/UGLxa6/Lm72Cd6MWNgJwuXzvVmDeM0OXXvYyMhXqUzsBGLNxnAma8YV1E KORM3U3bPGkbwfptns8KptjpITK2hfd6xy/0t8mH9kDg0GufnXn3dxCxnz6s6KOezYit FT8A== 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=BSTNIXQj3Q6OdZ9siyJsFnsk+u2QPmFZetayBVXeQvY=; b=skRuvKGALkUuq7oxtMHj+RpQ8B4188XsnmbgKqRgiAUW8ydQXiJrIkUGOTLelnrf+K RbX5EOSQqE2ImHbiMsijf3kqKDukcB6E8eV56YgijiMDpkUNhRKc+UmpAOExUcL9KAI7 eQuFYZpR9eKFwdE3Q3Of38EroMFm1S1Rf9TU9NtsQ+jXvAZLVeIe0K1zFNiBohrjT9Ah hBFv+KvZJXqT0Lonh/lUlSftHilaTGuN6f0GA3LNcgdjZhXCVvousZDEfyeOhi9t48Y4 zjyuPuIpGUbc3V6aCkp13EPp/42CSAhLwc5aVk3dmYFM4scWNuRiogJL82p+v7VzUuQc YwkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EHJyWVMQ; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r22si5445901edm.199.2020.05.17.23.22.15; Sun, 17 May 2020 23:22:39 -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=@linaro.org header.s=google header.b=EHJyWVMQ; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbgERGUK (ORCPT + 99 others); Mon, 18 May 2020 02:20:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726040AbgERGUK (ORCPT ); Mon, 18 May 2020 02:20:10 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94064C061A0C for ; Sun, 17 May 2020 23:20:09 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id v16so4450651ljc.8 for ; Sun, 17 May 2020 23:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BSTNIXQj3Q6OdZ9siyJsFnsk+u2QPmFZetayBVXeQvY=; b=EHJyWVMQ6k2vq+IZRHKjaplkAjmLfHG/tmXifZxwUamd7/Ur4aVLXl43G00Y/eRhGL X2+Aa+vBnge640M3Wc4HOzmi/TpKNo0FDHZrNkxfuCctg+ovNsQVM1ytETx6ptSnc42c C6ahPqYKgslXoDAYlawN3SYf0VKqNHg2hwoJIvv9oURU/r5FjESnAlcUFkubYM/KsK9I AZYTxM2kBPnMDuObrAHddD1n/dZSJpZvjcrcVKBKkGQJtXt7sI19om9ZV6qckWqIyiCR /3MAanWwQ9/pIvZjA6mBuXf8RlQ8+/c5nUDVYjDfqxfTNSe/F3Tu9BOWZpBuNA3FlQNE eraA== 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=BSTNIXQj3Q6OdZ9siyJsFnsk+u2QPmFZetayBVXeQvY=; b=WoXBCJ60HtNbPtHwW8c7QEIUm+e4WN4r9fSlzcGuw0oyfUfOw+VqcoG89u1kV1Yg6M 6jiBSLGuzkvLPVltHdhl8An9RDf5f9MKzfbNn/1QChJv33PYfQpRm8G01+sAXEWABupg c0NI8TFQOshYKKiwm4Mw6CIHuS7EJKUYXZstRgjIf2WtXkGqBUHaNatC1MA1FhM6wFRj ffkCmpYlbQKqrFHIvoK+vUiLCg7IrRwhjCZeIw/Rx9uKjCFwuLCaT+PbJqff93lDIsi0 +wRFn4f/1EaOCfu7QkaQ1j3l09cRd5TZJrMSbN7S3wj7m73+GhoIuHQLXSqA/OdaRPK3 HhTg== X-Gm-Message-State: AOAM532ErVlgfOSNReYZqLjUfUYOL7DPdW7/j7Rzewtwc1ums6Svv8XK oi7Gy02srvQKVHdzwg9x5q1WNiQhPXxyWCVd0EiGhA== X-Received: by 2002:a2e:9907:: with SMTP id v7mr366660lji.0.1589782807841; Sun, 17 May 2020 23:20:07 -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: From: Sumit Garg Date: Mon, 18 May 2020 11:49:55 +0530 Message-ID: Subject: Re: [PATCH] printk/kdb: Redirect printk messages into kdb in any context To: Doug Anderson , Sergey Senozhatsky Cc: 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 On Fri, 15 May 2020 at 22:22, Doug Anderson wrote: > > 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 :) It's been noticed now since I started playing with NMIs support on arm64 for kgdb. And that's been only possible with the advent of pseudo NMIs on arm64 since Linux 5.3 release. > > 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. There's a case for the primary CPU to enter kgdb in NMI context too. Consider hard-lockup detection based kernel panic. I guess that's already been working on x86 and should be able to work on arm64 after this patch [1]. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2020-May/732227.html -Sumit > 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