From patchwork Wed Aug 9 08:07:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simone Ballarin X-Patchwork-Id: 13347522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D64CEB64DD for ; Wed, 9 Aug 2023 08:09:25 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.580760.909168 (Exim 4.92) (envelope-from ) id 1qTeFo-0003SF-KF; Wed, 09 Aug 2023 08:09:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 580760.909168; Wed, 09 Aug 2023 08:09:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTeFo-0003S8-GJ; Wed, 09 Aug 2023 08:09:16 +0000 Received: by outflank-mailman (input) for mailman id 580760; Wed, 09 Aug 2023 08:09:15 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTeFn-0003RD-07 for xen-devel@lists.xenproject.org; Wed, 09 Aug 2023 08:09:15 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 071effee-368c-11ee-b280-6b7b168915f2; Wed, 09 Aug 2023 10:09:13 +0200 (CEST) Received: from beta.station (net-188-218-251-179.cust.vodafonedsl.it [188.218.251.179]) by support.bugseng.com (Postfix) with ESMTPSA id 65B284EE073F; Wed, 9 Aug 2023 10:09:13 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 071effee-368c-11ee-b280-6b7b168915f2 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Simone Ballarin , Doug Goldstein , Stefano Stabellini Subject: [XEN PATCH 1/3] automation/eclair: update clean guidelines Date: Wed, 9 Aug 2023 10:07:59 +0200 Message-Id: <89e4ad4c56c083391b24b9da55212e888c5f3beb.1691568344.git.simone.ballarin@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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 Acked-by: Stefano Stabellini --- 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 From patchwork Wed Aug 9 08:08:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simone Ballarin X-Patchwork-Id: 13347523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45776C001B0 for ; Wed, 9 Aug 2023 08:09:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.580761.909178 (Exim 4.92) (envelope-from ) id 1qTeFu-0003mC-SN; Wed, 09 Aug 2023 08:09:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 580761.909178; Wed, 09 Aug 2023 08:09:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTeFu-0003m1-Oc; Wed, 09 Aug 2023 08:09:22 +0000 Received: by outflank-mailman (input) for mailman id 580761; Wed, 09 Aug 2023 08:09:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTeFt-0003RD-GB for xen-devel@lists.xenproject.org; Wed, 09 Aug 2023 08:09:21 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0b469882-368c-11ee-b280-6b7b168915f2; Wed, 09 Aug 2023 10:09:20 +0200 (CEST) Received: from beta.station (net-188-218-251-179.cust.vodafonedsl.it [188.218.251.179]) by support.bugseng.com (Postfix) with ESMTPSA id 5E77B4EE073F; Wed, 9 Aug 2023 10:09:20 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0b469882-368c-11ee-b280-6b7b168915f2 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Simone Ballarin , Doug Goldstein , Stefano Stabellini Subject: [XEN PATCH 2/3] automation/eclair: add ECL deviations Date: Wed, 9 Aug 2023 10:08:00 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 This patch adds some deviations for the following guidelines: Rule 2.1, Rule 5.3 and Rule 8.2. Signed-off-by: Simone Ballarin Acked-by: Stefano Stabellini --- .../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)"} From patchwork Wed Aug 9 08:08:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simone Ballarin X-Patchwork-Id: 13347524 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 930F8EB64DD for ; Wed, 9 Aug 2023 08:09:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.580763.909188 (Exim 4.92) (envelope-from ) id 1qTeFw-00042x-8q; Wed, 09 Aug 2023 08:09:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 580763.909188; Wed, 09 Aug 2023 08:09:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTeFw-00042n-5C; Wed, 09 Aug 2023 08:09:24 +0000 Received: by outflank-mailman (input) for mailman id 580763; Wed, 09 Aug 2023 08:09:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTeFv-0003RD-QH for xen-devel@lists.xenproject.org; Wed, 09 Aug 2023 08:09:23 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0cb5bcc8-368c-11ee-b280-6b7b168915f2; Wed, 09 Aug 2023 10:09:23 +0200 (CEST) Received: from beta.station (net-188-218-251-179.cust.vodafonedsl.it [188.218.251.179]) by support.bugseng.com (Postfix) with ESMTPSA id C02244EE0740; Wed, 9 Aug 2023 10:09:22 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0cb5bcc8-368c-11ee-b280-6b7b168915f2 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Simone Ballarin , Doug Goldstein , Stefano Stabellini Subject: [XEN PATCH 3/3] automation/eclair: update analyzed builds Date: Wed, 9 Aug 2023 10:08:01 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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 Acked-by: Stefano Stabellini --- 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 -# 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 -# 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