Skip to contentSkip to conversation

Add files to the exclude list and update ECL files

PATCH In review Federico Serafini 2 participants 5 messages Aug 17, 2023

lore
Share & tools
lore
#0 lore raw

cover Add files to the exclude list and update ECL files

Add files to exclude-list.json and adapt the ECLAIR configuration to keep track of the changes.

Federico Serafini (2):
automation/eclair: update configuration
misra: add more entires to exclude-list.json

 .../eclair_analysis/ECLAIR/deviations.ecl     | 29 +++++++++++++++++++
 .../eclair_analysis/ECLAIR/out_of_scope.ecl   |  3 ++
 docs/misra/exclude-list.json                  | 12 ++++++++
 3 files changed, 44 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 automation/eclair: update configuration

Mark more files as "adopted" and configure Rule 8.3 in order to:
- exclude violations involving the type ret_t;
- exclude violations involving both an internal and an external file, thus avoiding touching adopted code.

---
 .../eclair_analysis/ECLAIR/deviations.ecl     | 29 +++++++++++++++++++
 .../eclair_analysis/ECLAIR/out_of_scope.ecl   |  3 ++
 2 files changed, 32 insertions(+)
automation/eclair_analysis/ECLAIR/deviations.ecl +29 -0
index 696618b59e..d8170106b4 100644
@@ -175,6 +175,35 @@ const-qualified."
 -config=MC3R1.R8.2,reports+={deliberate,"any_area(any_loc(file(adopted_r8_2)))"}
 -doc_end
 
+-doc_begin="The type ret_t is deliberately used and defined as int or long depending on the architecture."
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(text(^.*ret_t.*$)))"}
+-doc_end
+
+-doc_begin="The following files are imported from Linux and decompress.h defines a unique and documented interface towards all the (adopted) decompress functions."
+-file_tag+={adopted_decompress_r8_3,"^xen/common/bunzip2\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unlz4\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unlzma\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unlzo\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unxz\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unzstd\\.c$"}
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_decompress_r8_3)))&&any_area(any_loc(file(^xen/include/xen/decompress\\.h$)))"}
+-doc_end
+
+-doc_begin="The following file is imported from Linux: ignore for now."
+-file_tag+={adopted_time_r8_3,"^xen/arch/x86/time\\.c$"}
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_time_r8_3)))&&(any_area(any_loc(file(^xen/include/xen/time\\.h$)))||any_area(any_loc(file(^xen/arch/x86/include/asm/setup\\.h$))))"}
+-doc_end
+
+-doc_begin="The following file is imported from Linux: ignore for now."
+-file_tag+={adopted_cpu_idle_r8_3,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_cpu_idle_r8_3)))&&any_area(any_loc(file(^xen/include/xen/pmstat\\.h$)))"}
+-doc_end
+
+-doc_begin="The following file is imported from Linux: ignore for now."
+-file_tag+={adopted_mpparse_r8_3,"^xen/arch/x86/mpparse\\.c$"}
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_mpparse_r8_3)))&&any_area(any_loc(file(^xen/arch/x86/include/asm/mpspec\\.h$)))"}
+-doc_end
+
 -doc_begin="The following variables are compiled in multiple translation units
 belonging to different executables and therefore are safe."
 -config=MC3R1.R8.6,declarations+={safe, "name(current_stack_pointer||bsearch||sort)"}
automation/eclair_analysis/ECLAIR/out_of_scope.ecl +3 -0
index 44db6997b5..e1ec4a607c 100644
@@ -22,6 +22,9 @@
 -file_tag+={adopted,"^xen/drivers/acpi/numa\\.c$"}
 -file_tag+={adopted,"^xen/drivers/acpi/osl\\.c$"}
 -file_tag+={adopted,"^xen/drivers/acpi/tables\\.c$"}
+-file_tag+={adopted,"^xen/include/xen/acpi\\.h$"}
+-file_tag+={adopted,"^xen/include/acpi/acpiosxf\\.h$"}
+-file_tag+={adopted,"^xen/include/acpi/acpixf\\.h$"}
 -file_tag+={adopted,"^xen/lib/list-sort\\.c$"}
 -file_tag+={adopted,"^xen/lib/rbtree\\.c$"}
 -file_tag+={adopted,"^xen/lib/xxhash.*\\.c$"}
Signature · 1 line
2.34.1
Acked-by on v1 1/2
#2 lore raw

Re: [XEN PATCH 1/2] automation/eclair: update configuration

Quoted 6 lines · Federico Serafini

Mark more files as "adopted" and configure Rule 8.3 in order to:
- exclude violations involving the type ret_t;
- exclude violations involving both an internal and an external file, thus avoiding touching adopted code.

Quoted 62 lines
---
 .../eclair_analysis/ECLAIR/deviations.ecl     | 29 +++++++++++++++++++
 .../eclair_analysis/ECLAIR/out_of_scope.ecl   |  3 ++
 2 files changed, 32 insertions(+)
automation/eclair_analysis/ECLAIR/deviations.ecl +29 -0
index 696618b59e..d8170106b4 100644
@@ -175,6 +175,35 @@ const-qualified."
 -config=MC3R1.R8.2,reports+={deliberate,"any_area(any_loc(file(adopted_r8_2)))"}
 -doc_end
 
+-doc_begin="The type ret_t is deliberately used and defined as int or long depending on the architecture."
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(text(^.*ret_t.*$)))"}
+-doc_end
+
+-doc_begin="The following files are imported from Linux and decompress.h defines a unique and documented interface towards all the (adopted) decompress functions."
+-file_tag+={adopted_decompress_r8_3,"^xen/common/bunzip2\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unlz4\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unlzma\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unlzo\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unxz\\.c$"}
+-file_tag+={adopted_decompress_r8_3,"^xen/common/unzstd\\.c$"}
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_decompress_r8_3)))&&any_area(any_loc(file(^xen/include/xen/decompress\\.h$)))"}
+-doc_end
+
+-doc_begin="The following file is imported from Linux: ignore for now."
+-file_tag+={adopted_time_r8_3,"^xen/arch/x86/time\\.c$"}
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_time_r8_3)))&&(any_area(any_loc(file(^xen/include/xen/time\\.h$)))||any_area(any_loc(file(^xen/arch/x86/include/asm/setup\\.h$))))"}
+-doc_end
+
+-doc_begin="The following file is imported from Linux: ignore for now."
+-file_tag+={adopted_cpu_idle_r8_3,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_cpu_idle_r8_3)))&&any_area(any_loc(file(^xen/include/xen/pmstat\\.h$)))"}
+-doc_end
+
+-doc_begin="The following file is imported from Linux: ignore for now."
+-file_tag+={adopted_mpparse_r8_3,"^xen/arch/x86/mpparse\\.c$"}
+-config=MC3R1.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_mpparse_r8_3)))&&any_area(any_loc(file(^xen/arch/x86/include/asm/mpspec\\.h$)))"}
+-doc_end
+
 -doc_begin="The following variables are compiled in multiple translation units
 belonging to different executables and therefore are safe."
 -config=MC3R1.R8.6,declarations+={safe, "name(current_stack_pointer||bsearch||sort)"}
automation/eclair_analysis/ECLAIR/out_of_scope.ecl +3 -0
index 44db6997b5..e1ec4a607c 100644
@@ -22,6 +22,9 @@
 -file_tag+={adopted,"^xen/drivers/acpi/numa\\.c$"}
 -file_tag+={adopted,"^xen/drivers/acpi/osl\\.c$"}
 -file_tag+={adopted,"^xen/drivers/acpi/tables\\.c$"}
+-file_tag+={adopted,"^xen/include/xen/acpi\\.h$"}
+-file_tag+={adopted,"^xen/include/acpi/acpiosxf\\.h$"}
+-file_tag+={adopted,"^xen/include/acpi/acpixf\\.h$"}
 -file_tag+={adopted,"^xen/lib/list-sort\\.c$"}
 -file_tag+={adopted,"^xen/lib/rbtree\\.c$"}
 -file_tag+={adopted,"^xen/lib/xxhash.*\\.c$"}
Signature · 1 line
2.34.1
#3 lore raw

PATCH 2/2 misra: add more entires to exclude-list.json

In reply to Federico Serafini

Add entries to the exclude-list.json for those files that need to be excluded from the analysis scan.

---
 docs/misra/exclude-list.json | 12 ++++++++++++
 1 file changed, 12 insertions(+)
docs/misra/exclude-list.json +12 -0
index ca1e2dd678..3be9421e4d 100644
@@ -181,6 +181,18 @@
             "rel_path": "drivers/video/font_*",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+          "rel_path": "include/acpi/acpiosxf.h",
+          "comment": "Imported from Linux, ignore for now"
+        },
+        {
+          "rel_path": "include/acpi/acpixf.h",
+          "comment": "Imported from Linux, ignore for now"
+        },
+        {
+          "rel_path": "include/xen/acpi.h",
+          "comment": "Imported from Linux, ignore for now"
+        },
         {
             "rel_path": "lib/list-sort.c",
             "comment": "Imported from Linux, ignore for now"
Signature · 1 line
2.34.1
author Reviewed-by on v1 2/2
#4 lore raw

Re: [XEN PATCH 2/2] misra: add more entires to exclude-list.json

Quoted 21 lines · Federico Serafini

Add entries to the exclude-list.json for those files that need to be excluded from the analysis scan.

---
  docs/misra/exclude-list.json | 12 ++++++++++++
  1 file changed, 12 insertions(+)
docs/misra/exclude-list.json +5 -0
index ca1e2dd678..3be9421e4d 100644
@@ -181,6 +181,18 @@
              "rel_path": "drivers/video/font_*",
              "comment": "Imported from Linux, ignore for now"
          },
+        {
+          "rel_path": "include/acpi/acpiosxf.h",
+          "comment": "Imported from Linux, ignore for now"
+        },
+        {

docs/misra/exclude-list.json line 198

Quoted 10 lines
docs/misra/exclude-list.json +7 -0
+          "rel_path": "include/acpi/acpixf.h",
+          "comment": "Imported from Linux, ignore for now"
+        },
+        {
+          "rel_path": "include/xen/acpi.h",
+          "comment": "Imported from Linux, ignore for now"
+        },
          {
              "rel_path": "lib/list-sort.c",
              "comment": "Imported from Linux, ignore for now"

Wrong indentation, a v2 of this patch has already been sent.