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

Markus Elfring
2020-03-30T06:11:45Z

>> 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?

Regards,
Markus