Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp467587ybk; Wed, 20 May 2020 04:19:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGnOeyfjo9WETHYcVQJOTu2EciVzf//2l/0mAX1FIC8qI48i5Tu4bE6W6SQyCwKgEBF3HN X-Received: by 2002:a05:6402:74b:: with SMTP id p11mr2956582edy.229.1589973587145; Wed, 20 May 2020 04:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589973587; cv=none; d=google.com; s=arc-20160816; b=TsZ3hPBRVxcJosWW8lVhMBcPtgsIdzQa1e3Fkfn0D0Ep1Y4Hd1IWq7cuPhO4whTPK7 1tQAVFn7mLte5d2N6XNh55QFbg82xgWewnyTO9Us/+zYX+DxY0rqsyLIZ3an7uvv/wWh qIghZdAAtX3XP4SHyxcEkILTTxosDzxFgCbnAfMTsJPkKEArOp01Slz0WP7Lu24ed8P4 2asEchfF8KEj70HqFCkCjBcqlI6gMpwa8KWsndro8dVpLS+6hm3rxM1c6kEoxss22+ck Zr+F4AFliNMLe9WbZkGkawx2smsX4PooTVIibsDoV9AyuOEbUJm9tUKIdqPGpCKpdubC kMRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=G9jhMLSlbbRWBPFkiGcwNA69qHZJzJ0AW02rtZSNSek=; b=NHWzcuD6kVJvwDpWFzaTy9eny6AnU7W5vpPzcJDcmANAr89I2XirGiMejQpTrhc+6P grfTPb8V1dL5cH2q0nzEzO0aUDJYJ7/qCpJQwAIsMHrr8jNpVYpV/+a1G/jNipdmpnE5 YZYaE5SKXWY7rbv5ob25rFbNXBTT31eEKYLxUN59khoajmXfwMbW2ketc0UwqtmJADFO gUWXJ40Oi163nLg7GKDiAJm8AtLyEoRuRE5iIwcKST2BBiRM2vWxpX9MLqj9ni4HOO5Y Psl+6rSnKfVRMn18WBRZXR8eHNBRKQuqxh0/QnFSa2VcxK/TMV56eFeLHIAFC8MDgNv7 wWlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HrWi5oHJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si1437616ejb.633.2020.05.20.04.19.24; Wed, 20 May 2020 04:19:47 -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=@gmail.com header.s=20161025 header.b=HrWi5oHJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbgETLRt (ORCPT + 99 others); Wed, 20 May 2020 07:17:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbgETLRt (ORCPT ); Wed, 20 May 2020 07:17:49 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3646EC061A0E for ; Wed, 20 May 2020 04:17:49 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id 23so1390020pfy.8 for ; Wed, 20 May 2020 04:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=G9jhMLSlbbRWBPFkiGcwNA69qHZJzJ0AW02rtZSNSek=; b=HrWi5oHJs6KG0TnjQSTOJ04Qm8KbWmxtVcZBF5c3JhUMZljPumg7wlWtu1EQ2ff2ht THAOlS5+DB9E9yy2+PSvNvTVKUbHSGfzo07tr2CCCE8heT/cQUrLzll+kvrKdclThJIL q2LtnI5Cj81ZgJXMwt28k3gfzCenwzUr0nNrBr2J5LoUsLsdhaq6ziDgdo+E47vhGEi7 AAOUewCCwVkCtQ7tWlDu4NWo6Wl03kRXAVcRfv0IAwjaIyQSOPPsjXTeasjYVs1N1cYg PLJ3+lB5K4RMqHe0Md7C9BYx7xGQr2bJo2m3eOl+aTdqd97v9Sr5cLMNj/TriqWwpY0Z PPYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=G9jhMLSlbbRWBPFkiGcwNA69qHZJzJ0AW02rtZSNSek=; b=N5mt299/i8kKob/wgY8REyCfoKIYCkA0W/Uh/KmClE9cqgYGGd+qRgWK+wJyjO5GPq sKYoAZGDu/hlkraMLJj6Zt3LfcuJkAyceYeLU/BCZkjQsMowxVk2j244iJDyW5LEgs+O uDJCWW2cm+CHK/wEK0W1S3q2XRmgy2s0YTbbbPOBIr0c9YAw4n2WE7R5W+5GOtw14HKZ qIVTrYq5V7imc1h6wBy+XFXBVph/ZRjPHPg6YGVQ5ebDGq44/XR89btdk+wEwIzNEwhI 2ceY8wo6RkKhJDN8HaDvxL3+3bR0Cb0/8YYZbuUe3fpdPJqs5QgiavWGm6keOudBaUDQ BU7w== X-Gm-Message-State: AOAM532Td5eACNBUIszsVdV9cQg+N6nylP36ICy4I2m/dmHv/lN0rlFA 3r73eEJLjT1q6ARXg7ZEsA0= X-Received: by 2002:a63:7d58:: with SMTP id m24mr3500311pgn.81.1589973468726; Wed, 20 May 2020 04:17:48 -0700 (PDT) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id q7sm1709586pgs.13.2020.05.20.04.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 04:17:48 -0700 (PDT) From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky Date: Wed, 20 May 2020 20:17:46 +0900 To: Petr Mladek Cc: Daniel Thompson , Sergey Senozhatsky , Sumit Garg , Jason Wessel , Douglas Anderson , kgdb-bugreport@lists.sourceforge.net, Linux Kernel Mailing List , Arnd Bergmann , Andrew Morton , Peter Zijlstra , Steven Rostedt , John Ogness Subject: Re: [PATCH v2] printk/kdb: Redirect printk messages into kdb in any context Message-ID: <20200520111746.GB520@jagdpanzerIV.localdomain> References: <20200514084230.GO17734@linux-b0ei> <20200515085021.GS17734@linux-b0ei> <20200515103308.GD42471@jagdpanzerIV.localdomain> <20200515134806.5cw4xxnxw7k3223l@holly.lan> <20200518092139.GK7340@linux-b0ei> <20200520042102.GA938@jagdpanzerIV.localdomain> <20200520093557.lwwxnhvgmacipdce@holly.lan> <20200520102233.GC3464@linux-b0ei> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520102233.GC3464@linux-b0ei> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/05/20 12:22), Petr Mladek wrote: > kdb has to get messages on consoles even when the system is stopped. > It uses kdb_printf() internally and calls console drivers on its own. > > It uses a hack to reuse an existing code. It sets "kdb_trap_printk" > global variable to redirect even the normal printk() into the > kdb_printf() variant. > > The variable "kdb_trap_printk" is checked in printk_default() and > it is ignored when printk is redirected to printk_safe in NMI context. > Solve this by moving the check into printk_func(). > > It is obvious that it is not fully safe. But it does not make things > worse. The console drivers are already called in this context by > db_printf() direct calls. > > Reported-by: Sumit Garg > Tested-by: Sumit Garg > Signed-off-by: Petr Mladek Acked-by: Sergey Senozhatsky -ss