Re: [v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-21 Thread Markus Elfring
>> Under which circumstances would you begin to care more for involved >> differences >> in corresponding run time characteristics? > > When the difference is hours vs seconds. Such a view can be influenced by execution environments in considerable ways. > In this case, there are tradeoffs betw

Re: [v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-21 Thread Julia Lawall
On Wed, 22 Jul 2020, Markus Elfring wrote: > > Markus, you are welcome to try this since you are concerned about it. > > I dare to point software design variations for some reasons. > > > > But it doesn't matter. > > Under which circumstances would you begin to care more for involved > differe

Re: [v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-21 Thread Markus Elfring
> Markus, you are welcome to try this since you are concerned about it. I dare to point software design variations for some reasons. > But it doesn't matter. Under which circumstances would you begin to care more for involved differences in corresponding run time characteristics? Regards, Mark

Re: [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-21 Thread Julia Lawall
On Wed, 22 Jul 2020, Markus Elfring wrote: > >>> +@depends on patch@ > >>> +expression from,to,size; > >>> +identifier l1,l2; > >>> +@@ > >>> + > >>> +- to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\)); > >>> ++ to = vmemdup_user(from,size); > >> > >> I propose to combine the desired

Re: [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-21 Thread Markus Elfring
>>> +@depends on patch@ >>> +expression from,to,size; >>> +identifier l1,l2; >>> +@@ >>> + >>> +- to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\)); >>> ++ to = vmemdup_user(from,size); >> >> I propose to combine the desired adjustment with the previous SmPL rule >> by using another disj

Re: [v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-21 Thread Markus Elfring
> This is fine as is in all three aspects. I have tried again to point specific data processing consequences out for operation modes of scripts in the semantic patch language. Regards, Markus

Re: [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-21 Thread Julia Lawall
On Tue, 21 Jul 2020, Markus Elfring wrote: > … > > +++ b/scripts/coccinelle/api/memdup_user.cocci > > @@ -39,6 +39,28 @@ … > … > > +@depends on patch@ > > +expression from,to,size; > > +identifier l1,l2; > > +@@ > > + > > +- to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\)); > > ++ to

Re: [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-21 Thread Markus Elfring
… > +++ b/scripts/coccinelle/api/memdup_user.cocci > @@ -39,6 +39,28 @@ … … > +@depends on patch@ > +expression from,to,size; > +identifier l1,l2; > +@@ > + > +- to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\)); > ++ to = vmemdup_user(from,size); I propose to combine the desired adjust

[PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()

2020-07-20 Thread Denis Efremov
Add vmemdup_user() transformations to the memdup_user.cocci rule. Commit 50fd2f298bef ("new primitive: vmemdup_user()") introduced vmemdup_user(). The function uses kvmalloc with GPF_USER flag. Signed-off-by: Denis Efremov --- scripts/coccinelle/api/memdup_user.cocci | 45 +++