lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240913140538.221708-1-john.ogness@linutronix.de>
Date: Fri, 13 Sep 2024 16:11:34 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jiri Slaby <jirislaby@...nel.org>,
	Petr Mladek <pmladek@...e.com>,
	Sergey Senozhatsky <senozhatsky@...omium.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Esben Haabendal <esben@...nix.com>,
	linux-serial@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Sunil V L <sunilvl@...tanamicro.com>,
	Arnd Bergmann <arnd@...db.de>,
	Florian Fainelli <f.fainelli@...il.com>,
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
	Lino Sanfilippo <l.sanfilippo@...bus.com>,
	Rengarajan S <rengarajan.s@...rochip.com>,
	Serge Semin <fancer.lancer@...il.com>,
	"Paul E. McKenney" <paulmck@...nel.org>,
	Tony Lindgren <tony@...mide.com>,
	Udit Kumar <u-kumar1@...com>,
	Ronald Wahl <ronald.wahl@...itan.com>,
	Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
	Thomas Richard <thomas.richard@...tlin.com>,
	Griffin Kroah-Hartman <griffin@...ah.com>,
	Florian Fainelli <florian.fainelli@...adcom.com>,
	Wolfram Sang <wsa+renesas@...g-engineering.com>,
	Peter Collingbourne <pcc@...gle.com>
Subject: [PATCH next v2 0/4] convert 8250 to nbcon

The recent printk rework introduced a new type of console NBCON
that will perform printing via a dedicated kthread during
normal operation. For times when the kthread is not available
(early boot, panic, reboot/shutdown) the NBCON console will
print directly from the printk() calling context (even if from
NMI).

Futher details about NBCON consoles are in the cover letter of
v1 of the NBCON series [0]. (Note that they were originally
named NOBKL consoles, but were later renamed to NBCON.)

This is v2 of a series to convert the 8250 driver to an NBCON
console, providing both threaded and atomic printing
implementations. v1 of this series is here [1].

Users can verify the UART console is an NBCON console via the
proc filesystem. For example:

$  cat /proc/consoles
ttyS0                -W- (EC N  a)    4:64

The 'N' shows that it is an NBCON console.

There will also be a dedicated printing kthread. For example:

$ ps ax | grep pr/
   16 root       0:00 [pr/ttyS0]

Derek Barbosa performed extensive tests [2] using this driver
and encountered no issues. On the contrary, his tests showed
the improved reliability and non-interference features of the
NBCON-based driver.

Since this is the first console driver to be converted to an
NBCON console, it may include variables and functions that
could be abstracted to all UART consoles (such as the
@console_line_ended field). However, we can abstract such
things later as more consoles are converted to NBCON.

Here are the changes since v1:

- Remove legacy write() code rather than hide it under the
  macro USE_SERIAL_8250_LEGACY_CONSOLE.

- Implement write_atomic() support for RS485 by splitting out
  the IER register modifications into separate wrapper
  functions.

- Update the RS485 call sites to use the new wrapper functions.

- Implement write_atomic() support for modem control by
  deferring to a new dedicated irq_work.

- Rename @console_newline_needed to @console_line_ended and
  invert the logic.

Note that this series is based on the "for-next" branch of the
printk git [3]. This is because the tty-next tree does not have
the NBCON series and thus causes problems for the kbuild
robots. However, this series does apply cleanly on the tty-next
tree (it just will not build).

John Ogness

[0] https://lore.kernel.org/lkml/20230302195618.156940-1-john.ogness@linutronix.de
[1] https://lore.kernel.org/lkml/20240905134719.142554-1-john.ogness@linutronix.de
[2] https://lore.kernel.org/lkml/ZsdoD6PomBRsB-ow@debarbos-thinkpadt14sgen2i.remote.csb
[3] https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git

John Ogness (4):
  serial: 8250: Split out IER from rs485_start_tx()
  serial: 8250: Split out IER from rs485_stop_tx()
  serial: 8250: Switch to nbcon console
  serial: 8250: Revert "drop lockdep annotation from
    serial8250_clear_IER()"

 drivers/tty/serial/8250/8250.h      |   3 +
 drivers/tty/serial/8250/8250_core.c |  35 +++-
 drivers/tty/serial/8250/8250_omap.c |   2 +-
 drivers/tty/serial/8250/8250_port.c | 248 ++++++++++++++++++----------
 include/linux/serial_8250.h         |   9 +-
 5 files changed, 200 insertions(+), 97 deletions(-)


base-commit: b794563ea12fb46d9499da9e30c33d9607e33697
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ