Re: [Cocci] [v3 05/10] mmap locking API: Improving the Coccinelle software

From: Julia Lawall
Date: Mon Mar 30 2020 - 04:47:43 EST




On Mon, 30 Mar 2020, Markus Elfring wrote:

> >> How will corresponding software development resources evolve?
> >
> > I don't think I understand the question, or, actually, are you asking
> > me or the coccinelle developers ?
>
> I hope that more development challenges will be picked up.
>
> The code from a mentioned source file can be reduced to the following
> test file.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kvm/mmu/paging_tmpl.h?id=7111951b8d4973bda27ff663f2cf18b663d15b48#n122
>
> // deleted part
> static inline int FNAME(is_present_gpte)(unsigned long pte)
> {
> #if PTTYPE != PTTYPE_EPT
> return pte & PT_PRESENT_MASK;
> #else
> return pte & 7;
> #endif
> }
> // deleted part
>
>
> Application of the software âCoccinelle 1.0.8-00029-ga549b9f0â (OCaml 4.10.0)
>
> elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-c paging_tmpl-excerpt1.h
> â
> (ONCE) CPP-MACRO: found known macro = FNAME
> â
> parse error
> = File "paging_tmpl-excerpt1.h", line 2, column 41, charpos = 57
> around = 'unsigned',
> â
> BAD:!!!!! static inline int FNAME(is_present_gpte)(unsigned long pte)
> â
> NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0%
> nb good = 1, nb passed = 1 =========> 10.00% passed
> nb good = 1, nb bad = 8 =========> 20.00% good or passed
>
>
> How would you like to improve the affected software areas?

This can be addressed by adding a macro definition to standard.h.

But once the change is done, I don't see any reason to bother with this.

julia