[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] Make const ptr assign as function call in clang
From:       δ½™η”ŸδΈŽε› <lovesykun () gmail ! com>
Date:       2021-10-10 1:58:44
Message-ID: CAPj64b5M3=NWiGSv0mZDywogpx7Per_awBerdjM4HUgVU9gCbQ () mail ! gmail ! com
[Download RAW message or body]

On Sun, Oct 10, 2021 at 4:34 AM Denys Vlasenko <vda.linux@googlemail.com> wrote:
>
> On Sat, Oct 9, 2021 at 8:20 PM LoveSy <lovesykun@gmail.com> wrote:
> >
> > From: YU Jincheng <shana@zju.edu.cn>
> >
> > - This can act as memory barrier in clang to avoid
> >   read before assign of a const ptr
> >
> > Signed-off-by: LoveSy <shana@zju.edu.cn>
>
> git tree commit hook requires something of the form "Name Surname"
> in the signed-off lines. Can you use a name of this format?

Sorry about this. I will update it.

> I propose the attached patch. Please test that it works on clang 9.

It works.

> I assume we will need to massage every SET_PTR_TO_GLOBALS(xzalloc(sz))
> to something like XZALLOC_PTR_TO_GLOBALS(sz) too?
> The bug may be occurring there as well, right?

You remind me about this. And I award that in some scenarios
SET_PTR_TO_GLOBALS receives a stack object. And it also breaks the
thing.

I personally prefer making `barrier` as a function since it also makes
ASSIGN_GLOBAL_PTR work as expected. Otherwise, future usage of
ASSIGN_GLOBAL_PTR will also bring back this issue.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic