Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp118602ybg; Mon, 8 Jun 2020 18:07:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu+PhhBbaTUUzxcF3kJ0x+bWC2Q/YjBEjWTIUknlWb1HZDgAHou68mqECGjXUH9iObbgZs X-Received: by 2002:a17:906:70c1:: with SMTP id g1mr8335618ejk.38.1591664858741; Mon, 08 Jun 2020 18:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664858; cv=none; d=google.com; s=arc-20160816; b=baM7wVPF1NGeHAhX+Jhgd04uSuyHkakzE16EfEPXfGpTPJaVDCuJgWvp/AM2ImPrT3 O0FnxxG9Mj+LGaAoWMFv3EAjTZ/ogMJ3FhKHnLFsu0zldXoY7s48LuQBhz6HHLRUOPB6 /pfHqZe1E6YMwcBOTv+DbTr1xZgKmftkA8fChDny+0KEtJ7B2RC/54v5aTHIQP7b464H W+FNtNtQsmP2Bq+g9sb4OtUGZXxIMi9gnB8OR7qIlZoMeP8zRp6CyUvVN68VOc9//K+f 3yl7q5v3TrMRhNKuLvX59JL06bw7OzCTj6vgkfZi+u9jGuXipA1q7frTt6ZTP7bM2y/T EKgA== 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=qE+4hyAP28DMMJHyJe1fsiLs5690QFjQ/Y0GCYK+9UU=; b=O8LHnGMg3Y+dfdugh8x0wn1TuCBikbspHh+mtINkxLybAda4RENpXEQxQ7xZ8kj/Rp cpz+Ubfg7JXocsByXS4BtdmWUDqHYx3qc1QQTUQQkIJgzFyBm1IPDMOdJWagmJuZNR9G yUX7iIl/5COm/bNGaleNuw8LO4x3WeW8HSmq6jDl8WjqzslSwZ+KgNySahycrEygUMXT 6QhX8angTIJ2H34BT7USBLVpMETYFyQkenW0fmU0cZcO+QyuNVng1X3gC6v1E77Jeef3 UqykauPf9fXfYH3tu5UhEc/y5vL5jAU+NcQNZtnHU2VjSK7qhBOP/HDWMIrljBqtrXZj vZsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xsprg4cr; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds3si12049365ejc.545.2020.06.08.18.07.16; Mon, 08 Jun 2020 18:07:38 -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=@kernel.org header.s=default header.b=Xsprg4cr; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbgFIBFc (ORCPT + 99 others); Mon, 8 Jun 2020 21:05:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:51128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbgFHXHR (ORCPT ); Mon, 8 Jun 2020 19:07:17 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A716A20801; Mon, 8 Jun 2020 23:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657637; bh=DzD4va/Hk/n7WxJe3FSL15iUlyqcjWKqD3ZeXFNRTaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xsprg4crwovuqNqeDGb6qZdZ6ds6ZbhmXJiNlLV7RP1JRu4N/bM3GiJR4h/Lxy6rb hhtAUhN6EIFl21QovstmCSgF4yLcB8VsfvNf6VmgUo37SD0gmYesbs+JUVYXK5MrYc B3b3FM2dQ5JKXpsYzxXYd4u3RfZLVl775pQh6Mpw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Douglas Anderson , Greg Kroah-Hartman , Daniel Thompson , Sasha Levin , kgdb-bugreport@lists.sourceforge.net Subject: [PATCH AUTOSEL 5.7 055/274] kgdb: Disable WARN_CONSOLE_UNLOCKED for all kgdb Date: Mon, 8 Jun 2020 19:02:28 -0400 Message-Id: <20200608230607.3361041-55-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Douglas Anderson [ Upstream commit 202164fbfa2b2ffa3e66b504e0f126ba9a745006 ] 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 Link: https://lore.kernel.org/r/20200507130644.v4.1.Ied2b058357152ebcc8bf68edd6f20a11d98d7d4e@changeid Signed-off-by: Daniel Thompson Signed-off-by: Sasha Levin --- 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.25.1