All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH 0/3] automation/eclair: update ECL configurations and builds
@ 2023-08-09  8:07 Simone Ballarin
  2023-08-09  8:07 ` [XEN PATCH 1/3] automation/eclair: update clean guidelines Simone Ballarin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Simone Ballarin @ 2023-08-09  8:07 UTC (permalink / raw)
  To: xen-devel; +Cc: consulting, Simone Ballarin, Doug Goldstein, Stefano Stabellini

This series contains new ECL configurations and adds some build options
in the ARM64 build.

Simone Ballarin (3):
  automation/eclair: update clean guidelines
  automation/eclair: add ECL deviations
  automation/eclair: update analyzed builds

 .../eclair_analysis/ECLAIR/deviations.ecl     | 34 ++++++++-----------
 automation/eclair_analysis/ECLAIR/tagging.ecl | 17 ++++++++--
 automation/eclair_analysis/xen_arm_config     | 14 +++-----
 automation/eclair_analysis/xen_x86_config     |  9 -----
 4 files changed, 34 insertions(+), 40 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [XEN PATCH 1/3] automation/eclair: update clean guidelines
  2023-08-09  8:07 [XEN PATCH 0/3] automation/eclair: update ECL configurations and builds Simone Ballarin
@ 2023-08-09  8:07 ` Simone Ballarin
  2023-08-09 20:38   ` Stefano Stabellini
  2023-08-09  8:08 ` [XEN PATCH 2/3] automation/eclair: add ECL deviations Simone Ballarin
  2023-08-09  8:08 ` [XEN PATCH 3/3] automation/eclair: update analyzed builds Simone Ballarin
  2 siblings, 1 reply; 7+ messages in thread
From: Simone Ballarin @ 2023-08-09  8:07 UTC (permalink / raw)
  To: xen-devel; +Cc: consulting, Simone Ballarin, Doug Goldstein, Stefano Stabellini

This patch splits the former list in two separate selectors
clean_guidelines_common and additional_clean_guidelines.

clean_guidelines_common contains the guidelines that are clean
in both the analyzed builds, instead additional_clean_guidelines
is popolated depending on the current one.

The following clean guidelines have been added:
- MC3R1.R1.1;
- MC3R1.R1.3;
- MC3R1.R3.1;
- MC3R1.R4.1;
- MC3R1.R17.4;
- MC3R1.R22.6;
- MC3R1.D4.3 (just x86_64);
- MC3R1.R5.3 (just arm64);
- MC3R1.R7.2 (just arm64);
- MC3R1.R8.6 (just arm64);
- MC3R1.R9.3 (just arm64).

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/tagging.ecl | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
index ef2e56e186..3f589fd716 100644
--- a/automation/eclair_analysis/ECLAIR/tagging.ecl
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -28,7 +28,20 @@
 ####################
 
 -doc_begin="Clean guidelines: new violations for these guidelines are not accepted."
--service_selector={clean_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5)$"
+
+-service_selector={clean_guidelines_common,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.1|MC3R1\\.R1\\.3|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.1|MC3R1\\.R3\\.2|MC3R1\\.R4\\.1|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.4|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5|MC3R1\\.R22\\.6)$"
 }
--reports+={clean:added,"service(clean_guidelines)"}
+
+-setq=target,getenv("XEN_TARGET_ARCH")
+
+if(string_equal(target,"x86_64"),
+    service_selector({"additional_clean_guidelines","^(MC3R1\\.D4\\.3)$"})
+)
+
+if(string_equal(target,"arm64"),
+    service_selector({"additional_clean_guidelines","^(MC3R1\\.R5\\.3|MC3R1\\.R7\\.2|MC3R1\\.R8\\.6|MC3R1\\.R9\\.3)$"})
+)
+
+-reports+={clean:added,"service(clean_guidelines_common||additional_clean_guidelines)"}
+
 -doc_end
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [XEN PATCH 2/3] automation/eclair: add ECL deviations
  2023-08-09  8:07 [XEN PATCH 0/3] automation/eclair: update ECL configurations and builds Simone Ballarin
  2023-08-09  8:07 ` [XEN PATCH 1/3] automation/eclair: update clean guidelines Simone Ballarin
@ 2023-08-09  8:08 ` Simone Ballarin
  2023-08-09 20:43   ` Stefano Stabellini
  2023-08-09  8:08 ` [XEN PATCH 3/3] automation/eclair: update analyzed builds Simone Ballarin
  2 siblings, 1 reply; 7+ messages in thread
From: Simone Ballarin @ 2023-08-09  8:08 UTC (permalink / raw)
  To: xen-devel; +Cc: consulting, Simone Ballarin, Doug Goldstein, Stefano Stabellini

This patch adds some deviations for the following guidelines:
Rule 2.1, Rule 5.3 and Rule 8.2.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
 .../eclair_analysis/ECLAIR/deviations.ecl     | 34 ++++++++-----------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index e1a06daf2f..696618b59e 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -14,8 +14,13 @@ Constant expressions and unreachable branches of if and switch statements are ex
 -config=MC3R1.R2.1,+reports={deliberate,"first_area(^.*is never referenced$)"}
 -doc_end
 
--doc_begin="Unreachability in the following macros are expected and safe."
--config=MC3R1.R2.1,statements+={safe,"macro(name(BUG||assert_failed||ERROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
+-doc_begin="Unreachability caused by calls to the following functions or macros is deliberate and there is no risk of code being unexpectedly left out."
+-config=MC3R1.R2.1,statements+={deliberate,"macro(name(BUG||assert_failed||ERROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
+-config=MC3R1.R2.1,statements+={deliberate, "call(decl(name(__builtin_unreachable||panic||do_unexpected_trap||machine_halt||machine_restart||maybe_reboot)))"}
+-doc_end
+
+-doc_begin="Unreachability of an ASSERT_UNREACHABLE() and analogous macro calls is deliberate and safe."
+-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(any_exp(macro(name(ASSERT_UNREACHABLE||PARSE_ERR_RET||PARSE_ERR||FAIL_MSR||FAIL_CPUID)))))"}
 -doc_end
 
 -doc_begin="Proving compliance with respect to Rule 2.2 is generally impossible:
@@ -93,25 +98,11 @@ conform to the directive."
 -doc_begin="The project adopted the rule with an exception listed in
 'docs/misra/rules.rst'"
 -config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^READ_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"}
--config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^max_t$))&&any_exp(macro(^min_t$))))"}
+-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^max(_t)?$))&&any_exp(macro(^min(_t)?$))))"}
 -config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read[bwlq]$))&&any_exp(macro(^read[bwlq]_relaxed$))))"}
 -config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^per_cpu$))&&any_exp(macro(^this_cpu$))))"}
--doc_end
-
--doc_begin="The identifier 'fdt' is a widely-used name, for which no suitable
-substitute can be found. It is understood in 'xen/arch/arm/efi-boot.h' that the
-static variable 'fdt' cannot be confused with parameter names of the function
-declarations that are present in the file."
--file_tag+={efi_boot_h, "^xen/arch/arm/efi/efi-boot\\.h$"}
--config=MC3R1.R5.3,reports+={deliberate, "any_area(decl(kind(var)&&static_storage()&&^fdt$)&&any_loc(file(efi_boot_h)))"}
--doc_end
-
--doc_begin="The identifier 'start' is a widely-used name, for which no suitable
-substitute can be found. It is understood in 'xen/include/xen/kernel.h' that the
-extern variable 'start' cannot be confused with omonymous parameter names of the
-function declarations where that variable is visible."
--file_tag+={kernel_h, "^xen/include/xen/kernel\\.h$"}
--config=MC3R1.R5.3,reports+={deliberate, "any_area(decl(kind(var)&&linkage(external)&&^start$)&&any_loc(file(kernel_h)))"}
+-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^__emulate_2op$))&&any_exp(macro(^__emulate_2op_nobyte$))))"}
+-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read_debugreg$))&&any_exp(macro(^write_debugreg$))))"}
 -doc_end
 
 -doc_begin="Function-like macros cannot be confused with identifiers that are
@@ -179,6 +170,11 @@ const-qualified."
 # Series 8.
 #
 
+-doc_begin="The following file is imported from Linux: ignore for now."
+-file_tag+={adopted_r8_2,"^xen/common/inflate\\.c$"}
+-config=MC3R1.R8.2,reports+={deliberate,"any_area(any_loc(file(adopted_r8_2)))"}
+-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)"}
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [XEN PATCH 3/3] automation/eclair: update analyzed builds
  2023-08-09  8:07 [XEN PATCH 0/3] automation/eclair: update ECL configurations and builds Simone Ballarin
  2023-08-09  8:07 ` [XEN PATCH 1/3] automation/eclair: update clean guidelines Simone Ballarin
  2023-08-09  8:08 ` [XEN PATCH 2/3] automation/eclair: add ECL deviations Simone Ballarin
@ 2023-08-09  8:08 ` Simone Ballarin
  2023-08-09 20:38   ` Stefano Stabellini
  2 siblings, 1 reply; 7+ messages in thread
From: Simone Ballarin @ 2023-08-09  8:08 UTC (permalink / raw)
  To: xen-devel; +Cc: consulting, Simone Ballarin, Doug Goldstein, Stefano Stabellini

The xen build for ARM64 now has new configuration options which
require to be defined: this patch defines them.

In both configuration files some no longer true comments have been removed.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
 automation/eclair_analysis/xen_arm_config | 14 ++++----------
 automation/eclair_analysis/xen_x86_config |  9 ---------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/automation/eclair_analysis/xen_arm_config b/automation/eclair_analysis/xen_arm_config
index 26f5fcca41..ef140ceb73 100644
--- a/automation/eclair_analysis/xen_arm_config
+++ b/automation/eclair_analysis/xen_arm_config
@@ -1,12 +1,3 @@
-# File provided in
-# Re: Xen MISRA C: Source files in scope and out of scope
-# from:	Stefano Stabellini <stefano.stabellini@amd.com>
-# date:	6 giu 2023, 02:53
-
-#
-# Automatically generated file; DO NOT EDIT.
-# Xen/arm 4.18-unstable Configuration
-#
 CONFIG_CC_IS_GCC=y
 CONFIG_GCC_VERSION=90400
 CONFIG_CLANG_VERSION=0
@@ -34,7 +25,9 @@ CONFIG_HVM=y
 CONFIG_SBSA_VUART_CONSOLE=y
 CONFIG_ARM_SSBD=y
 CONFIG_HARDEN_BRANCH_PREDICTOR=y
-# CONFIG_TEE is not set
+CONFIG_TEE=n
+CONFIG_OPTEE=n
+CONFIG_FFA=n
 # CONFIG_STATIC_SHM is not set
 # end of Architecture Features
 
@@ -47,6 +40,7 @@ CONFIG_ARM64_ERRATUM_819472=y
 CONFIG_ARM64_ERRATUM_843419=y
 CONFIG_ARM64_ERRATUM_832075=y
 CONFIG_ARM64_ERRATUM_834220=y
+CONFIG_ARM64_ERRATUM_1508412=y
 CONFIG_ARM_ERRATUM_858921=y
 CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
 CONFIG_ARM64_ERRATUM_1286807=y
diff --git a/automation/eclair_analysis/xen_x86_config b/automation/eclair_analysis/xen_x86_config
index d497814e01..abc44d43e1 100644
--- a/automation/eclair_analysis/xen_x86_config
+++ b/automation/eclair_analysis/xen_x86_config
@@ -1,12 +1,3 @@
-# File provided in
-# Re: Xen MISRA C: Source files in scope and out of scope
-# from:	Stefano Stabellini <stefano.stabellini@amd.com> 
-# date:	6 giu 2023, 02:53
-
-#
-# Automatically generated file; DO NOT EDIT.
-# Xen/x86 4.18-unstable Configuration
-#
 CONFIG_CC_IS_GCC=y
 CONFIG_GCC_VERSION=90400
 CONFIG_CLANG_VERSION=0
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [XEN PATCH 3/3] automation/eclair: update analyzed builds
  2023-08-09  8:08 ` [XEN PATCH 3/3] automation/eclair: update analyzed builds Simone Ballarin
@ 2023-08-09 20:38   ` Stefano Stabellini
  0 siblings, 0 replies; 7+ messages in thread
From: Stefano Stabellini @ 2023-08-09 20:38 UTC (permalink / raw)
  To: Simone Ballarin; +Cc: xen-devel, consulting, Doug Goldstein, Stefano Stabellini

On Wed, 9 Aug 2023, Simone Ballarin wrote:
> The xen build for ARM64 now has new configuration options which
> require to be defined: this patch defines them.
> 
> In both configuration files some no longer true comments have been removed.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>

(By the way, there is a way to start a Xen default kconfig from a seed
config so that we don't necessarely need to specify all the options. The
missing options are filled with default values.)


> ---
>  automation/eclair_analysis/xen_arm_config | 14 ++++----------
>  automation/eclair_analysis/xen_x86_config |  9 ---------
>  2 files changed, 4 insertions(+), 19 deletions(-)
> 
> diff --git a/automation/eclair_analysis/xen_arm_config b/automation/eclair_analysis/xen_arm_config
> index 26f5fcca41..ef140ceb73 100644
> --- a/automation/eclair_analysis/xen_arm_config
> +++ b/automation/eclair_analysis/xen_arm_config
> @@ -1,12 +1,3 @@
> -# File provided in
> -# Re: Xen MISRA C: Source files in scope and out of scope
> -# from:	Stefano Stabellini <stefano.stabellini@amd.com>
> -# date:	6 giu 2023, 02:53
> -
> -#
> -# Automatically generated file; DO NOT EDIT.
> -# Xen/arm 4.18-unstable Configuration
> -#
>  CONFIG_CC_IS_GCC=y
>  CONFIG_GCC_VERSION=90400
>  CONFIG_CLANG_VERSION=0
> @@ -34,7 +25,9 @@ CONFIG_HVM=y
>  CONFIG_SBSA_VUART_CONSOLE=y
>  CONFIG_ARM_SSBD=y
>  CONFIG_HARDEN_BRANCH_PREDICTOR=y
> -# CONFIG_TEE is not set
> +CONFIG_TEE=n
> +CONFIG_OPTEE=n
> +CONFIG_FFA=n
>  # CONFIG_STATIC_SHM is not set
>  # end of Architecture Features
>  
> @@ -47,6 +40,7 @@ CONFIG_ARM64_ERRATUM_819472=y
>  CONFIG_ARM64_ERRATUM_843419=y
>  CONFIG_ARM64_ERRATUM_832075=y
>  CONFIG_ARM64_ERRATUM_834220=y
> +CONFIG_ARM64_ERRATUM_1508412=y
>  CONFIG_ARM_ERRATUM_858921=y
>  CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
>  CONFIG_ARM64_ERRATUM_1286807=y
> diff --git a/automation/eclair_analysis/xen_x86_config b/automation/eclair_analysis/xen_x86_config
> index d497814e01..abc44d43e1 100644
> --- a/automation/eclair_analysis/xen_x86_config
> +++ b/automation/eclair_analysis/xen_x86_config
> @@ -1,12 +1,3 @@
> -# File provided in
> -# Re: Xen MISRA C: Source files in scope and out of scope
> -# from:	Stefano Stabellini <stefano.stabellini@amd.com> 
> -# date:	6 giu 2023, 02:53
> -
> -#
> -# Automatically generated file; DO NOT EDIT.
> -# Xen/x86 4.18-unstable Configuration
> -#
>  CONFIG_CC_IS_GCC=y
>  CONFIG_GCC_VERSION=90400
>  CONFIG_CLANG_VERSION=0
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XEN PATCH 1/3] automation/eclair: update clean guidelines
  2023-08-09  8:07 ` [XEN PATCH 1/3] automation/eclair: update clean guidelines Simone Ballarin
@ 2023-08-09 20:38   ` Stefano Stabellini
  0 siblings, 0 replies; 7+ messages in thread
From: Stefano Stabellini @ 2023-08-09 20:38 UTC (permalink / raw)
  To: Simone Ballarin; +Cc: xen-devel, consulting, Doug Goldstein, Stefano Stabellini

On Wed, 9 Aug 2023, Simone Ballarin wrote:
> This patch splits the former list in two separate selectors
> clean_guidelines_common and additional_clean_guidelines.
> 
> clean_guidelines_common contains the guidelines that are clean
> in both the analyzed builds, instead additional_clean_guidelines
> is popolated depending on the current one.
> 
> The following clean guidelines have been added:
> - MC3R1.R1.1;
> - MC3R1.R1.3;
> - MC3R1.R3.1;
> - MC3R1.R4.1;
> - MC3R1.R17.4;
> - MC3R1.R22.6;
> - MC3R1.D4.3 (just x86_64);
> - MC3R1.R5.3 (just arm64);
> - MC3R1.R7.2 (just arm64);
> - MC3R1.R8.6 (just arm64);
> - MC3R1.R9.3 (just arm64).
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  automation/eclair_analysis/ECLAIR/tagging.ecl | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
> index ef2e56e186..3f589fd716 100644
> --- a/automation/eclair_analysis/ECLAIR/tagging.ecl
> +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
> @@ -28,7 +28,20 @@
>  ####################
>  
>  -doc_begin="Clean guidelines: new violations for these guidelines are not accepted."
> --service_selector={clean_guidelines,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.2|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5)$"
> +
> +-service_selector={clean_guidelines_common,"^(MC3R1\\.D1\\.1|MC3R1\\.D2\\.1|MC3R1\\.D4\\.11|MC3R1\\.D4\\.14|MC3R1\\.R1\\.1|MC3R1\\.R1\\.3|MC3R1\\.R1\\.4|MC3R1\\.R2\\.2|MC3R1\\.R3\\.1|MC3R1\\.R3\\.2|MC3R1\\.R4\\.1|MC3R1\\.R5\\.1|MC3R1\\.R5\\.2|MC3R1\\.R5\\.4|MC3R1\\.R6\\.1|MC3R1\\.R6\\.2|MC3R1\\.R7\\.1|MC3R1\\.R8\\.1|MC3R1\\.R8\\.5|MC3R1\\.R8\\.8|MC3R1\\.R8\\.10|MC3R1\\.R8\\.12|MC3R1\\.R8\\.14|MC3R1\\.R9\\.2|MC3R1\\.R9\\.4|MC3R1\\.R9\\.5|MC3R1\\.R12\\.5|MC3R1\\.R17\\.3|MC3R1\\.R17\\.4|MC3R1\\.R17\\.6|MC3R1\\.R21\\.13|MC3R1\\.R21\\.19|MC3R1\\.R21\\.21|MC3R1\\.R22\\.2|MC3R1\\.R22\\.4|MC3R1\\.R22\\.5|MC3R1\\.R22\\.6)$"
>  }
> --reports+={clean:added,"service(clean_guidelines)"}
> +
> +-setq=target,getenv("XEN_TARGET_ARCH")
> +
> +if(string_equal(target,"x86_64"),
> +    service_selector({"additional_clean_guidelines","^(MC3R1\\.D4\\.3)$"})
> +)
> +
> +if(string_equal(target,"arm64"),
> +    service_selector({"additional_clean_guidelines","^(MC3R1\\.R5\\.3|MC3R1\\.R7\\.2|MC3R1\\.R8\\.6|MC3R1\\.R9\\.3)$"})
> +)
> +
> +-reports+={clean:added,"service(clean_guidelines_common||additional_clean_guidelines)"}
> +
>  -doc_end
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [XEN PATCH 2/3] automation/eclair: add ECL deviations
  2023-08-09  8:08 ` [XEN PATCH 2/3] automation/eclair: add ECL deviations Simone Ballarin
@ 2023-08-09 20:43   ` Stefano Stabellini
  0 siblings, 0 replies; 7+ messages in thread
From: Stefano Stabellini @ 2023-08-09 20:43 UTC (permalink / raw)
  To: Simone Ballarin; +Cc: xen-devel, consulting, Doug Goldstein, Stefano Stabellini

On Wed, 9 Aug 2023, Simone Ballarin wrote:
> This patch adds some deviations for the following guidelines:
> Rule 2.1, Rule 5.3 and Rule 8.2.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>

Looking at the below, is there anything we should add to
docs/misra/rules.rst to specify that we are adopting the MISRA rule but
in a slightly different way? 

I am happy to make any necessary changes to docs/misra/rules.rst myself,
but I would like to keep docs/misra/rules.rst consistent with
deviations.ecl.

It seems to me that maybe we should add a note about
ASSERT_UNREACHABLE() and BUG() and similar for Rule 2.1. What do you
think? Anything else that I am missing?


> ---
>  .../eclair_analysis/ECLAIR/deviations.ecl     | 34 ++++++++-----------
>  1 file changed, 15 insertions(+), 19 deletions(-)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
> index e1a06daf2f..696618b59e 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -14,8 +14,13 @@ Constant expressions and unreachable branches of if and switch statements are ex
>  -config=MC3R1.R2.1,+reports={deliberate,"first_area(^.*is never referenced$)"}
>  -doc_end
>  
> --doc_begin="Unreachability in the following macros are expected and safe."
> --config=MC3R1.R2.1,statements+={safe,"macro(name(BUG||assert_failed||ERROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
> +-doc_begin="Unreachability caused by calls to the following functions or macros is deliberate and there is no risk of code being unexpectedly left out."
> +-config=MC3R1.R2.1,statements+={deliberate,"macro(name(BUG||assert_failed||ERROR_EXIT||ERROR_EXIT_DOM||PIN_FAIL))"}
> +-config=MC3R1.R2.1,statements+={deliberate, "call(decl(name(__builtin_unreachable||panic||do_unexpected_trap||machine_halt||machine_restart||maybe_reboot)))"}
> +-doc_end
> +
> +-doc_begin="Unreachability of an ASSERT_UNREACHABLE() and analogous macro calls is deliberate and safe."
> +-config=MC3R1.R2.1,reports+={deliberate, "any_area(any_loc(any_exp(macro(name(ASSERT_UNREACHABLE||PARSE_ERR_RET||PARSE_ERR||FAIL_MSR||FAIL_CPUID)))))"}
>  -doc_end
>  
>  -doc_begin="Proving compliance with respect to Rule 2.2 is generally impossible:
> @@ -93,25 +98,11 @@ conform to the directive."
>  -doc_begin="The project adopted the rule with an exception listed in
>  'docs/misra/rules.rst'"
>  -config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^READ_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"}
> --config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^max_t$))&&any_exp(macro(^min_t$))))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^max(_t)?$))&&any_exp(macro(^min(_t)?$))))"}
>  -config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read[bwlq]$))&&any_exp(macro(^read[bwlq]_relaxed$))))"}
>  -config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^per_cpu$))&&any_exp(macro(^this_cpu$))))"}
> --doc_end
> -
> --doc_begin="The identifier 'fdt' is a widely-used name, for which no suitable
> -substitute can be found. It is understood in 'xen/arch/arm/efi-boot.h' that the
> -static variable 'fdt' cannot be confused with parameter names of the function
> -declarations that are present in the file."
> --file_tag+={efi_boot_h, "^xen/arch/arm/efi/efi-boot\\.h$"}
> --config=MC3R1.R5.3,reports+={deliberate, "any_area(decl(kind(var)&&static_storage()&&^fdt$)&&any_loc(file(efi_boot_h)))"}
> --doc_end
> -
> --doc_begin="The identifier 'start' is a widely-used name, for which no suitable
> -substitute can be found. It is understood in 'xen/include/xen/kernel.h' that the
> -extern variable 'start' cannot be confused with omonymous parameter names of the
> -function declarations where that variable is visible."
> --file_tag+={kernel_h, "^xen/include/xen/kernel\\.h$"}
> --config=MC3R1.R5.3,reports+={deliberate, "any_area(decl(kind(var)&&linkage(external)&&^start$)&&any_loc(file(kernel_h)))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^__emulate_2op$))&&any_exp(macro(^__emulate_2op_nobyte$))))"}
> +-config=MC3R1.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read_debugreg$))&&any_exp(macro(^write_debugreg$))))"}
>  -doc_end
>  
>  -doc_begin="Function-like macros cannot be confused with identifiers that are
> @@ -179,6 +170,11 @@ const-qualified."
>  # Series 8.
>  #
>  
> +-doc_begin="The following file is imported from Linux: ignore for now."
> +-file_tag+={adopted_r8_2,"^xen/common/inflate\\.c$"}
> +-config=MC3R1.R8.2,reports+={deliberate,"any_area(any_loc(file(adopted_r8_2)))"}
> +-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)"}
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-09 20:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09  8:07 [XEN PATCH 0/3] automation/eclair: update ECL configurations and builds Simone Ballarin
2023-08-09  8:07 ` [XEN PATCH 1/3] automation/eclair: update clean guidelines Simone Ballarin
2023-08-09 20:38   ` Stefano Stabellini
2023-08-09  8:08 ` [XEN PATCH 2/3] automation/eclair: add ECL deviations Simone Ballarin
2023-08-09 20:43   ` Stefano Stabellini
2023-08-09  8:08 ` [XEN PATCH 3/3] automation/eclair: update analyzed builds Simone Ballarin
2023-08-09 20:38   ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.