Re: [PATCH 6/6] automation/eclair: update configuration of D4.10

2025-05-23 Thread Federico Serafini
On 19/05/25 23:36, Stefano Stabellini wrote: On Mon, 19 May 2025, Federico Serafini wrote: Hi, On 17/05/25 01:57, Andrew Cooper wrote: +-config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-2))"} -config=MC3A2.D4.10,repo

Re: [PATCH 6/6] automation/eclair: update configuration of D4.10

2025-05-19 Thread Federico Serafini
lector":{"enabled":true,"negated":false,"kind":2,"children":[]}}} If you prefer, I think we can use ranges and merge the two configurations. -- Federico Serafini, MSc Software Engineer, BUGSENG (https://bugseng.com) LinkedIn: https://linkedin.com/in/federico-serafini

[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 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 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 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

[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

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 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

[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 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] 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 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 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 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 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 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 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 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 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 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

Re: [XEN PATCH 09/12] x86/emul: address violations of MISRA C Rule 16.3

2024-09-12 Thread Federico Serafini
On 12/09/24 12:01, Jan Beulich wrote: On 12.09.2024 11:17, Federico Serafini wrote: On 11/09/24 14:42, Jan Beulich wrote: On 10.09.2024 12:09, Federico Serafini wrote: --- a/xen/arch/x86/x86_emulate/fpu.c +++ b/xen/arch/x86/x86_emulate/fpu.c @@ -218,6 +218,7 @@ int x86emul_fpu(struct

Re: [XEN PATCH 09/12] x86/emul: address violations of MISRA C Rule 16.3

2024-09-12 Thread Federico Serafini
On 11/09/24 14:42, Jan Beulich wrote: On 10.09.2024 12:09, Federico Serafini wrote: --- a/xen/arch/x86/x86_emulate/fpu.c +++ b/xen/arch/x86/x86_emulate/fpu.c @@ -218,6 +218,7 @@ int x86emul_fpu(struct x86_emulate_state *s, */ if ( dst->type == OP_MEM && !

Re: [XEN PATCH 1/3] EFI: address violations of MISRA C Rule 13.6

2024-09-12 Thread Federico Serafini
On 11/09/24 16:57, Jan Beulich wrote: On 11.09.2024 16:27, Nicola Vetrini wrote: On 2024-09-11 16:10, Jan Beulich wrote: On 11.09.2024 15:16, Marek Marczykowski-Górecki wrote: On Wed, Sep 11, 2024 at 02:50:03PM +0200, Jan Beulich wrote: On 10.09.2024 21:06, Federico Serafini wrote: Refactor

[XEN PATCH 1/3] EFI: address violations of MISRA C Rule 13.6

2024-09-10 Thread Federico Serafini
Refactor the code to improve readability and address violations of MISRA C:2012 Rule 13.6 ("The operand of the `sizeof' operator shall not contain any expression which has potential side effect"). No functional change. Suggested-by: Andrew Cooper Signed-off-by: Federico Ser

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

2024-09-10 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] xen/gnttab: address violations of MISRA C Rule 13.6

2024-09-10 Thread Federico Serafini
Refactor the code to improve readability and address violations of MISRA C:2012 Rule 13.6 ("The operand of the `sizeof' operator shall not contain any expression which has potential side effect"). No functional change. Suggested-by: Andrew Cooper Signed-off-by: Federico Ser

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

2024-09-10 Thread Federico Serafini
Update ECLAIR configuration to consider Rule 13.6 as clean: introducing 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

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

2024-09-10 Thread Federico Serafini
On 10/09/24 16:55, Jan Beulich wrote: On 10.09.2024 12:08, Federico Serafini wrote: 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 ---

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

2024-09-10 Thread Federico Serafini
On 10/09/24 19:41, Federico Serafini wrote: On 10/09/24 16:59, Jan Beulich wrote: On 10.09.2024 16:57, Jan Beulich wrote: On 10.09.2024 12:09, Federico Serafini wrote: Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every swi

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

2024-09-10 Thread Federico Serafini
On 10/09/24 16:59, Jan Beulich wrote: On 10.09.2024 16:57, Jan Beulich wrote: On 10.09.2024 12:09, Federico Serafini wrote: Address violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Since in our interpretation "

[XEN PATCH v2 1/2] automation/eclair: update configuration of Rule 20.7

2024-09-10 Thread Federico Serafini
A * B M(1+1, 2+2) will expand to: 1+1 * 2+2 Update ECLAIR configuration to tag as 'safe' the expansions of macro arguments surrounded tokens '{', '}' and ';', since in their presence problems related to operator precedence can not occur. Signed-off-by: Fede

[XEN PATCH v2 0/2] automation/eclair: update configuration of Rule 20.7

2024-09-10 Thread Federico Serafini
Update ECLAIR configuration to deviate some safe violations of Rule 20.7. Remove redundant comment-based deviations. Federico Serafini (2): automation/eclair: update configuration of Rule 20.7 xen/bitmap: remove redundant deviations automation/eclair_analysis/ECLAIR/deviations.ecl | 4

[XEN PATCH v2 2/2] xen/bitmap: remove redundant deviations

2024-09-10 Thread Federico Serafini
Remove comment-based deviations since a project wide deviation that cover such cases is present. Signed-off-by: Federico Serafini --- Changes from v1: - split modifications in two patches. --- xen/include/xen/bitmap.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/xen/include/xen

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

2024-09-10 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 --- xen/drivers/passthrough/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --gi

[XEN PATCH 10/12] efi: address violation of MISRA C Rule 16.3

2024-09-10 Thread Federico Serafini
Use agreed syntax for pseudo-keyword fallthrough to meet the requirements to deviate 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 --- xen/common/efi/runt

[XEN PATCH 01/12] x86/psr: address violation of MISRA C Rule 16.3

2024-09-10 Thread Federico Serafini
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 --- xen/arch/x86/psr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/psr.c b/xen

[XEN PATCH 05/12] x86/monitor: address violation of MISRA C Rule 16.3

2024-09-10 Thread Federico Serafini
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 --- xen/arch/x86/include/asm/monitor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/

[XEN PATCH 07/12] x86/mmcfg: address violation of MISRA C Rule 16.3

2024-09-10 Thread Federico Serafini
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 --- xen/arch/x86/x86_64/mmconfig-shared.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/

[XEN PATCH 08/12] x86/emul: add defensive code

2024-09-10 Thread Federico Serafini
Add defensive code after unreachable program points. This also meets the requirements to deviate a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini --- xen/arch/x86/x86_emulate/x8

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

2024-09-10 Thread Federico Serafini
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 --- xen/arch/x86/vm_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/vm_event.c

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

2024-09-10 Thread Federico Serafini
ot; to make the fallthrough intention explicit (i.e., a comment or the fallthrough keyword that is not defined in x86-emulate.h at the moment). Federico Serafini (12): x86/psr: address violation of MISRA C Rule 16.3 x86/time: address violations of MISRA C Rule 16.3 x86/vm_event: address violation

[XEN PATCH 02/12] x86/time: address violations of MISRA C Rule 16.3

2024-09-10 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 --- xen/arch/x86/time.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/time.c b/xen/

[XEN PATCH 11/12] xen/vpci: add defensive code

2024-09-10 Thread Federico Serafini
Add defensive code in unreachable program points. This also meets the requirements to deviate a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini --- xen/drivers/vpci/msix.c | 4 1

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

2024-09-10 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 --- xen/arch/x86/x86_emulate/fpu.c | 4 xen/arch/x86/x86_emulate/x86_emulate.c | 1 + 2 f

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

2024-09-10 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 --- xen/arch/x86/mm/guest_walk.c | 1 + xen/arch/x86/mm/hap/hap.c| 2 +- xen/arch/x86/mm/h

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

2024-09-10 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 --- xen/arch/x86/include/asm/hypercall.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) d

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

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

[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

[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 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 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 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 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 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 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 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 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 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 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 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 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

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

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: [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 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

[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

[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 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 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 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 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 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 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 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

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->

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

[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

[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 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 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 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 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 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 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 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 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 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 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

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)

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

2024-06-25 Thread Federico Serafini
On 26/06/24 03:59, Stefano Stabellini wrote: On Tue, 25 Jun 2024, Federico Serafini wrote: Update ECLAIR configuration to take into account the deviations agreed during the MISRA meetings. While doing this, remove the obsolete "Set [123]" comments. Signed-off-by: Federico Serafin

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

2024-06-25 Thread Federico Serafini
Update ECLAIR configuration to take into account the deviations agreed during the MISRA meetings. While doing this, remove the obsolete "Set [123]" comments. Signed-off-by: Federico Serafini --- Changes in v2: - keep sync between deviations.ecl and deviations.rst; - use 'delibera

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

2024-06-25 Thread Federico Serafini
Update ECLAIR configuration to take into account the deviations agreed during the MISRA meetings. While doing this, remove the obsolete "Set [123]" comments. Signed-off-by: Federico Serafini --- .../eclair_analysis/ECLAIR/deviations.ecl | 93 +-- docs/misra/devi

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

2024-06-25 Thread Federico Serafini
On 24/06/24 17:16, Jan Beulich wrote: On 24.06.2024 11:04, Federico Serafini wrote: --- a/xen/arch/x86/cpu/vpmu_intel.c +++ b/xen/arch/x86/cpu/vpmu_intel.c @@ -713,6 +713,7 @@ static int cf_check core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content) break

  1   2   3   4   5   6   >