Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp592644ybt; Fri, 19 Jun 2020 08:55:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLj9kfFU98ooRkFP+LVYgm1JdPAN40PDYAPTgMk0d7XOXDpvm/Xcl+r6hWqJOfDAkZS3GE X-Received: by 2002:a50:cf05:: with SMTP id c5mr4134128edk.232.1592582100371; Fri, 19 Jun 2020 08:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592582100; cv=none; d=google.com; s=arc-20160816; b=imyoStMUBS2pwv/3b1oYlPDcL5oXIAJOun5YHWk3rMQZ8dF6nMxMflYX2piCHPupGX MrOnZOkvehovrVR2zAaq/NOWgDYFm6XTTE0yPrzssYDSIhrTdaLbg+VFshlzOepBwlR1 18bmUuQs5bSjkh93gyS9eDabjakhIRhf5zm/mL/MkC2GHZuU/Sdmj6/NeVSxTm3HApkY Zic8C/hTThjSfYQ+beUgUmXhMiL5eBeyzvgNK57zgiD8cZLLbichZjbum2a0ubW7QOGf UskMQOBYAHEE4fREg0RYy71sPFKI6v4iHqy4EZnGilMlrhetzu5XQYqRWc635E83RK6O mcrA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u3jtcCxdZ5T9QOLRbscz6iJvQuWLHfyvnpzSH/m/+NY=; b=D8gJ+w0Rab6NCZ3XRbrNOUPDDnfsgSR+PfIOL7tmiN8QUIv3BVbRuiKZUeC7az9gk8 pffqBW+LIFR9yZfeJW0gEDYEMZ+xJcng958XCFEl6iugIjOaxdqADmMaRztULLbUS9ud i+Bj8CaUIY9Gy3DbbJmSzOjNHyej98pGJZb/jbQUaahWZjxyNEHCxmfRQ7rsfbR/4IRL Qc/HCruLNH7QXBhRFQ+w2HQsw9r6nZdKUqskgHI5hmrl1fLNQLMTN722xJ+m091XHEen kU09ZtzyjMs+73Fyf9BA6+evY6AKSxnXS+ZvSM+Ev74fliqQmaHB5AqKleldD+R1B9LI SBvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gBwz99Vs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si4263293edo.382.2020.06.19.08.54.37; Fri, 19 Jun 2020 08:55:00 -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=gBwz99Vs; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393183AbgFSPX2 (ORCPT + 99 others); Fri, 19 Jun 2020 11:23:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:50840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404243AbgFSPTu (ORCPT ); Fri, 19 Jun 2020 11:19:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48F2721582; Fri, 19 Jun 2020 15:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592579989; bh=83yHd3IpLuQ13t4mj1RI5+T4/mUQqOq0t6rfmIcAknc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gBwz99VsFsEEXrfxP4zFskXwtQYNaTQnAUp+bCJdBBn2P3L08esTpgXr5YNuAhFSG oo8hW5fybWt6ZUMR729AjN4n0tOOPi8BAJ3v//NrJDOPGbPZmMLRSF9qQVu13VNzYJ bVtFObvTmPjjBD/1xH+QEqH+h1yizhcjXxhW1+1c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Daniel Thompson , Sasha Levin Subject: [PATCH 5.7 051/376] kgdb: Disable WARN_CONSOLE_UNLOCKED for all kgdb Date: Fri, 19 Jun 2020 16:29:29 +0200 Message-Id: <20200619141712.768405176@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 @@ return_normal: 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 @@ cpu_master_loop: 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