Re: [Kgdb-bugreport] [PATCH] kgdb: Resolve races during kgdb_io_register/unregister_module

2020-06-30 Thread Doug Anderson
Hi, On Tue, Jun 30, 2020 at 8:05 AM Daniel Thompson wrote: > > On Mon, Jun 29, 2020 at 02:03:52PM -0700, Doug Anderson wrote: > > Hi, > > > > On Mon, Jun 29, 2020 at 10:15 AM Daniel Thompson > > wrote: > > > > > > Currently kgdb_register_callbacks() and kgdb_unregister_callbacks() > > > are

Re: [Kgdb-bugreport] [PATCH v3] kdb: remove unnecessary null check of dbg_io_ops

2020-06-30 Thread Doug Anderson
Hi, On Tue, Jun 30, 2020 at 1:30 AM Cengiz Can wrote: > > `kdb_msg_write` operates on a global `struct kgdb_io *` called > `dbg_io_ops`. > > It's initialized in `debug_core.c` and checked throughout the debug > flow. > > There's a null check in `kdb_msg_write` which triggers static analyzers >

[Kgdb-bugreport] [PATCH] kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"

2020-06-30 Thread Douglas Anderson
On my system the kernel processes the "kgdb_earlycon" parameter before the "kgdbcon" parameter. When we setup "kgdb_earlycon" we'll end up in kgdb_register_callbacks() and "kgdb_use_con" won't have been set yet so we'll never get around to starting "kgdbcon". Let's remedy this by detecting that

Re: [Kgdb-bugreport] [bug report] kdb: Switch to use safer dbg_io_ops over console APIs

2020-06-30 Thread Doug Anderson
Hi, On Tue, Jun 30, 2020 at 10:49 AM Dan Carpenter wrote: > > Hello Sumit Garg, > > This is a semi-automatic email about new static checker warnings. > > The patch 5946d1f5b309: "kdb: Switch to use safer dbg_io_ops over > console APIs" from Jun 4, 2020, leads to the following Smatch > complaint:

[Kgdb-bugreport] [bug report] kdb: Switch to use safer dbg_io_ops over console APIs

2020-06-30 Thread Dan Carpenter
Hello Sumit Garg, This is a semi-automatic email about new static checker warnings. The patch 5946d1f5b309: "kdb: Switch to use safer dbg_io_ops over console APIs" from Jun 4, 2020, leads to the following Smatch complaint: kernel/debug/kdb/kdb_io.c:565 kdb_msg_write() error: we

Re: [Kgdb-bugreport] [PATCH] kgdb: Resolve races during kgdb_io_register/unregister_module

2020-06-30 Thread Daniel Thompson
On Mon, Jun 29, 2020 at 02:03:52PM -0700, Doug Anderson wrote: > Hi, > > On Mon, Jun 29, 2020 at 10:15 AM Daniel Thompson > wrote: > > > > Currently kgdb_register_callbacks() and kgdb_unregister_callbacks() > > are called outside the scope of the kgdb_registration_lock. This > > allows them to

Re: [Kgdb-bugreport] [PATCH v3] kdb: remove unnecessary null check of dbg_io_ops

2020-06-30 Thread Andy Shevchenko
On Tue, Jun 30, 2020 at 05:06:31PM +0530, Sumit Garg wrote: > On Tue, 30 Jun 2020 at 14:00, Cengiz Can wrote: > > > > `kdb_msg_write` operates on a global `struct kgdb_io *` called > > `dbg_io_ops`. > > > > It's initialized in `debug_core.c` and checked throughout the debug > > flow. > > > >

Re: [Kgdb-bugreport] [PATCH v3] kdb: remove unnecessary null check of dbg_io_ops

2020-06-30 Thread Sumit Garg
On Tue, 30 Jun 2020 at 14:00, Cengiz Can wrote: > > `kdb_msg_write` operates on a global `struct kgdb_io *` called > `dbg_io_ops`. > > It's initialized in `debug_core.c` and checked throughout the debug > flow. > > There's a null check in `kdb_msg_write` which triggers static analyzers > and

[Kgdb-bugreport] [PATCH v3] kdb: remove unnecessary null check of dbg_io_ops

2020-06-30 Thread Cengiz Can
`kdb_msg_write` operates on a global `struct kgdb_io *` called `dbg_io_ops`. It's initialized in `debug_core.c` and checked throughout the debug flow. There's a null check in `kdb_msg_write` which triggers static analyzers and gives the (almost entirely wrong) impression that it can be null.

Re: [Kgdb-bugreport] [PATCH 3/7] kgdb: Add request_nmi() to the io ops table for kgdboc

2020-06-30 Thread Sumit Garg
On Mon, 29 Jun 2020 at 17:15, Daniel Thompson wrote: > > On Fri, Jun 26, 2020 at 12:44:15PM -0700, Doug Anderson wrote: > > Hi, > > > > On Tue, Jun 23, 2020 at 3:59 AM Daniel Thompson > > wrote: > > > > > > On Tue, Jun 23, 2020 at 02:07:47PM +0530, Sumit Garg wrote: > > > > On Mon, 22 Jun 2020