Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1032296ybj; Thu, 7 May 2020 13:11:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLTSIQiI8zAwNCwc4p3sk6qcxSu8I4onW1GU294OTAzpvWIkVAn+uTZErH4AGXA3/y+qN5F X-Received: by 2002:a05:6402:1296:: with SMTP id w22mr13018374edv.364.1588882261149; Thu, 07 May 2020 13:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588882261; cv=none; d=google.com; s=arc-20160816; b=i0hosUtWHW3yTZ9g/YlLyBHtAHcQzPZMonSTnC3M0DZECm4LSjphO2h7A9w4D2tdJa 2W4sCeGcSHjyrag/SPKk9/CbW0cBuT8CAxriRZtgBFxJGJxOfeeS14YeV60h3bjKndti /FYEl3L3k5upPpIbflKWHD38o42lmnkJE6Y/iRDgHSepVBkDLIYkcpA4lDt7TXbixhGS h6Wt5/4Zbqr+bWhZaazXvuXedoGlZS/i7vRCDzQEFXkRfJPDMNPm/5tYe5f7oJ9I6QqT ed4bex97rI56TgeJuhc//dEpU5tJeXwYRTHVyGFuKRLjlh27EPBaXcc34P3/IY/+QARN PWHQ== 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:date:subject:cc:to:from :dkim-signature; bh=T9272gqaO+LckyRVgAqfebSkljgLEU7jgQEMbEqhbqA=; b=BFq3dcckhTwNDM9jhpd7AaFRJLh1aSUhlqh0UGq26J+n12E0Fx07NcGn8dhpVeLd4o qbeobDLHGLWB7x1joPFhjKSC45DQCUXcbSBUOoIrqiERERy39c2MDWIgGi+T5bw2GDfg 9Bsv+Cqj8nIfAVkJaLjIh4a8om09aI4XxjfzpocdiYyzuX94PSs2nQhMKUSEedrPX943 BXTviMPJ44gSSy1/KhmCo0mV+uNOxSv+jxcktqVGUfxjJs7kqU3mPf+bkG1lejKL/Zef S+mmLT2w7f2IKJ5oOecFX35Lw8YVDSJtjkaFexrSe/W7sbbD5OfIf8g/9toIEPVb1CPA yCDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PwBWweDO; 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 ci9si3842445ejc.125.2020.05.07.13.10.38; Thu, 07 May 2020 13:11:01 -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=PwBWweDO; 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 S1728543AbgEGUJI (ORCPT + 99 others); Thu, 7 May 2020 16:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728427AbgEGUJD (ORCPT ); Thu, 7 May 2020 16:09:03 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94BB2C05BD0C for ; Thu, 7 May 2020 13:09:01 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id t11so3307544pgg.2 for ; Thu, 07 May 2020 13:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T9272gqaO+LckyRVgAqfebSkljgLEU7jgQEMbEqhbqA=; b=PwBWweDOmiGoPgQ6XskZuJKwOl5DVieYaqfy2Zxee+5GB88Ew09QMacIygXnq1RVdR dVFrvj58J8n+h+TTrKz7pVdsV1GhkEBJS8T8lo7xCoPxTPOBkdgwt2sDUWR5SMRvBLZ6 33tptodzxHomlW+7m6xOmJ9Jzqp0LiPbpI54Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T9272gqaO+LckyRVgAqfebSkljgLEU7jgQEMbEqhbqA=; b=uoD0wKReGjDNQ82J4s0gmF8jahHZTIVcAHYfe+b87aSqrTJ3aUVPTHwXvQiPCuB+Th qlvD1JU6Sztf+cf3VXlocr60CcsOCq6h/leQ/XS5I6l+ns/q3OQVnnP42TlZ6CfmlUxG PmuyruERQf1CdbhZ62LRWScFz5kfiFPllzJqsx+tLBn8PzD5CDKlLel0G473cWtV2yLZ ZRdR/AoWEat3oR9fVa/8TbRbDyP1Uw929bzQjfxKMvvwr/DSA7W2vF2X+isX/Yf07aN1 q38BKptWo8EShMeZ6GcC6ZUpuUV8kpduYjud6CHoJNnaiSdsrRA9eiaWfP6pAmWZSitb k2iQ== X-Gm-Message-State: AGi0PuYlqlYIw4znh1o4B5SSKoNrPIzO8TDNUSA4oHQUxTX1rlB3wj/Y g2D4t4XCN90M0O/H+hAr/HZ0EA== X-Received: by 2002:a63:211d:: with SMTP id h29mr2875478pgh.231.1588882141068; Thu, 07 May 2020 13:09:01 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id d203sm5547601pfd.79.2020.05.07.13.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 13:09:00 -0700 (PDT) From: Douglas Anderson To: jason.wessel@windriver.com, daniel.thompson@linaro.org, gregkh@linuxfoundation.org Cc: corbet@lwn.net, frowand.list@gmail.com, bjorn.andersson@linaro.org, linux-serial@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, jslaby@suse.com, kgdb-bugreport@lists.sourceforge.net, sumit.garg@linaro.org, will@kernel.org, tglx@linutronix.de, agross@kernel.org, catalin.marinas@arm.com, bp@alien8.de, Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH v4 01/12] kgdb: Disable WARN_CONSOLE_UNLOCKED for all kgdb Date: Thu, 7 May 2020 13:08:39 -0700 Message-Id: <20200507130644.v4.1.Ied2b058357152ebcc8bf68edd6f20a11d98d7d4e@changeid> X-Mailer: git-send-email 2.26.2.645.ge9eca65c58-goog In-Reply-To: <20200507200850.60646-1-dianders@chromium.org> References: <20200507200850.60646-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In commit 81eaadcae81b ("kgdboc: disable the console lock when in kgdb") we avoided the WARN_CONSOLE_UNLOCKED() yell when we were in kgdboc. That still works fine, but it turns out that we get a similar yell when using other I/O drivers. One example is the "I/O driver" for the kgdb test suite (kgdbts). When I enabled that I again got the same yells. Even though "kgdbts" doesn't actually interact with the user over the console, using it still causes kgdb to print to the consoles. That trips the same warning: con_is_visible+0x60/0x68 con_scroll+0x110/0x1b8 lf+0x4c/0xc8 vt_console_print+0x1b8/0x348 vkdb_printf+0x320/0x89c kdb_printf+0x68/0x90 kdb_main_loop+0x190/0x860 kdb_stub+0x2cc/0x3ec kgdb_cpu_enter+0x268/0x744 kgdb_handle_exception+0x1a4/0x200 kgdb_compiled_brk_fn+0x34/0x44 brk_handler+0x7c/0xb8 do_debug_exception+0x1b4/0x228 Let's increment/decrement the "ignore_console_lock_warning" variable all the time when we enter the debugger. This will allow us to later revert commit 81eaadcae81b ("kgdboc: disable the console lock when in kgdb"). Signed-off-by: Douglas Anderson Reviewed-by: Greg Kroah-Hartman Reviewed-by: Daniel Thompson --- Changes in v4: None Changes in v3: None Changes in v2: - ("kgdb: Disable WARN_CONSOLE_UNLOCKED for all kgdb") new for v2. kernel/debug/debug_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 2b7c9b67931d..950dc667c823 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -668,6 +668,8 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, if (kgdb_skipexception(ks->ex_vector, ks->linux_regs)) goto kgdb_restore; + atomic_inc(&ignore_console_lock_warning); + /* Call the I/O driver's pre_exception routine */ if (dbg_io_ops->pre_exception) dbg_io_ops->pre_exception(); @@ -740,6 +742,8 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, if (dbg_io_ops->post_exception) dbg_io_ops->post_exception(); + atomic_dec(&ignore_console_lock_warning); + if (!kgdb_single_step) { raw_spin_unlock(&dbg_slave_lock); /* Wait till all the CPUs have quit from the debugger. */ -- 2.26.2.645.ge9eca65c58-goog