Skip to content

Static analyser finding deviation

Luca Fancellu xen-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 3 repliesIn review
  2. v25 patches 9 repliesSuperseded
  3. v14 patches 26 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5xen/scripts: add xen-analysis.py for coverity and eclair analysis.gitignore docs/misra/documenting-violations.rst docs/misra/false-positive-coverity.json +9 more+675 -01 reply
2/5xen/scripts: add cppcheck tool to the xen-analysis.py script.gitignore docs/misra/cppcheck.txt docs/misra/documenting-violations.rst +12 more+864 -511 reply
3/5xen/Makefile: remove Cppcheck invocation from the Makefile.gitignore xen/Makefile xen/tools/merge_cppcheck_reports.py+6 -1981 reply
4/5tools/misra: fix skipped rule numbersxen/tools/convert_misra_doc.py+30 -20 replies
5/5xen: Justify linker script defined symbols in include/xen/kernel.hdocs/misra/safe.json xen/include/xen/kernel.h+13 -00 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchStefano StabelliniJan Beulich
1/5R-b
2/5R-b
3/5A-b
4/5R-b
5/5R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/5] Static analyser finding deviation

This serie introduces a way to suppress a static analyser finding providing a proper justification for it.
The process is explained in the docs/misra/documenting-violations.rst document that this serie will provide.
The tools currently supported are eclair, coverity and cppcheck, but the design is open to support many other static analysis tool.

The changes are split between the first two patches to reduce the review effort, the first patch is introducing the deviation process for the eclair and coverity tools, this is because their analysis system is similar.

The second patch is introducing the same deviation process for cppcheck, modifying the current way it is called from the makefile and improving its analysis.

The third is reverting cppcheck in the makefile.

The fourth patch is a fix for a tool used for cppcheck and the fifth patch is an example of how a deviation can be applied for some MISRA findings.

---
This serie was pushed as RFC and collected many feedbacks, thank you for the review.
In this serie to analyse the codebase, a script is used instead of integrating the process into the makefile.
---

Luca Fancellu (5):
xen/scripts: add xen-analysis.py for coverity and eclair analysis xen/scripts: add cppcheck tool to the xen-analysis.py script xen/Makefile: remove Cppcheck invocation from the Makefile tools/misra: fix skipped rule numbers
xen: Justify linker script defined symbols in include/xen/kernel.h

 .gitignore                                    |   9 +-
 docs/misra/cppcheck.txt                       |  27 +-
 docs/misra/documenting-violations.rst         | 212 ++++++++++++++
 docs/misra/false-positive-coverity.json       |  12 +
 docs/misra/false-positive-cppcheck.json       |  12 +
 docs/misra/false-positive-eclair.json         |  12 +
 docs/misra/safe.json                          |  20 ++
 docs/misra/xen-static-analysis.rst            |  90 ++++++
 xen/Makefile                                  | 116 +-------
 xen/include/hypercall-defs.c                  |   9 +
 xen/include/xen/kernel.h                      |   4 +
 xen/scripts/xen-analysis.py                   |  45 +++
 xen/scripts/xen_analysis/__init__.py          |   0
 xen/scripts/xen_analysis/cppcheck_analysis.py | 273 ++++++++++++++++++
 .../xen_analysis/cppcheck_report_utils.py     | 130 +++++++++
 xen/scripts/xen_analysis/generic_analysis.py  |  88 ++++++
 xen/scripts/xen_analysis/settings.py          | 169 +++++++++++
 xen/scripts/xen_analysis/tag_database.py      | 109 +++++++
 xen/scripts/xen_analysis/utils.py             |  56 ++++
 xen/tools/convert_misra_doc.py                |  32 +-
 xen/tools/cppcheck-cc.sh                      | 223 ++++++++++++++
 xen/tools/cppcheck-plat/arm32-wchar_t4.xml    |  17 ++
 xen/tools/cppcheck-plat/arm64-wchar_t2.xml    |  17 ++
 xen/tools/cppcheck-plat/x86_64-wchar_t2.xml   |  17 ++
 xen/tools/merge_cppcheck_reports.py           |  86 ------
 25 files changed, 1561 insertions(+), 224 deletions(-)
 create mode 100644 docs/misra/documenting-violations.rst
 create mode 100644 docs/misra/false-positive-coverity.json
 create mode 100644 docs/misra/false-positive-cppcheck.json
 create mode 100644 docs/misra/false-positive-eclair.json
 create mode 100644 docs/misra/safe.json
 create mode 100644 docs/misra/xen-static-analysis.rst
 create mode 100755 xen/scripts/xen-analysis.py
 create mode 100644 xen/scripts/xen_analysis/__init__.py
 create mode 100644 xen/scripts/xen_analysis/cppcheck_analysis.py
 create mode 100644 xen/scripts/xen_analysis/cppcheck_report_utils.py
 create mode 100644 xen/scripts/xen_analysis/generic_analysis.py
 create mode 100644 xen/scripts/xen_analysis/settings.py
 create mode 100644 xen/scripts/xen_analysis/tag_database.py
 create mode 100644 xen/scripts/xen_analysis/utils.py
 create mode 100755 xen/tools/cppcheck-cc.sh
 create mode 100644 xen/tools/cppcheck-plat/arm32-wchar_t4.xml
 create mode 100644 xen/tools/cppcheck-plat/arm64-wchar_t2.xml
 create mode 100644 xen/tools/cppcheck-plat/x86_64-wchar_t2.xml
 delete mode 100755 xen/tools/merge_cppcheck_reports.py
Signature · 1 line
2.17.1