[XEN PATCH] automation/eclair_analysis: set MISRA C Rule 10.2 as clean

2024-05-17 Thread Nicola Vetrini
This rule has no more violations in the codebase, so it can be set as clean. No functional change. Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/tagging.ecl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl

Re: [XEN PATCH 2/4] x86/hvm: address violations of MISRA C Rule 20.7

2024-05-16 Thread Nicola Vetrini
On 2024-05-16 01:18, Stefano Stabellini wrote: On Wed, 15 May 2024, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses

[XEN PATCH] automation/eclair_analysis: fully deviate MISRA C Rules 21.9 and 21.10

2024-05-15 Thread Nicola Vetrini
for allowing uses of these functions in the project. The rules are also marked as clean as a consequence. Signed-off-by: Nicola Vetrini --- .../eclair_analysis/ECLAIR/deviations.ecl | 14 ++ .../eclair_analysis/ECLAIR/monitored.ecl | 2 ++ automation/eclair_analysis/ECLAIR

[XEN PATCH 1/4] x86/vpmu: address violations of MISRA C Rule 20.7

2024-05-15 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/cpu/vpmu_amd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c index db2fa420e14a..97

[XEN PATCH 2/4] x86/hvm: address violations of MISRA C Rule 20.7

2024-05-15 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/hvm/mtrr.c | 2 +- xen/arch/x86/hvm/rtc.c | 2 +- xen/arch/x86/include/asm/hvm/save.h | 2 +- 3 files changed, 3 insertions(+), 3 deletion

[XEN PATCH 3/4] x86_64/uaccess: address violations of MISRA C Rule 20.7

2024-05-15 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. xlat_malloc_init is touched for consistency, despite the construct being already deviated. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/x86_64/uaccess.h | 7 --- 1 file changed, 4 insert

[XEN PATCH 0/4] address violations of MISRA C Rule 20.7

2024-05-15 Thread Nicola Vetrini
gy adopted to bring them into compliance is to add parentheses around macro arguments where needed. Nicola Vetrini (4): x86/vpmu: address violations of MISRA C Rule 20.7 x86/hvm: address violations of MISRA C Rule 20.7 x86_64/uaccess: address violations of MISRA C Rule 20.7 x86_64/cpu_idl

[XEN PATCH 4/4] x86_64/cpu_idle: address violations of MISRA C Rule 20.7

2024-05-15 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/x86_64/cpu_idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/x86_64/cpu_idle.c b/xen/arch/x86/x86_64/cpu_idle.c index fc

Re: [XEN PATCH 03/10] automation/eclair_analysis: deviate macro count_args_ for MISRA Rule 20.7

2024-05-15 Thread Nicola Vetrini
On 2024-05-01 21:54, Stefano Stabellini wrote: On Mon, 29 Apr 2024, Nicola Vetrini wrote: On 2024-04-25 02:28, Stefano Stabellini wrote: > On Tue, 23 Apr 2024, Nicola Vetrini wrote: > > The count_args_ macro violates Rule 20.7, but it can't be made > > compliant with Rule 20.7 w

[XEN PATCH] automation/eclair_analysis: tag MISRA C Rule 1.1 as clean

2024-05-10 Thread Nicola Vetrini
Tag the rule as clean, as there are no more violations in the codebase since 93c27d54dd23 ("xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end"). Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/tagging.ecl | 2 +- 1 file changed, 1 inser

[XEN PATCH] automation/eclair_analysis: tag MISRA C Rule 8.2 as clean.

2024-05-09 Thread Nicola Vetrini
Tag the rule as clean, as there are no more violations in the codebase since e8e8afee990a ("svm: Fix MISRA 8.2 violation"). Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/tagging.ecl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[XEN PATCH v3] x86/IOMMU: address violations of MISRA C:2012 Rule 14.4

2024-05-08 Thread Nicola Vetrini
using enum constants as controlling expressions to comply with Rule 14.4. Amend the comment in the enum definition to reflect the fact that boolean uses of iommu_intremap are no longer allowed. No functional change. Signed-off-by: Maria Celeste Cesario Signed-off-by: Simone Ballarin Signed-off-

[XEN PATCH] automation/eclair_analysis: unblock pipelines from certain repositories

2024-05-06 Thread Nicola Vetrini
Repositories under people/* only execute the analyze step if manually triggered, but in order to avoid blocking the rest of the pipeline if such step is not run, allow it to fail. Reported-by: Andrew Cooper Signed-off-by: Nicola Vetrini --- See https://gitlab.com/xen-project/people/bugseng/xen

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

2024-05-06 Thread Nicola Vetrini
-- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [XEN PATCH v2 1/3] drivers: char: address violation of MISRA C Rule 20.7

2024-05-03 Thread Nicola Vetrini
On 2024-05-03 12:10, Jan Beulich wrote: On 03.05.2024 09:29, Nicola Vetrini wrote: On 2024-05-01 21:57, Stefano Stabellini wrote: On Tue, 30 Apr 2024, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parent

Re: [XEN PATCH v2 1/3] drivers: char: address violation of MISRA C Rule 20.7

2024-05-03 Thread Nicola Vetrini
On 2024-05-01 21:57, Stefano Stabellini wrote: On Tue, 30 Apr 2024, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses

Re: [XEN PATCH v2 2/3] xen/unaligned: address violation of MISRA C Rule 20.7

2024-04-30 Thread Nicola Vetrini
On 2024-04-30 17:13, Jan Beulich wrote: On 30.04.2024 16:28, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure

[XEN PATCH v2 3/3] xen/pci: address violations of MISRA C Rule 20.7

2024-04-30 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/include/xen/pci_regs.h | 6 +++--- xen/include/xen/vpci.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/include/xen/pci_regs.h b/xen/i

[XEN PATCH v2 1/3] drivers: char: address violation of MISRA C Rule 20.7

2024-04-30 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional chage. Signed-off-by: Nicola Vetrini --- Changes in v2: - drop excess parentheses from val parameter. --- xen/drivers/char/omap-uart.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/drivers

[XEN PATCH v2 2/3] xen/unaligned: address violation of MISRA C Rule 20.7

2024-04-30 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- Somewhat surprisingly, the change in the tools directory is also needed, otherwise some CI build jobs fail (see e.g. [1]). This is not undefined behaviour as long as the two d

[XEN PATCH v2 0/3] address violations of MISRA C Rule 20.7

2024-04-30 Thread Nicola Vetrini
gy adopted to bring them into compliance is to add parentheses around macro arguments where needed. Patch 1/3 is derived from that of v1; patches 2 and 3 are new to this series. Nicola Vetrini (3): drivers: char: address violation of MISRA C Rule 20.7 xen/unaligned: address violation of MISRA C

Re: [PATCH 2/2] xen/arm: Fix MISRA regression on R1.1, flexible array member not at the end

2024-04-30 Thread Nicola Vetrini
e regression on R1.1 is resolved (see [1]). [1] https://gitlab.com/xen-project/patchew/xen/-/jobs/6748211368 -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [PATCH v2 2/3] x86: detect PIC aliasing on ports other than 0x[2A][01]

2024-04-29 Thread Nicola Vetrini
_t opt_smt; extern int8_t opt_probe_port_aliases; -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [XEN PATCH 03/10] automation/eclair_analysis: deviate macro count_args_ for MISRA Rule 20.7

2024-04-29 Thread Nicola Vetrini
On 2024-04-25 02:28, Stefano Stabellini wrote: On Tue, 23 Apr 2024, Nicola Vetrini wrote: The count_args_ macro violates Rule 20.7, but it can't be made compliant with Rule 20.7 without breaking its functionality. Since it's very unlikely for this macro to be misused, it is deviated

Re: [XEN PATCH] automation/eclair: reorganize pipelines

2024-04-25 Thread Nicola Vetrini
pe form with named parameters: violation: 2 (George just sent a patch to address the regressions of Rule 8.2.) -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [XEN PATCH 04/10] drivers: char: address violation of MISRA C Rule 20.7

2024-04-24 Thread Nicola Vetrini
On 2024-04-24 09:23, Jan Beulich wrote: On 23.04.2024 17:12, Nicola Vetrini wrote: --- a/xen/drivers/char/omap-uart.c +++ b/xen/drivers/char/omap-uart.c @@ -48,8 +48,9 @@ /* System configuration register */ #define UART_OMAP_SYSC_DEF_CONF 0x0d /* autoidle mode, wakeup is enabled

[XEN PATCH 08/10] x86/hvm: hpet: address violations of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/hvm/hpet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c index 1db9c0b60ee0..5f456221c

[XEN PATCH 09/10] x86/debugreg: address violation of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/debugreg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/debugreg.h b/xen/arch/x86/include/asm/debugr

[XEN PATCH 06/10] x86/pci: address violation of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/pci.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h index 6b

[XEN PATCH 04/10] drivers: char: address violation of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional chage. Signed-off-by: Nicola Vetrini --- xen/drivers/char/omap-uart.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c index 03

[XEN PATCH 10/10] x86/mm: address violations of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 9141912ae52d..87529db7d136 100644 --- a/xen/arc

[XEN PATCH 07/10] x86/acpi: power: address violations of MISRA Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/acpi/power.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c index c6

[XEN PATCH 02/10] xen/page-defs: address violation of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/include/xen/page-defs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/xen/page-defs.h b/xen/include/xen/page-defs.h index 540f8b0b6452..68

[XEN PATCH 05/10] xen/spinlock: address violations of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/common/spinlock.c | 2 +- xen/include/xen/spinlock.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/spinlock.c b/xen/common/spinlo

[XEN PATCH 00/10] Address violations of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
gy adopted to bring them into compliance is to add parentheses around macro arguments where needed. Nicola Vetrini (10): libelf: address violations of MISRA C Rule 20.7 xen/page-defs: address violation of MISRA C Rule 20.7 automation/eclair_analysis: deviate macro count_args_ for MISRA Rul

[XEN PATCH 03/10] automation/eclair_analysis: deviate macro count_args_ for MISRA Rule 20.7

2024-04-23 Thread Nicola Vetrini
The count_args_ macro violates Rule 20.7, but it can't be made compliant with Rule 20.7 without breaking its functionality. Since it's very unlikely for this macro to be misused, it is deviated. No functional change. Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR

[XEN PATCH 01/10] libelf: address violations of MISRA C Rule 20.7

2024-04-23 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/common/libelf/libelf-private.h | 2 +- xen/include/xen/libelf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/libelf/libelf-privat

[XEN PATCH v3] automation/eclair_analysis: substitute deprecated service STD.emptrecd

2024-04-20 Thread Nicola Vetrini
not affect the analysis. This new service is already supported by the current version of ECLAIR. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Julien Grall --- Changes in v3: - Provide a better description --- automation/eclair_analysis/ECLAIR/toolchain.ecl | 4 ++-- 1 file changed, 2

Re: [XEN PATCH v2] automation/eclair_analysis: substitute deprecated service STD.emptrecd

2024-04-19 Thread Nicola Vetrini
On 2024-04-19 11:21, Jan Beulich wrote: On 19.04.2024 09:49, Nicola Vetrini wrote: On 2024-04-19 09:35, Jan Beulich wrote: On 19.04.2024 09:16, Nicola Vetrini wrote: The ECLAIR service STD.emptrecd is being deprecated; hence, as a preventive measure, STD.anonstct is used here, which for Xen's

Re: [XEN PATCH v2] automation/eclair_analysis: substitute deprecated service STD.emptrecd

2024-04-19 Thread Nicola Vetrini
On 2024-04-19 09:35, Jan Beulich wrote: On 19.04.2024 09:16, Nicola Vetrini wrote: The ECLAIR service STD.emptrecd is being deprecated; hence, as a preventive measure, STD.anonstct is used here, which for Xen's purposes has equivalent functionality. I'm sorry, but no, this still does

[XEN PATCH v2] automation/eclair_analysis: substitute deprecated service STD.emptrecd

2024-04-19 Thread Nicola Vetrini
The ECLAIR service STD.emptrecd is being deprecated; hence, as a preventive measure, STD.anonstct is used here, which for Xen's purposes has equivalent functionality. This new service is already supported by the current version of ECLAIR. No functional change. Signed-off-by: Nicola Vetrini

[XEN PATCH v4] xen/domain: deviate MISRA C Rule 16.2 violation

2024-04-19 Thread Nicola Vetrini
. To avoid this, the construct is deviated with a text-based deviation. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- docs/misra/safe.json | 8 xen/common/domain.c | 1 + 2 files changed, 9 insertions(+) diff --git a/docs/misra/safe.json b/docs/misra/safe.

Re: [XEN PATCH] automation/eclair_analysis: substitute deprecated service

2024-04-18 Thread Nicola Vetrini
On 2024-04-18 17:15, Jan Beulich wrote: On 18.04.2024 17:00, Nicola Vetrini wrote: On 2024-04-18 09:22, Jan Beulich wrote: On 17.04.2024 16:51, Nicola Vetrini wrote: --- a/automation/eclair_analysis/ECLAIR/toolchain.ecl +++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl @@ -44,8 +44,8

Re: [XEN PATCH v3 1/2] xen/domctl: address violations of MISRA C Rule 16.2

2024-04-18 Thread Nicola Vetrini
On 2024-04-18 17:10, Jan Beulich wrote: On 17.04.2024 21:37, Nicola Vetrini wrote: Refactor the first clauses so that a violation of MISRA C Rule 16.2 is resolved (a switch label should be immediately enclosed in the compound statement of the switch). Note that the switch clause ending

Re: [XEN PATCH] automation/eclair_analysis: substitute deprecated service

2024-04-18 Thread Nicola Vetrini
On 2024-04-18 09:22, Jan Beulich wrote: On 17.04.2024 16:51, Nicola Vetrini wrote: --- a/automation/eclair_analysis/ECLAIR/toolchain.ecl +++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl @@ -44,8 +44,8 @@ -doc_end -doc_begin="See Section \"6.19 Structures with

Re: docs/misra: add R21.6 R21.14 R21.15 R21.16

2024-04-18 Thread Nicola Vetrini
onsistency between the file and ECLAIR. I think they should be kept in sync because it explain how the tool doing the scanning behave. My preference is to either split and only commit the rules now or wait for the ECLAIR change to happen. Understood. Maybe the Bugseng team can provide the corresponding ECLAIR/deviations.ecl changes Sure, we can respin the patch with the appropriate deviation in place. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

[XEN PATCH v3 2/2] eclair_analysis: deviate x86 emulator for Rule 16.2

2024-04-17 Thread Nicola Vetrini
hose files for this guideline. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 7 +++ docs/misra/deviations.rst| 6 ++ 2 files changed, 13 insertions(+) diff --git a/automation/eclair_analy

[XEN PATCH v3 0/2] address violations of MISRA C Rule 16.2

2024-04-17 Thread Nicola Vetrini
A respin of the last two patches from the previous series. No changes other than the different SAF comment id because SAF-4-safe was already taken. Nicola Vetrini (2): xen/domctl: address violations of MISRA C Rule 16.2 eclair_analysis: deviate x86 emulator for Rule 16.2 automation

[XEN PATCH v3 1/2] xen/domctl: address violations of MISRA C Rule 16.2

2024-04-17 Thread Nicola Vetrini
. Convert fallthrough comments in other clauses to the pseudo-keyword while at it. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- docs/misra/safe.json | 8 xen/common/domain.c | 1 + 2 files changed, 9 insertions(+) diff --git a/docs/misra/safe.json b/docs/misra

Re: [XEN PATCH] automation/eclair_analysis: substitute deprecated service

2024-04-17 Thread Nicola Vetrini
On 2024-04-17 16:57, Julien Grall wrote: Hi Nicola, On 17/04/2024 15:51, Nicola Vetrini wrote: The service STD.emptrecd is in the process of being removed in favour of STD.anonstct. I am guessing this is not a new feature and the current ECLAIR version is supporting it? Cheers, Yes

[XEN PATCH] automation/eclair_analysis: substitute deprecated service

2024-04-17 Thread Nicola Vetrini
The service STD.emptrecd is in the process of being removed in favour of STD.anonstct. No functional change. Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/toolchain.ecl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automation/eclair_analysis

Re: [XEN PATCH v2 1/9] x86/vlapic: tidy switch statement and address MISRA violation

2024-04-11 Thread Nicola Vetrini
On 2024-04-11 14:03, Andrew Cooper wrote: On 09/04/2024 8:45 pm, Nicola Vetrini wrote: On 2024-04-08 09:32, Jan Beulich wrote: On 05.04.2024 11:14, Nicola Vetrini wrote: Remove unneded blank lines between switch clauses. "Unneeded" based on what? We're carefully trying

Re: [PATCH] xen/spinlock: Adjust LOCK_DEBUG_INITVAL to placate MISRA

2024-04-10 Thread Nicola Vetrini
On 2024-04-10 21:35, Andrew Cooper wrote: Resolves an R7.2 violation. Thanks, I was going to suggest the same change. This will resolve the failure of the CI MISRA analysis on GitLab. Reviewed-by: Nicola Vetrini Fixes: c286bb93d20c ("xen/spinlock: support higher number of cpus&quo

Re: [XEN PATCH v2 7/9] xen/xsm: address violation of MISRA C Rule 16.2

2024-04-09 Thread Nicola Vetrini
On 2024-04-09 16:02, Daniel P. Smith wrote: On 4/5/24 05:14, Nicola Vetrini wrote: Refactor the switch so that a violation of MISRA C Rule 16.2 is resolved (A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement). Note

Re: [XEN PATCH v2 6/9] x86/hvm: address violations of MISRA C Rule 16.2

2024-04-09 Thread Nicola Vetrini
On 2024-04-08 09:57, Jan Beulich wrote: On 05.04.2024 11:14, Nicola Vetrini wrote: --- a/xen/arch/x86/hvm/hypercall.c +++ b/xen/arch/x86/hvm/hypercall.c @@ -119,12 +119,12 @@ int hvm_hypercall(struct cpu_user_regs *regs) (mode == 8 ? regs->rdi : regs-&

Re: [XEN PATCH v2 2/9] x86/cpuid: address violation of MISRA C Rule 16.2

2024-04-09 Thread Nicola Vetrini
On 2024-04-08 09:39, Jan Beulich wrote: On 05.04.2024 11:14, Nicola Vetrini wrote: Refactor the switch so that a violation of MISRA C Rule 16.2 is resolved (A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement). Note

Re: [XEN PATCH v2 1/9] x86/vlapic: tidy switch statement and address MISRA violation

2024-04-09 Thread Nicola Vetrini
On 2024-04-08 09:32, Jan Beulich wrote: On 05.04.2024 11:14, Nicola Vetrini wrote: Remove unneded blank lines between switch clauses. "Unneeded" based on what? We're carefully trying to improve readability of large switch() statements by adding such blank lines (at least) between

Re: [XEN PATCH v2 3/9] x86/irq: tidy switch statement and address MISRA violation

2024-04-08 Thread Nicola Vetrini
On 2024-04-09 02:14, Stefano Stabellini wrote: On Mon, 8 Apr 2024, Jan Beulich wrote: On 05.04.2024 11:14, Nicola Vetrini wrote: > Remove unneded blank lines between switch clauses. NAK for this part again. > --- a/xen/arch/x86/irq.c > +++ b/xen/arch/x86/irq.c > @@ -2882,7 +2

[XEN PATCH] xen/compiler: address violation of MISRA C Rule 20.9

2024-04-05 Thread Nicola Vetrini
The rule states: "All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluation". In this case, using defined(identifier) is a MISRA-compliant way to achieve the same effect. Signed-off-by: Nicola Vetrini --- This i

[XEN PATCH v2 6/9] x86/hvm: address violations of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
Refactor the switch so that a violation of MISRA C Rule 16.2 is resolved (a switch label should be immediately enclosed in the compound statement of the switch). The switch clause ending with the pseudo keyword "fallthrough" is an allowed exception to Rule 16.3. Signed-off-by: Nico

[XEN PATCH v2 0/9] address violations of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
impact (the x86 emulator files and svm/emulate.c) are deviated, in order to have a reasonable balance between code changes and deviations. [1] https://lore.kernel.org/xen-devel/99114c15a4256e6a0f39bd6de232ee4b8ad9b587.1698239734.git.nicola.vetr...@bugseng.com/ Nicola Vetrini (9): x86/vlapic

[XEN PATCH v2 4/9] x86/efi: tidy switch statement and address MISRA violation

2024-04-05 Thread Nicola Vetrini
ed exception to Rule 16.3. Convert fallthrough comments in other clauses to the pseudo-keyword while at it. No functional change. Signed-off-by: Nicola Vetrini --- There is some degree of duplication here between the default clause and the others, but I don't think there is a way to avoid it. -

[XEN PATCH v2 2/9] x86/cpuid: address violation of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
exception to Rule 16.3. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/cpuid.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c index 7290a979c667..0a7c55199f94 100644 --- a/xe

[XEN PATCH v2 7/9] xen/xsm: address violation of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
exception to Rule 16.3. Signed-off-by: Nicola Vetrini --- The second switch is not the best in terms of readability, so it may be best to deviate this particular instance. --- xen/include/xsm/dummy.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/include/xsm/dum

[XEN PATCH v2 9/9] eclair_analysis: deviate x86 emulator for Rule 16.2

2024-04-05 Thread Nicola Vetrini
hose files for this guideline. No functional change. Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 7 +++ docs/misra/deviations.rst| 6 ++ 2 files changed, 13 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/

[XEN PATCH v2 8/9] xen/domain: deviate MISRA C Rule 16.2 violation

2024-04-05 Thread Nicola Vetrini
. To avoid this, the construct is deviated with a text-based deviation. No functional change. Signed-off-by: Nicola Vetrini --- I chose a text-based deviation, rather than exempting PROGRESS_VCPU, because it's more refined and it's unlikely that more violations are introduced, since the rule has onl

[XEN PATCH v2 1/9] x86/vlapic: tidy switch statement and address MISRA violation

2024-04-05 Thread Nicola Vetrini
keyword "fallthrough" is an allowed exception to Rule 16.3. No functional change. Suggested-by: Jan Beulich Signed-off-by: Nicola Vetrini --- xen/arch/x86/hvm/vlapic.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/ar

[XEN PATCH v2 5/9] xen/domctl: address violations of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
. Convert fallthrough comments in other clauses to the pseudo-keyword while at it. No functional change. Signed-off-by: Nicola Vetrini --- xen/common/domctl.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index f2e0e36a17c3..ca

[XEN PATCH v2 3/9] x86/irq: tidy switch statement and address MISRA violation

2024-04-05 Thread Nicola Vetrini
keyword "fallthrough" is an allowed exception to Rule 16.3. No functional change. Signed-off-by: Nicola Vetrini --- The initialization of irq is due to gcc thinking that irq may be used uninitizalied in the test after MAP_PIRQ_TYPE_MULTI_MSI --- xen/arch/x86/irq.c | 9 +++-- 1 file

Re: Violations of mandatory MISRA C:2012 Rule 19.1 in X86_64 build

2024-04-04 Thread Nicola Vetrini
both simply mean we're relying on another compiler extension that's not exactly spelled out as such. Opinions? Jan Regardless of whether the compiler will do the right thing or not, Mandatory guidelines can't be deviated. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [XEN PATCH 3/7] xen/sched: address a violation of MISRA C:2012 Rule 16.3

2024-04-03 Thread Nicola Vetrini
ong and too specific about which patterns were deviated, while also having a precise record of the MISRA deviations that didn't live in ECLAIR-specific files. Maybe the use of the pseudo-keyword emerged after the rule was added to rules.rst, since deviations.rst is updated more frequently. -- Ni

Re: [XEN PATCH v3 1/7] x86/msi: address violation of MISRA C Rule 20.7 and coding style

2024-04-02 Thread Nicola Vetrini
On 2024-04-02 17:05, Jan Beulich wrote: On 29.03.2024 10:11, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure

[XEN PATCH v3 0/7] address violations of MISRA C Rule 20.7

2024-03-29 Thread Nicola Vetrini
gged as v1). All other patches are new in this series and are pairwise indipendent. Nicola Vetrini (7): x86/msi: address violation of MISRA C Rule 20.7 and coding style arm/public: address violations of MISRA C Rule 20.7 x86/vPMU: address violations of MISRA C Rule 20.7 x86/hvm: address

[XEN PATCH v3 2/7] arm/public: address violations of MISRA C Rule 20.7

2024-03-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/include/public/arch-arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index a2

[XEN PATCH v3 4/7] x86/hvm: address violations of MISRA C Rule 20.7

2024-03-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/hvm/domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c index 7f6e362a702e..b9

[XEN PATCH v3 5/7] automation/eclair: add deviations for Rule 20.7

2024-03-29 Thread Nicola Vetrini
of alternative_{call,vcall}[0-9] macros. The existing configuration for R20.7 is reordered so that it matches the cases listed in its documentation comment. Signed-off-by: Nicola Vetrini --- .../eclair_analysis/ECLAIR/deviations.ecl | 25 +-- docs/misra/deviations.rst

[XEN PATCH v3 7/7] x86/amd: address violations of MISRA C Rule 20.7

2024-03-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/amd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/amd.h b/xen/arch/x86/include/asm/amd.h index 2c

[XEN PATCH v3 1/7] x86/msi: address violation of MISRA C Rule 20.7 and coding style

2024-03-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. While at it, the style of these macros has been somewhat uniformed. No functional change. Signed-off-by: Nicola Vetrini --- Changes in v2: - Make the style change more consistent --- xen/arch/x86/include/asm/

[XEN PATCH v3 3/7] x86/vPMU: address violations of MISRA C Rule 20.7

2024-03-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/vpmu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/include/asm/vpmu.h b/xen/arch/x86/include/asm/vpmu.h index f2

[XEN PATCH v3 6/7] xen/mm: address violations of MISRA C Rule 20.7

2024-03-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/include/xen/mm.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 3e84960a365f..7561297a7

Re: [XEN PATCH 09/11] x86/msi: address violation of MISRA C Rule 20.7 and coding style

2024-03-26 Thread Nicola Vetrini
ded where needed, as suggested earlier, and then you can submit a further cleanup patch to remove e.g. the open coding? -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [XEN PATCH 07/11] xen/page_alloc: address violations of MISRA C Rule 20.7

2024-03-26 Thread Nicola Vetrini
On 2024-03-26 16:35, Jan Beulich wrote: On 26.03.2024 16:27, Nicola Vetrini wrote: On 2024-03-25 10:27, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -150,7 +150,7 @@ #include #else #define

Re: [XEN PATCH 09/11] x86/msi: address violation of MISRA C Rule 20.7 and coding style

2024-03-26 Thread Nicola Vetrini
On 2024-03-26 16:13, Jan Beulich wrote: On 26.03.2024 15:30, Nicola Vetrini wrote: On 2024-03-26 11:05, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parent

Re: [XEN PATCH 07/11] xen/page_alloc: address violations of MISRA C Rule 20.7

2024-03-26 Thread Nicola Vetrini
Hi Jan, sorry, forgot to reply. On 2024-03-25 10:27, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -150,7 +150,7 @@ #include #else #define p2m_pod_offline_or_broken_hit(pg) 0 Seeing this in context: Does

Re: [XEN PATCH 11/11] x86/public: hvm: address violations of MISRA C Rule 20.7

2024-03-26 Thread Nicola Vetrini
On 2024-03-26 11:15, Jan Beulich wrote: On 22.03.2024 17:02, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure

Re: [XEN PATCH 10/11] x86/hvm: address violations of Rule 20.7

2024-03-26 Thread Nicola Vetrini
On 2024-03-26 11:13, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure

Re: [XEN PATCH 09/11] x86/msi: address violation of MISRA C Rule 20.7 and coding style

2024-03-26 Thread Nicola Vetrini
On 2024-03-26 11:05, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure

Re: [XEN PATCH 08/11] x86/altcall: address violations of MISRA C Rule 20.7

2024-03-26 Thread Nicola Vetrini
On 2024-03-25 15:58, Jan Beulich wrote: On 25.03.2024 15:47, Nicola Vetrini wrote: On 2024-03-25 10:38, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parent

Re: [XEN PATCH 08/11] x86/altcall: address violations of MISRA C Rule 20.7

2024-03-25 Thread Nicola Vetrini
On 2024-03-25 10:38, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure

Re: [XEN PATCH 06/11] xen/efi: address violations of MISRA C Rule 20.7

2024-03-25 Thread Nicola Vetrini
On 2024-03-25 10:25, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure

Re: [XEN PATCH 00/11] address some violations of MISRA C Rule 20.7

2024-03-25 Thread Nicola Vetrini
On 2024-03-25 09:00, Jan Beulich wrote: On 22.03.2024 17:01, Nicola Vetrini wrote: Hi all, this series aims to refactor some macros that cause violations of MISRA C Rule 20.7 ("Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses"). All

[XEN PATCH 04/11] xentrace: address violation of MISRA C Rule 20.7

2024-03-22 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/include/public/trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h index 62a179971d2a..3c9f9c3c1

[XEN PATCH 06/11] xen/efi: address violations of MISRA C Rule 20.7

2024-03-22 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/include/efi/efiapi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/efi/efiapi.h b/xen/include/efi/efiapi.h index a616d1238aa4..6d4d4e340

[XEN PATCH 00/11] address some violations of MISRA C Rule 20.7

2024-03-22 Thread Nicola Vetrini
el.org/xen-devel/cover.1710762555.git.nicola.vetr...@bugseng.com/ Nicola Vetrini (11): xen/list: address violations of MISRA C Rule 20.7 xen/xsm: add parentheses to comply with MISRA C Rule 20.7 xen/efi: efibind: address violations of MISRA C Rule 20.7 xentrace: address violation of MISRA C

[XEN PATCH 09/11] x86/msi: address violation of MISRA C Rule 20.7 and coding style

2024-03-22 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. While at it, the style of these macros has been somewhat uniformed. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/msi.h | 47 +- 1 file changed, 24 insertions(+), 23

[XEN PATCH 08/11] x86/altcall: address violations of MISRA C Rule 20.7

2024-03-22 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/alternative.h | 76 +- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/xen/arch/x86/include/asm/alternative.h b/xe

[XEN PATCH 02/11] xen/xsm: add parentheses to comply with MISRA C Rule 20.7

2024-03-22 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- xen/include/xsm/dummy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dum

[XEN PATCH 03/11] xen/efi: efibind: address violations of MISRA C Rule 20.7

2024-03-22 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- This file is matched by exclude-list.json, but the fix is rather trivial and impacts code that in under the scope of MISRA compliance. --- xen/arch/arm/i

[XEN PATCH 05/11] xen: address MISRA C Rule 20.7 violation in generated hypercall

2024-03-22 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/scripts/gen_hypercall.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/scripts/gen_hypercall.awk b/xen/scripts/gen_hypercall.awk index 9f

[XEN PATCH 01/11] xen/list: address violations of MISRA C Rule 20.7

2024-03-22 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- Changes in v2: - changes to list.h are all in this patch; - Parenthesized some instances of "pos" and "n" even when already covered by the deviati

  1   2   3   4   5   6   7   8   9   10   >