[PATCH v4] misra: add deviation for MISRA C Rule R11.8.

2025-01-09 Thread Alessandro Zucchelli
ags passed in; such comment is used by the deviation in order to match the appropriate function call. No functional change. Signed-off-by: Alessandro Zucchelli --- Changes from V3: Edit docs/misra/deviations.rst, according to the feedback received. Rebase against the current staging tree. Chan

[PATCH v3] misra: add deviation for MISRA C Rule R11.8.

2025-01-07 Thread Alessandro Zucchelli
ags passed in; such comment is used by the deviation in order to match the appropriate function call. No functional change. Signed-off-by: Alessandro Zucchelli --- Changes from V2: The deviation has been documented under docs/misra/deviations.rst. Changes from V1: The deviation has been refine

[PATCH v2] misra: add deviation for MISRA C Rule R11.8.

2024-12-18 Thread Alessandro Zucchelli
ags passed in; such comment is used by the deviation in order to match the appropriate function call. No functional change. Signed-off-by: Alessandro Zucchelli --- As this patch introduces a deviation for service MC3A2.R11.8, it depends on the following patch and shall not be applied prior to its a

[PATCH] misra: add deviation for MISRA C Rule R11.8.

2024-12-16 Thread Alessandro Zucchelli
an be set for write or not. As it was decided a new const-only function will lead to more developer confusion than it is worth, this violation is addressed by deviating the function. No functional change. Signed-off-by: Alessandro Zucchelli --- As this patch introduces a deviation for service

Re: [PATCH] xen: address violation of MISRA C Rule 11.1

2024-12-13 Thread Alessandro Zucchelli
On 2024-12-13 11:08, Jan Beulich wrote: On 13.12.2024 01:53, Stefano Stabellini wrote: On Thu, 12 Dec 2024, Jan Beulich wrote: On 12.12.2024 03:27, Stefano Stabellini wrote: On Wed, 11 Dec 2024, Jan Beulich wrote: On 11.12.2024 12:02, Alessandro Zucchelli wrote: Rule 11.1 states as

[PATCH] misra: add deviation for MISRA C Rule R11.1.

2024-12-11 Thread Alessandro Zucchelli
ter, which is then used to get such information. This specific conversion has been reviewed and found to have no undefined behaviour associated to it, therefore it can be exempted from compliance. Signed-off-by: Alessandro Zucchelli --- As this patch introduces a deviation for service MC3A2.R11.1, it

[PATCH] xen: address violation of MISRA C Rule 11.1

2024-12-11 Thread Alessandro Zucchelli
are defined as noreturn functions and subsequently passed as parameters to function calls. This violates the rule in Clang, where the "noreturn" attribute is considered part of the function"s type. By removing the "noreturn" attribbute and replacing it with uses of the ASSERT_UN

[PATCH] xen: update ECLAIR service identifiers from MC3R1 to MC3A2.

2024-12-10 Thread Alessandro Zucchelli
Amendment 2 guidelines. Changes to the docs/misra directory are needed in order to keep comment-based deviation up to date. Signed-off-by: Alessandro Zucchelli --- The change was made using the following command: find . -type f -exec sed -i 's/MC3R1/MC3A2/g' {} + In order to avoid CI fai

Re: [PATCH] xen:add deviations for MISRA C 2012 Rule R5.2

2024-11-15 Thread Alessandro Zucchelli
On 2024-11-14 03:23, Stefano Stabellini wrote: On Wed, 13 Nov 2024, Jan Beulich wrote: On 13.11.2024 11:48, Alessandro Zucchelli wrote: > At this link you can see all the violations of Rule 5.2: > > https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/peopl

[PATCH] xen:add deviations for MISRA C 2012 Rule R5.2

2024-11-13 Thread Alessandro Zucchelli
DEFINE_COMPAT_HANDLE. No functional change. Signed-off-by: Alessandro Zucchelli --- automation/eclair_analysis/ECLAIR/deviations.ecl | 4 docs/misra/deviations.rst| 7 +++ 2 files changed, 11 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b

Re: [PATCH] xen:add deviations for MISRA C 2012 Rule R5.2

2024-11-13 Thread Alessandro Zucchelli
DEFINE_COMPAT_HANDLE all the violations are addressed. On 2024-11-13 11:31, Jan Beulich wrote: On 13.11.2024 09:41, Alessandro Zucchelli wrote: This addresses violations of MISRA C:2012 Rule 5.2 which states as following: Identifiers declared in the same scope and name space shall be distinct

[PATCH] xen: add deviations for MISRA C 2012 Rule R5.4

2024-11-13 Thread Alessandro Zucchelli
XLAT_hvm_altp2m_set_mem_access_multi_HNDL_access_list, and identifiers declared in header file include/asm/guest/hyperv-tlfs.h. No functional change. Signed-off-by: Alessandro Zucchelli --- automation/eclair_analysis/ECLAIR/deviations.ecl | 9 + docs/misra/deviations.rst| 8 2 files changed, 17 insertions

[PATCH] docs/misra: specify behaviour of checker for Directive 4.10

2024-11-13 Thread Alessandro Zucchelli
MISRA C:2012 Directive 4.10 states as following: Precautions shall be taken in order to prevent the contents of a header file being included more than once. This commit updates the documentation to describe the behavior defined for the checker. No functional change. Signed-off-by: Alessandro

[XEN PATCH] automation/eclair: add deviation for MISRA C 2012 Dir 4.10

2024-09-10 Thread Alessandro Zucchelli
conf.h No functional change. Signed-off-by: Alessandro Zucchelli --- automation/eclair_analysis/ECLAIR/deviations.ecl | 1 + 1 file changed, 1 insertion(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index 9051f41602..165322811c 10

[XEN PATCH v2] x86/APIC: address violation of MISRA C Rule 21.2

2024-09-10 Thread Alessandro Zucchelli
From: Nicola Vetrini The rule disallows the usage of an identifier reserved by the C standard. All identfiers starting with '__' are reserved for any use, so the label can be renamed in order to avoid the violation. No functional change. Signed-off-by: Nicola Vetrini Signed-off-by:

[XEN PATCH v2] x86/mm address violations of MISRA C:2012 Rule 5.3

2024-09-09 Thread Alessandro Zucchelli
. No functional change. Signed-off-by: Alessandro Zucchelli --- Changes in v2: - rebased against current staging tree xen/arch/x86/mm.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index c735aaf0e8..d537a799bc 100644 --- a

[XEN PATCH v6] CODING_STYLE: Add a section on header guards naming conventions

2024-09-05 Thread Alessandro Zucchelli
This section explains which format should be followed by header inclusion guards via a drop-down list of rules. No functional change. Signed-off-by: Alessandro Zucchelli --- Changes in v6: - edit inclusion guards naming conventions, including more details Changes in v5: - edit inclusion guards

Re: [XEN PATCH v5 12/17] xen: address violations of MISRA C:2012 Directive 4.10

2024-07-24 Thread Alessandro Zucchelli
On 2024-07-24 00:29, Stefano Stabellini wrote: On Tue, 23 Jul 2024, Alessandro Zucchelli wrote: From: Maria Celeste Cesario Modify creation rule for asm-offsets.h to conform to the new standard and to not generate conflicting guards between architectures (which is a violation of the directive

[XEN PATCH v5 14/17] xen/x86: rename inclusion guards for consistency

2024-07-23 Thread Alessandro Zucchelli
From: Maria Celeste Cesario Edit inclusion guards in order to make them consistent with the estabilished naming conventions. No functional change. Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin Reviewed-by: Stefano Stabellini Signed-off-by: Alessandro Zucchelli

[XEN PATCH v5 16/17] CODING_STYLE: Add a section on header guards naming conventions

2024-07-23 Thread Alessandro Zucchelli
This section explains which format should be followed by header inclusion guards via a drop-down list of rules. No functional change. Signed-off-by: Alessandro Zucchelli --- Changes in v5: - edit inclusion guards naming conventions, according to feedback received --- CODING_STYLE | 21

[XEN PATCH v5 12/17] xen: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
standard. Mechanical change. Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v5: - edit inclusion guards of autogenerated files Commit introduced in v3 --- xen/build.mk | 7

[XEN PATCH v5 15/17] xen/build: address violation of MISRA C Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
functional change. Signed-off-by: Alessandro Zucchelli --- Changes in v5: - edit inclusion guards for autogenerated header files --- xen/build.mk | 6 +- xen/include/Makefile | 5 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/build.mk b/xen/build.mk index

[XEN PATCH v5 09/17] xen: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
permitted anywhere) and the #if directive cannot be used for other checks. Mechanical change. Signed-off-by: Simone Ballarin Signed-off-by: Maria Celeste Cesario Acked-by: Julien Grall Reviewed-by: Stefano Stabellini Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli ---

[XEN PATCH v5 10/17] x86/asm: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
inclusion guards for xlat.h. Add deviation comment for files intended for multiple inclusion. Signed-off-by: Simone Ballarin Signed-off-by: Maria Celeste Cesario Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v5: - rebase against current staging tree - remove

[XEN PATCH v5 11/17] xen/arm: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
ned-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli Reviewed-by: Stefano Stabellini -- Change in v5: - edit inclusion guards, according to feedback received Changes in v4: - fix typo in include guard for arm efibind Commit introduced in v3 --- xe

[XEN PATCH v5 13/17] xen: add deviations for MISRA C 2012 Dir D4.10

2024-07-23 Thread Alessandro Zucchelli
From: Nicola Vetrini Add safe deviation for *.c files, as estabilished in past discussion. Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli Reviewed-by: Stefano Stabellini --- Changes in v4: - split the

[XEN PATCH v5 17/17] include/asm-generic: rename inclusion guards for consistency

2024-07-23 Thread Alessandro Zucchelli
Edit inclusion guards in asm-generic header files in order to make them consistent with the estabilished naming convention. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/include/asm-generic/altp2m.h | 6 +++--- xen/include/asm-generic/atomic-ops.h | 6 +++--- xen

[XEN PATCH v5 08/17] xen/efi: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
ia Celeste Cesario Reviewed-by: Stefano Stabellini Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v5: - edit inclusion guard Changes in v3: - remove trailing underscores - change inclusion guard name to adhere to the new standard Changes in v2: - drop changes

[XEN PATCH v5 02/17] misra: modify deviations for empty and generated headers

2024-07-23 Thread Alessandro Zucchelli
e Ballarin Reviewed-by: Stefano Stabellini Signed-off-by: Alessandro Zucchelli Signed-off-by: Nicola Vetrini --- Changes in v4: - rebased against current staging tree Changes in v2: - use the format introduced with doc/misra/safe.json instead of a file-based deviation for empty headers - remove

[XEN PATCH v5 06/17] x86/EFI: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
te Cesario Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli Reviewed-by: Stefano Stabellini --- Changes in v5: - Remove double blank lines - edit inclusion guards Changes in v4: - Modified inclusion guard. Changes in v3: - remove trailing underscores - change inclusion gua

[XEN PATCH v5 04/17] xen/arm: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
te Cesario Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli Reviewed-by: Stefano Stabellini --- Changes in v5: - edit inclusion guard, according to the feedback received Changes in v4: - Dropped ARCH_ string from the guard, according to the feedback received Changes in v3

[XEN PATCH v5 00/17] xen: address violation of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
t generate conflicting guards between architectures (which is a violation of the Directive). Alessandro Zucchelli (3): xen/build: address violation of MISRA C Directive 4.10 CODING_STYLE: Add a section on header guards naming conventions include/asm-generic: rename inclusion guards for cons

[XEN PATCH v5 05/17] xen/x86: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
mments are permitted anywhere). Mechanical change. Signed-off-by: Simone Ballarin Signed-off-by: Maria Celeste Cesario Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v5: - remove hard tab that slipped in the makefile - edit inclusion guards and makefile Cha

[XEN PATCH v5 07/17] xen/common: address violations of MISRA C:2012 Directive 4.10

2024-07-23 Thread Alessandro Zucchelli
ia Celeste Cesario Reviewed-by: Stefano Stabellini Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v5: - edit inclusion guards Changes in v3: - remove trailing underscores - change inclusion guard name to adhere to the new standard Changes in v2: - drop changes

[XEN PATCH v5 03/17] misra: add deviations for direct inclusion guards

2024-07-23 Thread Alessandro Zucchelli
es to have proper guards later in the header files will not be reported Signed-off-by: Simone Ballarin Signed-off-by: Alessandro Zucchelli Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- Changes in v5: - rebase against the current staging tree Changes in v4: - Added comment clari

[XEN PATCH v5 01/17] misra: add deviation for headers that explicitly avoid guards

2024-07-23 Thread Alessandro Zucchelli
: "Precautions shall be taken in order to prevent the contents of a header file being included more than once" This patch adds deviation cooments for headers that avoid guards. Signed-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in

Re: [PATCH 14/17] xen: add SAF deviation for MISRA C Dir 4.10

2024-07-22 Thread Alessandro Zucchelli
no Stabellini One question: when making the new version of the patch series should I revert this commit as Jan made the patch for it himself, or should Jan's fixes be integrated in the patch series? Many thanks in advance, Alessandro Zucchelli --- a/xen/include/public/arch-x86/xen.h +++

Re: [RFC PATCH 17/17] CODING_STYLE: Add a section on header guards naming conventions

2024-07-21 Thread Alessandro Zucchelli
gt;>> - arch/x86/lib/something.h -> X86__LIB__SOMETHING_H >>> >>> - asm-generic headers -> ASM_GENERIC__H >>> - include/asm-generic/percpu.h -> ASM_GENERIC_X86_PERCPU_H >>> >>> - arch//include/asm//.h -> ASMH >>> - arch/x86/include/asm/domain.h -> ASM_X86_DOMAIN_H >>> >>> - include/xen -> XEN__H >>> - include/xen/percpu.h -> XEN_PERCPU_H >>> >>> >>> Or do you prefer the double underscore __ in all cases? >> >> It's not so much prefer, but a requirement if we want to be future proof. >> Even for ASM_GENERIC_* that'll be needed, as your outline above simply >> doesn't mention the (future) case of there being subdir-s there (see how >> Linux already has some). Imo the question doesn't even arise for XEN_*, >> as xen/ has subdir-s already. > > OK. So it becomes: > > - private headers -> ___H > - arch/arm/arm64/lib/something.h -> ARM__ARM64__LIB__SOMETHING_H > - arch/arm/arm32/lib/something.h -> ARM__ARM32__LIB__SOMETHING_H > - arch/x86/lib/something.h -> X86__LIB__SOMETHING_H > > - asm-generic headers -> ASM_GENERIC___H > - include/asm-generic/percpu.h -> ASM_GENERIC__X86__PERCPU_H Nit: There's still a stray _X86_ in here. yes, good point. Alessandro, let us know if we are good to go ahead or if we are missing anything. I think we are good right now, I will provide the patch series v5 with all the fixes and inclusion guards renamings soon. > - arch//include/asm//.h -> ASM___H > - arch/x86/include/asm/domain.h -> ASM__X86__DOMAIN_H > > - include/xen -> XEN___H > - include/xen/percpu.h -> XEN__PERCPU_H > > If we have found agreement then Alessandro could send an update -- Alessandro Zucchelli, B.Sc. Software Engineer, BUGSENG (https://bugseng.com)

Re: [RFC PATCH 17/17] CODING_STYLE: Add a section on header guards naming conventions

2024-07-15 Thread Alessandro Zucchelli
the point where commits were checked pre-push. If we could come to an agreement, I will make the new version of the patch series with all the needed changes. -- Alessandro Zucchelli, B.Sc. Software Engineer, BUGSENG (https://bugseng.com)

Re: [PATCH 05/17] xen/x86: address violations of MISRA C:2012 Directive 4.10

2024-07-09 Thread Alessandro Zucchelli
On 2024-07-01 16:21, Jan Beulich wrote: On 01.07.2024 15:36, Alessandro Zucchelli wrote: --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -260,17 +260,18 @@ $(objtree)/arch/x86/include/asm/asm-macros.h: $(obj)/asm-macros.i $(src)/Makefil $(call filechk,asm-macros.h) define

Re: [PATCH 12/17] xen: address violations of MISRA C:2012 Directive 4.10

2024-07-04 Thread Alessandro Zucchelli
On 2024-07-03 14:51, Jan Beulich wrote: On 01.07.2024 15:43, Alessandro Zucchelli wrote: From: Maria Celeste Cesario Modify creation rule for asm-offsets.h to conform to the new standard and to not generate conflicting guards between architectures (which is a violation of the directive

Re: [PATCH 10/17] x86/asm: address violations of MISRA C:2012 Directive 4.10

2024-07-04 Thread Alessandro Zucchelli
On 2024-07-03 14:49, Jan Beulich wrote: On 01.07.2024 15:36, Alessandro Zucchelli wrote: --- a/docs/misra/safe.json +++ b/docs/misra/safe.json @@ -90,6 +90,14 @@ "name": "Dir 4.10: direct inclusion guard before", "text": "Headers w

Re: [PATCH 06/17] x86/EFI: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
On 2024-07-01 16:09, Marek Marczykowski-Górecki wrote: On Mon, Jul 01, 2024 at 03:36:01PM +0200, Alessandro Zucchelli wrote: From: Simone Ballarin Add inclusion guard to address violations of MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order to prevent the contents of a h

[RFC PATCH 17/17] CODING_STYLE: Add a section on header guards naming conventions

2024-07-01 Thread Alessandro Zucchelli
This section explains which format should be followed by header inclusion guards via a drop-down list of rules. No functional change. Signed-off-by: Alessandro Zucchelli --- CODING_STYLE | 19 +++ 1 file changed, 19 insertions(+) diff --git a/CODING_STYLE b/CODING_STYLE index

[PATCH 16/17] xen/build: address violation of MISRA C Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/build.mk | 6 +- xen/include/Makefile | 5 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/build.mk b/xen/build.mk index bbd4c2970f..c83882c949 100644 --- a/xen/build.mk +++ b/xen/build.mk

[PATCH 15/17] xen/x86: rename inclusion guards for consistency

2024-07-01 Thread Alessandro Zucchelli
From: Maria Celeste Cesario Edit inclusion guards in order to make them consistent with the estabilished naming conventions. No functional change. Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin Reviewed-by: Stefano Stabellini Signed-off-by: Alessandro Zucchelli

[PATCH 14/17] xen: add SAF deviation for MISRA C Dir 4.10

2024-07-01 Thread Alessandro Zucchelli
From: Nicola Vetrini Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- docs/misra/safe.json | 10 +- xen/include/public/arch-x86/xen.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/misra/safe.json b/docs/misra/safe.json

[PATCH 13/17] xen: add deviations for MISRA C 2012 Dir D4.10

2024-07-01 Thread Alessandro Zucchelli
From: Nicola Vetrini Add safe deviation for *.c files, as estabilished in past discussion. Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - split the commit from the unrelated SAF

[PATCH 12/17] xen: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
standard. Mechanical change. --- Changes in v4: - improve inclusion guard generation Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- xen/build.mk | 7 --- xen/scripts/Makefile.asm

[PATCH 11/17] xen/arm: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
ned-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli -- Changes in v4: - fix typo in include guard for arm efibind. Commit introduced in v3 --- xen/arch/arm/include/asm/domain.h | 6 +++--- xen/arch/arm/include/asm/efibind.h | 5 + xe

[PATCH 10/17] x86/asm: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
inclusion guards for xlat.h. Add deviation comment for files intended for multiple inclusion. Signed-off-by: Simone Ballarin Signed-off-by: Maria Celeste Cesario Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - changed guard creation for autogenerated

[PATCH 04/17] xen/arm: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
te Cesario Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - Drop ARCH_ string from the guard, according to the feedback received Changes in v3: - remove trailing underscores - change inclusion guard name to adhere to the new standard Changes in v2: - drop

[PATCH 08/17] xen/efi: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
ia Celeste Cesario Reviewed-by: Stefano Stabellini Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - drop XEN_ prefix from inclusion guard, according to the feedback received Changes in v3: - remove trailing underscores - change inclusion guard name to adhere

[PATCH 06/17] x86/EFI: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
te Cesario Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - Modified inclusion guard. Changes in v3: - remove trailing underscores - change inclusion guard name to adhere to the new standard Changes in v2: - remove changes in "xen/arch/x86/efi/ef

[PATCH 09/17] xen: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
permitted anywhere) and the #if directive cannot be used for other checks. Mechanical change. Signed-off-by: Simone Ballarin Signed-off-by: Maria Celeste Cesario Acked-by: Julien Grall Reviewed-by: Stefano Stabellini Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Cha

[PATCH 07/17] xen/common: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
ia Celeste Cesario Reviewed-by: Stefano Stabellini Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - drop XEN_ prefix from inclusion guard, according to the feedback received Changes in v3: - remove trailing underscores - change inclusion guard name to adhere

[PATCH 05/17] xen/x86: address violations of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
e Ballarin Signed-off-by: Maria Celeste Cesario Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - modified inclusion guards and makefile. Changes in v3: - remove trailing underscores - change inclusion guard name to adhere to the new standard Changes in v2: - re

[PATCH 03/17] misra: add deviations for direct inclusion guards

2024-07-01 Thread Alessandro Zucchelli
es to have proper guards later in the header files will not be reported Signed-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - Added comment clarifying that no further checks will be performed on a file that has a SAF-9-safe deviati

[PATCH 00/17] xen: address violation of MISRA C:2012 Directive 4.10

2024-07-01 Thread Alessandro Zucchelli
s.h to conform to the new standard and to not generate conflicting guards between architectures (which is a violation of the Directive). Alessandro Zucchelli (2): xen/build: address violation of MISRA C Directive 4.10 CODING_STYLE: Add a section on header guards naming conventions Maria Celes

[PATCH 02/17] misra: modify deviations for empty and generated headers

2024-07-01 Thread Alessandro Zucchelli
e Ballarin Reviewed-by: Stefano Stabellini Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - rebased against current staging tree Changes in v2: - use the format introduced with doc/misra/safe.json instead of a file-based deviation for empty headers - remove

[PATCH 01/17] misra: add deviation for headers that explicitly avoid guards

2024-07-01 Thread Alessandro Zucchelli
ll be taken in order to prevent the contents of a header file being included more than once" This patch adds deviation cooments for headers that avoid guards. Signed-off-by: Simone Ballarin Signed-off-by: Nicola Vetrini Signed-off-by: Alessandro Zucchelli --- Changes in v4: - rebased again

Re: [PATCH 1/3] common/kernel: address violation of MISRA C Rule 13.6

2024-06-26 Thread Alessandro Zucchelli
On 2024-06-26 03:13, Stefano Stabellini wrote: Hi, On Tue, 25 Jun 2024, Jan Beulich wrote: On 25.06.2024 12:14, Alessandro Zucchelli wrote: > --- a/xen/common/kernel.c > +++ b/xen/common/kernel.c > @@ -660,14 +660,15 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(

[PATCH 2/3] xen/event: address violation of MISRA C Rule 13.6

2024-06-25 Thread Alessandro Zucchelli
. To address this violation the value of current is therefore stored in a variable called 'v' before passing it to macro set_bit. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/include/xen/event.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

[PATCH 3/3] common/softirq: address violation of MISRA C Rule 13.6

2024-06-25 Thread Alessandro Zucchelli
To address this violation the value of smp_processor_id is therefore stored in a variable called 'cpu' before passing it to macro set_bit. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/common/softirq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 0/3] address violation of MISRA C Rule 13.6

2024-06-25 Thread Alessandro Zucchelli
This series aims to address several violations of Rule 13.6 which states the following: The operand of the `sizeof' operator shall not contain any expression which has potential side effects. Alessandro Zucchelli (3): common/kernel: address violation of MISRA C Rule 13.6 xen/event: ad

[PATCH 1/3] common/kernel: address violation of MISRA C Rule 13.6

2024-06-25 Thread Alessandro Zucchelli
iolation. To address this violation the value of current->domain is therefore stored in a variable called 'd' before passing it to macro ARRAY_SIZE. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/common/kernel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 del

[PATCH v3] automation/eclair_analysis: deviate and|or|xor|not for MISRA C Rule 21.2

2024-06-24 Thread Alessandro Zucchelli
s, so there is no risk of overlap. This addresses violations arising from x86_emulate/x86_emulate.c, where label statements named as or, and and xor appear. No functional change. Signed-off-by: Alessandro Zucchelli Acked-by: Stefano Stabellini --- Changes from v2: Fixed patch contents as the ch

[PATCH v2] common/unlzo: address violation of MISRA C Rule 7.3

2024-06-21 Thread Alessandro Zucchelli
24L'. No functional change. Signed-off-by: Alessandro Zucchelli --- Changes from v1: Instead of deviating /common/unlzo.c reports fro Rule 7.3 they are addressed by changing the non-compliant definition of LZO_BLOCK_SIZE. --- xen/common/unlzo.c | 2 +- 1 file changed, 1 insertion(+), 1 dele

[PATCH v2] automation/eclair_analysis: deviate and|or|xor|not for MISRA C Rule 21.2

2024-06-21 Thread Alessandro Zucchelli
s, so there is no risk of overlap. This addresses violations arising from x86_emulate/x86_emulate.c, where label statements named as or, and and xor appear. No functional change. Signed-off-by: Alessandro Zucchelli Acked-by: Stefano Stabellini --- Changes from v1: Added deviation for 'not&#

Re: [PATCH] automation/eclair_analysis: deviate common/unlzo.c for MISRA Rule 7.3

2024-06-20 Thread Alessandro Zucchelli
On 2024-06-20 03:17, Stefano Stabellini wrote: On Tue, 18 Jun 2024, Jan Beulich wrote: On 18.06.2024 11:54, Alessandro Zucchelli wrote: > The file contains violations of Rule 7.3 which states as following: The > lowercase character `l' shall not be used in a literal suffix. &g

[PATCH] automation/eclair_analysis: deviate and|or|xor for MISRA C Rule 21.2

2024-06-20 Thread Alessandro Zucchelli
esses violations arising from x86_emulate/x86_emulate.c, where label statements named as or, and and xor appear. No functional change. Signed-off-by: Alessandro Zucchelli --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++ 1 file changed, 6 insertions(+) diff --git a/autom

[PATCH 1/2] automation/eclair_analysis: deviate MISRA C Rule 21.2

2024-06-19 Thread Alessandro Zucchelli
ltins starting with "__builtin_" still remain available. No functional change. Signed-off-by: Alessandro Zucchelli --- automation/eclair_analysis/ECLAIR/deviations.ecl | 11 +++ 1 file changed, 11 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ec

[PATCH 2/2] x86/APIC: address violation of MISRA C Rule 21.2

2024-06-19 Thread Alessandro Zucchelli
From: Nicola Vetrini The rule disallows the usage of an identifier reserved by the C standard. All identfiers starting with '__' are reserved for any use, so the label can be renamed in order to avoid the violation. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/apic.c |

[PATCH 0/2] automation/eclair_analysis: deviate MISRA C Rule 21.2

2024-06-19 Thread Alessandro Zucchelli
l reserved identifiers with the exception of those starting with "__builtin_" which still remain available. Alessandro Zucchelli (1): automation/eclair_analysis: deviate MISRA C Rule 21.2 Nicola Vetrini (1): x86/APIC: address violation of MISRA C Rule 21.2 automation/eclair_analysis/ECLAIR

[PATCH] automation/eclair_analysis: deviate common/unlzo.c for MISRA Rule 7.3

2024-06-18 Thread Alessandro Zucchelli
ation involving both files. No functional change. Signed-off-by: Alessandro Zucchelli --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++ 1 file changed, 6 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl

[PATCH 1/2] x86/mm address violations of MISRA C:2012 Rule 5.3

2024-06-14 Thread Alessandro Zucchelli
This addresses violations of MISRA C:2012 Rule 5.3 which states as following: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/arch/x86/mm.c | 12 ++-- 1 file changed, 6

[PATCH 2/2] x86/e820 address violations of MISRA C:2012 Rule 5.3

2024-06-14 Thread Alessandro Zucchelli
This addresses violations of MISRA C:2012 Rule 5.3 which states as following: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/arch/x86/e820.c | 74

[PATCH 0/2] Address violations of MISRA C:2012 Rule 5.3

2024-06-14 Thread Alessandro Zucchelli
global variable; these patches are aimed to remove said occurrences leading to partial compliance under MISRA C:2012 Rule 5.3. No functional change. Alessandro Zucchelli (2): x86/mm address violations of MISRA C:2012 Rule 5.3 x86/e820 address violations of MISRA C:2012 Rule 5.3 xen/arch/x86/e820

[PATCH] public/sysctl: address violations of MISRA C: 2012 Rule 7.3

2024-06-13 Thread Alessandro Zucchelli
This addresses violations of MISRA C:2012 Rule 7.3 which states as following: The lowercase character `l' shall not be used in a literal suffix. Changed moreover suffixes 'u' in 'U' for better readability next to the 'L's. No functional change. Signed-off

Re: [XEN PATCH v3] arm/mem_access: add conditional build of mem_access.c

2024-05-12 Thread Alessandro Zucchelli
On 2024-05-10 22:59, Julien Grall wrote: Hi, On 10/05/2024 13:32, Alessandro Zucchelli wrote: In order to comply to MISRA C:2012 Rule 8.4 for ARM the following changes are done: revert preprocessor conditional changes to xen/mem_access.h which had it build unconditionally, add conditional

[XEN PATCH v3] arm/mem_access: add conditional build of mem_access.c

2024-05-10 Thread Alessandro Zucchelli
. Signed-off-by: Alessandro Zucchelli --- Changes from v2: Stylistic changes to code aimed to respect xen's coding guidelines. --- Changes from v1: Reverted preprocessor conditional changes to xen/mem_access.h; added conditional build for xen/mem_access.c; provided stubs for asm/mem_acc

Re: [XEN PATCH v2] arm/mem_access: add conditional build of mem_access.c

2024-05-09 Thread Alessandro Zucchelli
On 2024-05-09 12:52, Julien Grall wrote: Hi, On 09/05/2024 11:39, Alessandro Zucchelli wrote: In order to comply to MISRA C:2012 Rule 8.4 for ARM asm/mem_access.h in the case where MEM_ACCESS=n stubs are needed to allow the conditional compilation of the users of this header. I think you

[XEN PATCH v2] arm/mem_access: add conditional build of mem_access.c

2024-05-09 Thread Alessandro Zucchelli
In order to comply to MISRA C:2012 Rule 8.4 for ARM asm/mem_access.h in the case where MEM_ACCESS=n stubs are needed to allow the conditional compilation of the users of this header. Signed-off-by: Alessandro Zucchelli --- Changes from v1: Reverted preprocessor conditional changes to xen

Re: [XEN PATCH] xen/mem_access: address violations of MISRA C: 2012 Rule 8.4

2024-05-08 Thread Alessandro Zucchelli
On 2024-05-03 11:32, Julien Grall wrote: Hi, On 03/05/2024 08:09, Alessandro Zucchelli wrote: On 2024-04-29 17:58, Jan Beulich wrote: On 29.04.2024 17:45, Alessandro Zucchelli wrote: Change #ifdef CONFIG_MEM_ACCESS by OR-ing defined(CONFIG_ARM), allowing asm/mem_access.h to be included in

Re: [XEN PATCH] xen/mem_access: address violations of MISRA C: 2012 Rule 8.4

2024-05-03 Thread Alessandro Zucchelli
On 2024-04-29 17:58, Jan Beulich wrote: On 29.04.2024 17:45, Alessandro Zucchelli wrote: Change #ifdef CONFIG_MEM_ACCESS by OR-ing defined(CONFIG_ARM), allowing asm/mem_access.h to be included in all ARM build configurations. This is to address the violation of MISRA C: 2012 Rule 8.4 which

[XEN PATCH] xen/mem_access: address violations of MISRA C: 2012 Rule 8.4

2024-04-29 Thread Alessandro Zucchelli
ernal linkage is defined". Functions p2m_mem_access_check and p2m_mem_access_check_and_get_page when CONFIG_MEM_ACCESS is not defined in ARM builds don't have visible declarations in the file containing their definitions. Signed-off-by: Alessandro Zucchelli --- xen/include/xen/mem_access.h

Re: [XEN PATCH] automation/eclair_enalysis: amend configuration for some MISRA rules

2024-04-29 Thread Alessandro Zucchelli
On 2024-04-29 14:44, Alessandro Zucchelli wrote: Adjust ECLAIR configuration for rules: R21.14, R21.15, R21.16 by taking into account mem* macros defined in the Xen sources as if they were equivalent to the ones in Standard Library. Signed-off-by: Alessandro Zucchelli --- automation

[XEN PATCH] automation/eclair_enalysis: amend configuration for some MISRA rules

2024-04-29 Thread Alessandro Zucchelli
Adjust ECLAIR configuration for rules: R21.14, R21.15, R21.16 by taking into account mem* macros defined in the Xen sources as if they were equivalent to the ones in Standard Library. Signed-off-by: Alessandro Zucchelli --- automation/eclair_analysis/ECLAIR/analysis.ecl | 17

Re: [XEN PATCH 2/2] x86/msr: add suffix 'U' to MSR_AMD_CSTATE_CFG macro.

2024-04-24 Thread Alessandro Zucchelli
On 2024-04-24 14:53, Teddy Astie wrote: Le 24/04/2024 à 14:11, Alessandro Zucchelli a écrit : This addresses violations of MISRA C:2012 Rule 7.2 which states as following: A “u” or “U” suffix shall be applied to all integer constants that are represented in an unsigned type. No functional

Re: [XEN PATCH 1/2] pci: add suffix 'U' to PCI_CONF_ADDRESS macro.

2024-04-24 Thread Alessandro Zucchelli
On 2024-04-24 14:47, Jan Beulich wrote: On 24.04.2024 14:11, Alessandro Zucchelli wrote: This addresses violations of MISRA C:2012 Rule 7.2 which states as following: A “u” or “U” suffix shall be applied to all integer constants that are represented in an unsigned type. No functional change

[XEN PATCH 1/2] pci: add suffix 'U' to PCI_CONF_ADDRESS macro.

2024-04-24 Thread Alessandro Zucchelli
This addresses violations of MISRA C:2012 Rule 7.2 which states as following: A “u” or “U” suffix shall be applied to all integer constants that are represented in an unsigned type. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/arch/x86/x86_64/pci.c | 2 +- 1 file changed

[XEN PATCH 0/2] x86: address remaining violation of Rule 7.2

2024-04-24 Thread Alessandro Zucchelli
This patch series addresses the last violations of MISRA C:2012 Rule 7.2. This rule will soon be tagged as clean for ECLAIR in a future patch. Alessandro Zucchelli (2): pci: add suffix 'U' to PCI_CONF_ADDRESS macro. x86/msr: add suffix 'U' to MSR_AMD_CSTATE_CFG macro.

[XEN PATCH 2/2] x86/msr: add suffix 'U' to MSR_AMD_CSTATE_CFG macro.

2024-04-24 Thread Alessandro Zucchelli
This addresses violations of MISRA C:2012 Rule 7.2 which states as following: A “u” or “U” suffix shall be applied to all integer constants that are represented in an unsigned type. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/arch/x86/include/asm/msr-index.h | 2 +- 1