[XEN PATCH v2 4/4] xen/pci: address a violation of MISRA C Rule 16.3

2024-10-07 Thread Federico Serafini
Refactor the code to avoid an implicit fallthrough and address a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- Changes in v2: - improved description. -

[XEN PATCH v2 0/4] x86: address violations of MISRA C Rule 16.3

2024-10-07 Thread Federico Serafini
gh keyword that is not defined in x86-emulate.h at the moment). Federico Serafini (4): x86/emul: add defensive code x86/emul: address violations of MISRA C Rule 16.3 xen/vpci: address violations of MISRA C Rule 16.3 xen/pci: address a violation of MISRA C Rule 16.3 xen/arch/x86/x8

[XEN PATCH v2 2/4] x86/emul: address violations of MISRA C Rule 16.3

2024-10-07 Thread Federico Serafini
Add missing break statements to address violations of MISRA C:2012 Rule 16.3 (An unconditional `break' statement shall terminate every switch-clause). Make explicit unreachability of a program points with ASSERT_UNREACHABLE(). No functional change. Signed-off-by: Federico Serafini --- Ch

[XEN PATCH v2 3/4] xen/vpci: address violations of MISRA C Rule 16.3

2024-10-07 Thread Federico Serafini
Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- Changes from v2: - simply break without returning X86EMUL_UNHANDLEABLE. As pointed out by Jan, these

[XEN PATCH v2 1/4] x86/emul: add defensive code

2024-10-07 Thread Federico Serafini
Add defensive code after unreachable program points. This also meets the requirements to deviate violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini --- Changes in v2: - use goto unhandl

[XEN PATCH v3] x86/emul: address violations of MISRA C Rule 16.3

2024-10-21 Thread Federico Serafini
Add missing break statements to address violations of MISRA C:2012 Rule 16.3 (An unconditional `break' statement shall terminate every switch-clause). Make explicit unreachability of a program point with ASSERT_UNREACHABLE() and add defensive code. No functional change. Signed-off-by: Fed

[XEN PATCH] automation/eclair: monitor Rules 11.2 and 18.1 and update configuration

2024-10-29 Thread Federico Serafini
Add Rule 11.2 and Rule 18.1 to the monitored set. Tag Rule 7.3 as clean. Tag Rule 11.2 and Rule 20.7 as clean only for arm. Rule 2.2, Rule 9.5 and Directive 4.12 are not accepted: do not enable them and do not tag them as clean. Signed-off-by: Federico Serafini --- automation/eclair_analysis

[XEN PATCH v2 2/3] x86/emul: use pseudo keyword fallthrough

2024-11-13 Thread Federico Serafini
witch-clause". No functional change. Signed-off-by: Federico Serafini --- No changes from v1. --- xen/arch/x86/x86_emulate/decode.c | 6 -- xen/arch/x86/x86_emulate/x86_emulate.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_emulate/decode.c

[XEN PATCH v2 3/3] automation/eclair: tag Rule 16.3 as clean

2024-11-13 Thread Federico Serafini
Tag MISRA C:2012 Rule 16.3 as clean for both architectures: new violations will cause a failure of the CI/CD pipeline. Signed-off-by: Federico Serafini --- No changes from v1. --- automation/eclair_analysis/ECLAIR/tagging.ecl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[XEN PATCH v2 0/3] x86: address violations of MISRA C Rule 16.3

2024-11-13 Thread Federico Serafini
Define pseudo keyword fallthrough for the x86 emulator, use it and tag the rule as clean. Federico Serafini (3): x86/emul: auxiliary definition of pseudo keyword fallthrough x86/emul: use pseudo keyword fallthrough automation/eclair: tag Rule 16.3 as clean automation/eclair_analysis

Re: [XEN PATCH v2 3/3] automation/eclair: tag Rule 16.3 as clean

2024-11-13 Thread Federico Serafini
On 13/11/24 10:57, Jan Beulich wrote: On 13.11.2024 09:17, Federico Serafini wrote: Tag MISRA C:2012 Rule 16.3 as clean for both architectures: new violations will cause a failure of the CI/CD pipeline. Signed-off-by: Federico Serafini --- No changes from v1. --- automation/eclair_analysis

[XEN PATCH v2 1/3] x86/emul: auxiliary definition of pseudo keyword fallthrough

2024-11-13 Thread Federico Serafini
and fuzzing harness without iterfearing with the one that the Xen build has. Signed-off-by: Federico Serafini --- Changes from v1: - moved definition in the right file; - remove useless parenthesis; - description improved. --- tools/tests/x86_emulator/x86-emulate.h | 10 ++ 1 file

Re: [XEN PATCH 1/3] x86/emul: define pseudo keyword fallthrough

2024-11-12 Thread Federico Serafini
On 06/11/24 12:22, Jan Beulich wrote: On 06.11.2024 10:04, Federico Serafini wrote: The pseudo keyword fallthrough shall be used to make explicit the fallthrough intention at the end of a case statement (doing this through comments is deprecated). Signed-off-by: Federico Serafini --- xen

[XEN PATCH v2 1/3] EFI: address a violation of MISRA C Rule 13.6

2024-09-30 Thread Federico Serafini
sions mentioned above violates MISRA C:2012 Rule 13.6 (The operand of the `sizeof' operator shall not contain any expression which has potential side effect). Refactor the code to address the rule violation. Suggested-by: Andrew Cooper Signed-off-by: Federico Serafini --- Changes in v2: - better d

[XEN PATCH v2 2/3] xen/gnttab: address a violation of MISRA C Rule 13.6

2024-09-30 Thread Federico Serafini
above violates MISRA C:2012 Rule 13.6 (The operand of the `sizeof' operator shall not contain any expression which has potential side effect). Refactor the code to address the rule violation. Suggested-by: Andrew Cooper Signed-off-by: Federico Serafini --- Changes in v2: - better d

[XEN PATCH v2 3/3] automation/eclair: tag Rule 13.6 as clean

2024-09-30 Thread Federico Serafini
Update ECLAIR configuration to consider Rule 13.6 as clean: new violations of this rule will cause a failure of the CI pipeline. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/tagging.ecl | 1 + 1 file changed, 1 insertion(+) diff --git a/automation/eclair_analysis

[XEN PATCH v2 0/3] xen: address violations of MISRA C Rule 13.6

2024-09-30 Thread Federico Serafini
Address remaining violations of Rule 13.6 and tag it as clean. Federico Serafini (3): EFI: address violations of MISRA C Rule 13.6 xen/gnttab: address violations of MISRA C Rule 13.6 automation/eclair: tag Rule 13.6 as clean automation/eclair_analysis/ECLAIR/tagging.ecl | 1 + xen/common

[XEN PATCH 2/3] x86/emul: use pseudo keyword fallthrough

2024-11-06 Thread Federico Serafini
quot;. No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/x86_emulate/decode.c | 6 -- xen/arch/x86/x86_emulate/x86_emulate.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/deco

[XEN PATCH 1/3] x86/emul: define pseudo keyword fallthrough

2024-11-06 Thread Federico Serafini
The pseudo keyword fallthrough shall be used to make explicit the fallthrough intention at the end of a case statement (doing this through comments is deprecated). Signed-off-by: Federico Serafini --- xen/arch/x86/x86_emulate/x86_emulate.h | 10 ++ 1 file changed, 10 insertions(+) diff

[XEN PATCH 0/3] x86: address violations of MISRA C Rule 16.3

2024-11-06 Thread Federico Serafini
Define pseudo keyword fallthrough for the x86 emulator, use it and tag the rule as clean. Federico Serafini (3): x86/emul: define pseudo keyword fallthrough x86/emul: use pseudo keyword fallthrough automation/eclair: tag Rule 16.3 as clean automation/eclair_analysis/ECLAIR/tagging.ecl

[XEN PATCH 3/3] automation/eclair: tag Rule 16.3 as clean

2024-11-06 Thread Federico Serafini
Tag MISRA C:2012 Rule 16.3 as clean for both architectures: new violations will cause a failure of the CI/CD pipeline. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/tagging.ecl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automation

Re: [XEN PATCH for 4.19] automation/eclair: add deviations agreed in MISRA meetings

2024-06-26 Thread Federico Serafini
or 'void *', and thereby MISRA won't complain about code with such conversions? Exactly, taking into account section 4.7 of GCC manual. -- Federico Serafini, M.Sc. Software Engineer, BUGSENG (http://bugseng.com)

[XEN PATCH v3 01/12] automation/eclair: fix deviation of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Escape the final dot of the comment and extend the search of a fallthrough comment up to 2 lines after the last statement. Fixes: a128d8da913b ("automation/eclair: add deviations for MISRA C:2012 Rule 16.3") Reported-by: Jan Beulich Signed-off-by: Federico Serafini Acked-by: Stefano

[XEN PATCH v3 04/12] x86/vpmu: address violations of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- Changes in v3: - addressed all violations of R16.3 in vpmu_intel.c --- x

[XEN PATCH v3 05/12] x86/traps: address violations of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Add break or pseudo keyword fallthrough to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- Changes in v3: - use break instead of fallthrough. --- xen/a

[XEN PATCH v3 02/12] x86/cpuid: use fallthrough pseudo keyword

2024-06-26 Thread Federico Serafini
The current comment making explicit the fallthrough intention does not follow the agreed syntax: replace it with the pseduo keyword. No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/cpuid.c | 3 +-- 1 file changed

[XEN PATCH v3 09/12] x86/mm: add defensive return

2024-06-26 Thread Federico Serafini
Add defensive return statement at the end of an unreachable default case. Other than improve safety, this meets the requirements to deviate a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini

[XEN PATCH v3 10/12] x86/mpparse: address a violation of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Add a missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x8

[XEN PATCH v3 12/12] x86/vlapic: address a violation of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/h

[XEN PATCH v3 00/12] x86: address some violations of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
This patch series fixes a missing escape in a deviation and addresses some violations. Federico Serafini (12): automation/eclair: fix deviation of MISRA C Rule 16.3 x86/cpuid: use fallthrough pseudo keyword x86/domctl: address a violation of MISRA C Rule 16.3 x86/vpmu: address violations

[XEN PATCH v3 06/12] x86/mce: address violations of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch

[XEN PATCH v3 03/12] x86/domctl: address a violation of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/do

[XEN PATCH v3 08/12] x86/vpt: address a violation of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Add pseudo keyword fallthrough to meet the requirements to deviate a violation of MISRA C Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini --- Changes in v3: - better indentation of fallth

[XEN PATCH v3 11/12] x86/vPIC: address a violation of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
Add pseudokeyword fallthrough to meet the requirements to deviate a violation of MISRA C Rul 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Be

[XEN PATCH v3 07/12] x86/hvm: address violations of MISRA C Rule 16.3

2024-06-26 Thread Federico Serafini
ment is reached. Signed-off-by: Federico Serafini --- Changes in v3: - squashed here modifications of pmtimer.c; - no blank line after fallthrough; - better indentation of fallthrough. --- xen/arch/x86/hvm/emulate.c | 9 ++--- xen/arch/x86/hvm/hvm.c | 5 + xen/arch/x86/hvm/hypercall.c

Re: [XEN PATCH v3 07/12] x86/hvm: address violations of MISRA C Rule 16.3

2024-07-02 Thread Federico Serafini
On 01/07/24 10:47, Jan Beulich wrote: On 26.06.2024 11:28, Federico Serafini wrote: @@ -2798,11 +2800,12 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr, hvio->mmio_insn_bytes = sizeof(hvio->mmio_insn); memcpy(hvio->mmio_insn, curr->a

Re: [XEN PATCH v3 08/12] x86/vpt: address a violation of MISRA C Rule 16.3

2024-07-02 Thread Federico Serafini
On 01/07/24 10:49, Jan Beulich wrote: On 26.06.2024 11:28, Federico Serafini wrote: --- a/xen/arch/x86/hvm/vpt.c +++ b/xen/arch/x86/hvm/vpt.c @@ -118,9 +118,11 @@ static int pt_irq_masked(struct periodic_time *pt) return 0; gsi = hvm_isa_irq_to_gsi(pt->

[XEN PATCH v4 3/9] x86/domctl: address a violation of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/do

[XEN PATCH v4 1/9] automation/eclair: fix deviation of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
Escape the final dot of the comment and extend the search of a fallthrough comment up to 2 lines after the last statement. Fixes: Fixes: a128d8da91 ("automation/eclair: add deviations for MISRA C:2012 Rule 16.3") Reported-by: Jan Beulich Signed-off-by: Federico Serafini Acked-b

[XEN PATCH v4 9/9] x86/mpparse: address a violation of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
Add a missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x8

[XEN PATCH v4 0/9] x86: address some violations of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
This patch series fixes a missing escape in a deviation and addresses some violations. Federico Serafini (9): automation/eclair: fix deviation of MISRA C Rule 16.3 x86/cpuid: use fallthrough pseudo keyword x86/domctl: address a violation of MISRA C Rule 16.3 x86/vpmu: address violations

[XEN PATCH v4 5/9] x86/traps: address violations of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
Add break or pseudo keyword fallthrough to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini --- xen/arch/x86/traps.c | 3 +++

[XEN PATCH v4 7/9] x86/hvm: address violations of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
eachable return statement is reached. Signed-off-by: Federico Serafini --- Changes in v4: - do not separate different parts of HVM: a) squash patches 8, 11 and 12 of v3 into this patch; b) address also violations of SVM and VMX; - re-arrange fallthrough positioning to comply with Coverity

[XEN PATCH v4 4/9] x86/vpmu: address violations of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini --- xen/arch/x86/cpu/vpmu.c | 3 +++ x

[XEN PATCH v4 2/9] x86/cpuid: use fallthrough pseudo keyword

2024-07-15 Thread Federico Serafini
The current comment making explicit the fallthrough intention does not follow the agreed syntax: replace it with the pseduo keyword. No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/cpuid.c | 3 +-- 1 file changed

[XEN PATCH v4 8/9] x86/mm: add defensive return

2024-07-15 Thread Federico Serafini
Add defensive return statement at the end of an unreachable default case. Other than improve safety, this meets the requirements to deviate a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini

[XEN PATCH v4 6/9] x86/mce: address violations of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch

Re: [XEN PATCH v3 07/12] x86/hvm: address violations of MISRA C Rule 16.3

2024-07-15 Thread Federico Serafini
On 13/07/24 01:25, Stefano Stabellini wrote: On Tue, 2 Jul 2024, Federico Serafini wrote: On 01/07/24 10:47, Jan Beulich wrote: On 26.06.2024 11:28, Federico Serafini wrote: @@ -2798,11 +2800,12 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr, hvio

Re: [Resend XEN PATCH v4 0/9] x86: address some violations of MISRA C Rule 16.3

2024-07-16 Thread Federico Serafini
On 16/07/24 08:59, Jan Beulich wrote: On 15.07.2024 18:48, Federico Serafini wrote: This patch series fixes a missing escape in a deviation and addresses some violations. Federico Serafini (9): automation/eclair: fix deviation of MISRA C Rule 16.3 x86/cpuid: use fallthrough pseudo

Re: [XEN PATCH v4 5/9] x86/traps: address violations of MISRA C Rule 16.3

2024-07-16 Thread Federico Serafini
On 16/07/24 09:08, Jan Beulich wrote: On 15.07.2024 18:48, Federico Serafini wrote: Add break or pseudo keyword fallthrough to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-o

Re: [XEN PATCH v4 1/9] automation/eclair: fix deviation of MISRA C Rule 16.3

2024-07-24 Thread Federico Serafini
On 24/07/24 11:45, Jan Beulich wrote: On 15.07.2024 18:48, Federico Serafini wrote: --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -499,7 +499,7 @@ safe." -doc_end -doc_begin="Switch clauses ending with an explic

[XEN PATCH v5 1/8] automation/eclair: fix deviation of MISRA C Rule 16.3

2024-07-29 Thread Federico Serafini
ed-by: Jan Beulich Signed-off-by: Federico Serafini Acked-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations

[XEN PATCH v5 2/8] x86/vpmu: address violations of MISRA C Rule 16.3

2024-07-29 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Reviewed-by: Jan Beulich --- xen/arch

[XEN PATCH v5 0/8] x86: address some violations of MISRA C Rule 16.3

2024-07-29 Thread Federico Serafini
This patch series fixes a missing escape in a deviation and addresses some violations. Federico Serafini (8): automation/eclair: fix deviation of MISRA C Rule 16.3 x86/vpmu: address violations of MISRA C Rule 16.3 x86/traps: address violations of MISRA C Rule 16.3 x86/mce: address

[XEN PATCH v5 4/8] x86/mce: address violations of MISRA C Rule 16.3

2024-07-29 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch

[XEN PATCH v5 5/8] x86/hvm: address violations of MISRA C Rule 16.3

2024-07-29 Thread Federico Serafini
MISRA C Rule 16.3 states that "An unconditional `break' statement shall terminate every switch-clause". Add pseudo keyword fallthrough or missing break statement to address violations of the rule. Signed-off-by: Federico Serafini --- Changes in v5: - separate mechanical change

[XEN PATCH v5 7/8] x86/mm: add defensive return

2024-07-29 Thread Federico Serafini
Add defensive return statement at the end of an unreachable default case. Other than improve safety, this meets the requirements to deviate a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini

[XEN PATCH v5 6/8] x86/hvm: add defensive statements in unreachable program points

2024-07-29 Thread Federico Serafini
As a defensive measure, make sure to signal an error to the caller if an unreachable program point is reached. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/emulate.c | 1 + xen/arch/x86/hvm/hvm.c | 4 xen/arch/x86/hvm/vmx/vmcs.c | 2 ++ 3 files changed, 7 insertions(+) diff

[XEN PATCH v5 8/8] x86/mpparse: address a violation of MISRA C Rule 16.3

2024-07-29 Thread Federico Serafini
Add a missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x8

[XEN PATCH v5 3/8] x86/traps: address violations of MISRA C Rule 16.3

2024-07-29 Thread Federico Serafini
Add break or pseudo keyword fallthrough to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/a

[XEN PATCH 0/2] automation/eclair: tag more rules as clean

2024-08-05 Thread Federico Serafini
Sort -v monitored guidelines and tag more guidelines as clean. Federico Serafini (2): automation/eclair: sort monitored guidelines with -V automation/eclair: tag more guidelines as clean .../eclair_analysis/ECLAIR/monitored.ecl | 92 +-- automation/eclair_analysis

[XEN PATCH 1/2] automation/eclair: sort monitored guidelines with -V

2024-08-05 Thread Federico Serafini
To improve readability, sort guidelines with -V. No functional change. --- .../eclair_analysis/ECLAIR/monitored.ecl | 92 +-- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl b/automation/eclair_analysis/ECLAIR/m

[XEN PATCH 2/2] automation/eclair: tag more guidelines as clean

2024-08-05 Thread Federico Serafini
Tag more of the accepted guidelines as clean to avoid regressions. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/tagging.ecl | 4 1 file changed, 4 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR

[XEN PATCH v5] automation/eclair: extend existing deviations of MISRA C Rule 16.3

2024-08-20 Thread Federico Serafini
Update ECLAIR configuration to deviate more cases where an unintentional fallthrough cannot happen. Tag Rule 16.3 as clean for arm. Signed-off-by: Federico Serafini --- Hi, v4 of this patch has been on hold due to discussion on whether or not to consider switch clauses ending with

[XEN PATCH] automation/eclair: monitor rules 13.2 and 18.2

2024-08-27 Thread Federico Serafini
Add MISRA C:2012 Rules 13.2 and 18.2 to the monitored set. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/monitored.ecl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl b/automation/eclair_analysis/ECLAIR

[XEN PATCH] xen/bitmap: remove comment-based deviations

2024-08-28 Thread Federico Serafini
'. Remove redundant comment-based deviations. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 docs/misra/deviations.rst| 5 + xen/include/xen/bitmap.h | 3 --- 3 files changed, 9 inse

Re: [XEN PATCH] xen/bitmap: remove comment-based deviations

2024-08-30 Thread Federico Serafini
On 28/08/24 16:50, Jan Beulich wrote: On 28.08.2024 15:12, Federico Serafini wrote: --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -565,6 +565,10 @@ of this macro do not lead to developer confusion, and can thus be deviated

Re: [XEN PATCH] xen/bitmap: remove comment-based deviations

2024-08-30 Thread Federico Serafini
On 29/08/24 02:42, Stefano Stabellini wrote: On Wed, 28 Aug 2024, Federico Serafini wrote: Update ECLAIR configuration of MISRA C:2012 Rule 20.7 ("Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses") to tag as 'safe' the exp

[XEN PATCH v2] automation/eclair: add deviation of MISRA C:2012 Rule 14.4

2024-05-02 Thread Federico Serafini
Update ECLAIR configuration to take into account the deviations agreed during MISRA meetings. Amend an existing entry of Rule 14.4 in deviations-rst: it is not a project-wide deviation. Tag Rule 14.4 as clean for arm. Signed-off-by: Federico Serafini --- Changes in v2: - reordered deviations

[XEN PATCH 0/2] misra: deviations of Rule 16.4

2024-05-03 Thread Federico Serafini
Define "switch-clause" in terms of the C specification. Deviate Rule 16.4. Federico Serafini (2): docs/misra: add Terms & Definitions section to rules.rst automation/eclair: add deviation for Rule 16.4 automation/eclair_analysis/ECLAIR/deviations.ecl | 8 docs/misra/

[XEN PATCH 2/2] automation/eclair: add deviation for Rule 16.4

2024-05-03 Thread Federico Serafini
MISRA C:2012 Rule 16.4 states that "Every switch statement shall have a default label". Update ECLAIR configuration to take into account the deviations agreed during MISRA meetings. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 8

[XEN PATCH 1/2] docs/misra: add Terms & Definitions section to rules.rst

2024-05-03 Thread Federico Serafini
ulich Signed-off-by: Federico Serafini --- Jan you were not completely satisfied by the definition but I didn't find a better one. --- docs/misra/rules.rst | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index b7b4

[XEN PATCH] automation/eclair: hide reports coming from adopted code in scheduled analysis

2024-05-03 Thread Federico Serafini
To improve clarity and ease of navigation do not show reports related to adopted code in the scheduled analysis. Configuration options are commented out because they may be useful in the future. Signed-off-by: Simone Ballarin Signed-off-by: Federico Serafini --- .../eclair_analysis/ECLAIR

Re: [REGRESSION] Re: [XEN PATCH 0/3] automation/eclair: do not allow failure for triggered analyses

2024-05-03 Thread Federico Serafini
On 03/05/24 21:14, Andrew Cooper wrote: On 29/04/2024 4:21 pm, Federico Serafini wrote: Patch 1/3 does some preparation work. Patch 2/3, as the title says, removes allow_failure = true for triggered analyses. Patch 3/3 makes explicit that initally no files are tagged as adopted, this is

Re: [REGRESSION] Re: [XEN PATCH 0/3] automation/eclair: do not allow failure for triggered analyses

2024-05-03 Thread Federico Serafini
On 03/05/24 21:46, Andrew Cooper wrote: On 03/05/2024 8:44 pm, Federico Serafini wrote: On 03/05/24 21:14, Andrew Cooper wrote: On 29/04/2024 4:21 pm, Federico Serafini wrote: Patch 1/3 does some preparation work. Patch 2/3, as the title says, removes allow_failure = true for triggered

[XEN PATCH] automation/eclair: extend and modifiy existing deviations of MISRA C:2012 Rule 16.3

2024-05-28 Thread Federico Serafini
Update ECLAIR configuration to deviate more cases where an unintentional fallthrough cannot happen. Add Rule 16.3 to the monitored set and tag as clean for arm. Signed-off-by: Federico Serafini --- In previous discussions about Rule 16.3, the preference expressed was to deviate cases where a

[XEN PATCH v2] automation/eclair: extend existing deviations of MISRA C:2012 Rule 16.3

2024-06-12 Thread Federico Serafini
Update ECLAIR configuration to deviate more cases where an unintentional fallthrough cannot happen. Add Rule 16.3 to the monitored set and tag it as clean for arm. Signed-off-by: Federico Serafini --- The v1 of this patch did not receive any comments: https://lists.xenproject.org/archives/html

Re: [XEN PATCH v2] automation/eclair: extend existing deviations of MISRA C:2012 Rule 16.3

2024-06-13 Thread Federico Serafini
On 13/06/24 10:16, Jan Beulich wrote: On 13.06.2024 08:38, Federico Serafini wrote: Update ECLAIR configuration to deviate more cases where an unintentional fallthrough cannot happen. Add Rule 16.3 to the monitored set and tag it as clean for arm. Signed-off-by: Federico Serafini

[XEN PATCH] automation/eclair: add deviation for MISRA C Rule 17.7

2024-06-13 Thread Federico Serafini
Update ECLAIR configuration to deviate some cases where not using the return value of a function is not dangerous. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 docs/misra/deviations.rst| 11 +++ 2 files changed

Re: [XEN PATCH] automation/eclair: add deviation for MISRA C Rule 17.7

2024-06-13 Thread Federico Serafini
On 13/06/24 12:08, Jan Beulich wrote: On 13.06.2024 11:07, Federico Serafini wrote: --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -364,6 +364,17 @@ Deviations related to MISRA C:2012 Rules: by `stdarg.h`. - Tagged as `deliberate` for ECLAIR. + * - R17.7

Re: [XEN PATCH v2] automation/eclair: extend existing deviations of MISRA C:2012 Rule 16.3

2024-06-13 Thread Federico Serafini
On 13/06/24 12:03, Jan Beulich wrote: On 13.06.2024 11:02, Federico Serafini wrote: On 13/06/24 10:16, Jan Beulich wrote: On 13.06.2024 08:38, Federico Serafini wrote: + * - R16.3 + - Switch clauses ending with a do-while-false which, in turn, ends with an Maybe more precisely &quo

Re: [XEN PATCH] automation/eclair: add deviation for MISRA C Rule 17.7

2024-06-13 Thread Federico Serafini
On 13/06/24 12:08, Jan Beulich wrote: On 13.06.2024 11:07, Federico Serafini wrote: --- a/docs/misra/deviations.rst +++ b/docs/misra/deviations.rst @@ -364,6 +364,17 @@ Deviations related to MISRA C:2012 Rules: by `stdarg.h`. - Tagged as `deliberate` for ECLAIR. + * - R17.7

[XEN PATCH v2] automation/eclair: add deviation for MISRA C Rule 17.7

2024-06-13 Thread Federico Serafini
Update ECLAIR configuration to deviate some cases where not using the return value of a function is not dangerous. Signed-off-by: Federico Serafini --- Changes in v2: - do not deviate strlcpy and strlcat. --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 docs/misra/deviations.rst

[XEN PATCH v3] automation/eclair: add deviation for MISRA C Rule 17.7

2024-06-14 Thread Federico Serafini
Update ECLAIR configuration to deviate some cases where not using the return value of a function is not dangerous. Signed-off-by: Federico Serafini --- Changes in v3: - removed unwanted underscores; - grammar fixed; - do not constraint to the first actual argument. Changes in v2: - do not

[XEN PATCH v3] automation/eclair: extend existing deviations of MISRA C Rule 16.3

2024-06-14 Thread Federico Serafini
Update ECLAIR configuration to deviate more cases where an unintentional fallthrough cannot happen. Add Rule 16.3 to the monitored set and tag it as clean for arm. Signed-off-by: Federico Serafini --- Changes from v2: - fixed grammar; - reprhased deviations regarding do-while-false and

[XEN PATCH] xen: add explicit comment to identify notifier patterns

2024-06-17 Thread Federico Serafini
eby only a few values are handled by the switch statement and nothing should be done for others (nothing to do in the default case). No functional change. Signed-off-by: Federico Serafini --- xen/arch/arm/cpuerrata.c| 1 + xen/arch/arm/gic.c | 1 + xen/arch/arm/i

Re: [XEN PATCH] xen: add explicit comment to identify notifier patterns

2024-06-17 Thread Federico Serafini
On 17/06/24 12:03, Jan Beulich wrote: On 17.06.2024 11:49, Federico Serafini wrote: MISRA C Rule 16.4 states that every `switch' statement shall have a `default' label" and a statement or a comment prior to the terminating break statement. This patch addresses some violati

[XEN PATCH v2] xen: add explicit comment to identify notifier patterns

2024-06-19 Thread Federico Serafini
overed in this patch, the default label has a return statement that does not violates Rule 16.4. No functional change. Signed-off-by: Federico Serafini --- Changes in v2: as Jan pointed out, in the v1 some patterns were not explicitly identified (https://lore.kernel.org/xen-devel/cad05a5c

Re: [XEN PATCH v2] xen: add explicit comment to identify notifier patterns

2024-06-20 Thread Federico Serafini
On 19/06/24 13:17, Julien Grall wrote: Hi Federico, On 19/06/2024 10:29, Federico Serafini wrote: MISRA C Rule 16.4 states that every `switch' statement shall have a `default' label" and a statement or a comment prior to the terminating break statement. This patch addresses som

[XEN PATCH] automation/eclair: add deviations of MISRA C Rule 5.5

2024-06-20 Thread Federico Serafini
handling functions. Signed-off-by: Federico Serafini --- .../eclair_analysis/ECLAIR/deviations.ecl | 16 ++ docs/misra/deviations.rst | 21 +++ 2 files changed, 37 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/

[XEN PATCH 06/13] x86/mce: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpu/mcheck/mce_amd.c | 1 + xen/arch/x86/cpu/mcheck/mce_in

[XEN PATCH 01/13] automation/eclair: consider also hypened fall-through

2024-06-20 Thread Federico Serafini
Update ECLAIR configuration: - allow to deviate MISRA C Rule 16.3 using different version of hypened fall-through; - search for the comment for 2 lines after the last statement. Signed-off-by: Federico Serafini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +- docs/misra

[XEN PATCH 13/13] x86/vlapic: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vlapic.c | 1 + 1 file changed, 1 insertion(+) diff -

[XEN PATCH 08/13] x86/vpt: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add pseudo keyword fallthrough to meet the requirements to deviate a violation of MISRA C Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vpt.c | 2 ++ 1 file change

[XEN PATCH 05/13] x86/traps: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add break or pseudo keyword fallthrough to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/traps.c | 3 +++ 1 file changed, 3 insertions(+

[XEN PATCH 12/13] x86/vPIC: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add pseudokeyword fallthrough to meet the requirements to deviate a violation of MISRA C Rul 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/hvm/vpic.c | 1 + 1 file chang

[XEN PATCH 03/13] x86/domctl: address a violation of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statement to address a violation of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/domctl.c | 1 + 1 file changed, 1 insertion(+) diff --git

[XEN PATCH 02/13] x86/cpuid: use fallthrough pseudo keyword

2024-06-20 Thread Federico Serafini
The current comment making explicit the fallthrough intention does not follow the agreed syntax: replace it with the pseduo keyword. No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpuid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch

[XEN PATCH 09/13] x86/mm: add defensive return

2024-06-20 Thread Federico Serafini
Add defensive return statement at the end of an unreachable default case. Other than improve safety, this meets the requirements to deviate a violation of MISRA C Rule 16.3. Signed-off-by: Federico Serafini --- xen/arch/x86/mm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86

[XEN PATCH 04/13] x86/vpmu: address violations of MISRA C Rule 16.3

2024-06-20 Thread Federico Serafini
Add missing break statements to address violations of MISRA C Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". No functional change. Signed-off-by: Federico Serafini --- xen/arch/x86/cpu/vpmu.c | 3 +++ xen/arch/x86/cpu/vpmu_intel.c

  1   2   3   4   5   6   >