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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d4412d54-41b1-4671-9733-34ba1423404c@redhat.com>
Date: Thu, 1 Aug 2024 15:52:12 +0200
From: Jocelyn Falempe <jfalempe@...hat.com>
To: John Ogness <john.ogness@...utronix.de>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
 David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
 Javier Martinez Canillas <javierm@...hat.com>,
 "Guilherme G . Piccoli" <gpiccoli@...lia.com>,
 bluescreen_avenger@...izon.net, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 3/3] drm/log: Introduce a new boot logger to draw the
 kmsg on the screen


On 01/08/2024 12:51, John Ogness wrote:
> On 2024-08-01, Jocelyn Falempe <jfalempe@...hat.com> wrote:
>>   * It uses a circular buffer so the console->write() callback is very
>>     quick, and will never stall.
>>   * Drawing is done asynchronously using a workqueue.
> 
> For CON_NBCON, neither of the above points are necessary. You can draw
> directly from the write_thread() callback. See below:
> 
>> +static bool drm_log_work_draw(void)
>> +{
>> +	unsigned int len;
>> +	char buf[512];
>> +
>> +	len = drm_log_buf_read(buf, sizeof(buf));
>> +	if (len)
>> +		drm_log_draw_all(buf, len);
>> +	return len != 0;
>> +}
> 
> For CON_NBCON, this is essentially your write_thread() callback:
> 
> void drm_log_write_thread(struct console *con,
> 			  struct nbcon_write_context *wctxt)
> {
> 	drm_log_draw_all(wctxt->outbuf, wctxt->len);
> }
> 
> You cannot implement a write_atomic() callback because the console must
> be able to print directly in NMI context and must not defer. But
> write_atomic() is optional, so you should be fine there.
> 
> Disclaimer: Only in PREEMPT_RT patchset at the moment.

Thanks, so that means the circular buffer and workqueue are only 
necessary until write_thread() is merged in mainline. It will be a nice 
simplification.
I think I can also register one console for each drm driver, which will 
simplify drm_log even further. (currently it would mean having a 
circular buffer and work function for each driver which is a bit too much).
Do you know if there is a chance to have write_thread() in 6.12 or 6.13 ?

> 
> John Ogness >

Best regards

-- 

Jocelyn


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ