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: <CAKMK7uEZiezTmiD+TRNspspo+C0xvzhVF_E8gPr_s81MeDWO1g@mail.gmail.com>
Date:   Wed, 11 Jul 2018 17:07:23 +0200
From:   Daniel Vetter <daniel@...ll.ch>
To:     Hans de Goede <hdegoede@...hat.com>
Cc:     Steven Rostedt <rostedt@...dmis.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Petr Mladek <pmladek@...e.com>,
        Linux Fbdev development list <linux-fbdev@...r.kernel.org>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [PATCH v5 2/3] fbcon: Call WARN_CONSOLE_UNLOCKED() where applicable

On Wed, Jul 11, 2018 at 5:01 PM, Hans de Goede <hdegoede@...hat.com> wrote:
> Hi,
>
> On 11-07-18 16:52, Steven Rostedt wrote:
>>
>> On Wed, 11 Jul 2018 16:46:11 +0200
>> Thomas Zimmermann <tzimmermann@...e.de> wrote:
>>
>>> Hi
>>>
>>> Am 28.06.2018 um 11:03 schrieb Hans de Goede:
>>>>
>>>> Replace comments about places where the console lock should be held with
>>>> calls to WARN_CONSOLE_UNLOCKED() to assert that it is actually held.
>>>
>>>
>>> Debugging fbcon sometimes requires to not take the console lock. This
>>> patch breaks the debugging workaround provided by
>>> 'fb.lockless_register_fb'. The dmesg is now filled with warnings about
>>> the missing lock.
>>>
>>
>> What if you make lockless_register_fb visible to fbcon, and then we can
>> have a macro:
>>
>> #define WARN_FB_CONSOLE_UNLOCKED()                      \
>>         do {                                            \
>>                 if (unlikely(!lockless_register_fb))    \
>>                         WARN_CONSOLE_UNLOCKED();        \
>>         } while (0)
>>
>> And use that instead?
>
>
> Yes I'm already preparing a patch like that :)
>
> Without the unlikely though, this is not used in hot paths.

Note that you don't even need an EXPORT_SYMBOL since this is all in
the same module.
-Daniel

> Regards,
>
> Hans
>
>
>
>
>>
>> -- Steve
>>
>>
>>> Best regards
>>> Thomas
>>>
>>>> Acked-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
>>>> Reviewed-by: Daniel Vetter <daniel.vetter@...ll.ch>
>>>> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
>>>> Signed-off-by: Hans de Goede <hdegoede@...hat.com>
>>>> ---
>>>> Changes in v3:
>>>> -New patch in v3 of this patchset
>>>>
>>>> Changes in v4:
>>>> -Keep the comments about which fbcon functions need locks in place
>>>> ---
>>>>   drivers/video/fbdev/core/fbcon.c | 11 +++++++++++
>>>>   1 file changed, 11 insertions(+)
>>>>
>>>> diff --git a/drivers/video/fbdev/core/fbcon.c
>>>> b/drivers/video/fbdev/core/fbcon.c
>>>> index c910e74d46ff..cd8d52a967aa 100644
>>>> --- a/drivers/video/fbdev/core/fbcon.c
>>>> +++ b/drivers/video/fbdev/core/fbcon.c
>>>> @@ -828,6 +828,8 @@ static int set_con2fb_map(int unit, int newidx, int
>>>> user)
>>>>         struct fb_info *oldinfo = NULL;
>>>>         int found, err = 0;
>>>>   +     WARN_CONSOLE_UNLOCKED();
>>>> +
>>>>         if (oldidx == newidx)
>>>>                 return 0;
>>>>   @@ -3044,6 +3046,8 @@ static int fbcon_fb_unbind(int idx)
>>>>   {
>>>>         int i, new_idx = -1, ret = 0;
>>>>   +     WARN_CONSOLE_UNLOCKED();
>>>> +
>>>>         if (!fbcon_has_console_bind)
>>>>                 return 0;
>>>>   @@ -3094,6 +3098,8 @@ static int fbcon_fb_unregistered(struct fb_info
>>>> *info)
>>>>   {
>>>>         int i, idx;
>>>>   +     WARN_CONSOLE_UNLOCKED();
>>>> +
>>>>         idx = info->node;
>>>>         for (i = first_fb_vc; i <= last_fb_vc; i++) {
>>>>                 if (con2fb_map[i] == idx)
>>>> @@ -3131,6 +3137,9 @@ static int fbcon_fb_unregistered(struct fb_info
>>>> *info)
>>>>   static void fbcon_remap_all(int idx)
>>>>   {
>>>>         int i;
>>>> +
>>>> +       WARN_CONSOLE_UNLOCKED();
>>>> +
>>>>         for (i = first_fb_vc; i <= last_fb_vc; i++)
>>>>                 set_con2fb_map(i, idx, 0);
>>>>   @@ -3177,6 +3186,8 @@ static int fbcon_fb_registered(struct fb_info
>>>> *info)
>>>>   {
>>>>         int ret = 0, i, idx;
>>>>   +     WARN_CONSOLE_UNLOCKED();
>>>> +
>>>>         idx = info->node;
>>>>         fbcon_select_primary(info);
>>>>
>>>
>>>
>>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ