[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

[XEN PATCH 10/11] x86/hvm: address violations of 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/hvm/hvm.c | 6 +++--- xen/arch/x86/include/asm/hvm/save.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c

[XEN PATCH 07/11] xen/page_alloc: 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/common/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 28c510d6669b..82dc55829

[XEN PATCH 11/11] x86/public: hvm: 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/public/arch-x86/xen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/x

Re: [PATCH 0/7] xen/trace: Treewide API cleanup

2024-03-21 Thread Nicola Vetrini
On 2024-03-20 12:01, Nicola Vetrini wrote: On 2024-03-18 17:35, Andrew Cooper wrote: Rework the trace API to unify it (remove the HVM specific obfuscation), and remove MISRA violations. v3: * Delete TRACE_PARAM64() Andrew Cooper (7): xen/trace: Introduce new API xen/credit2: Clean up

Re: [PATCH 0/7] xen/trace: Treewide API cleanup

2024-03-20 Thread Nicola Vetrini
especially on Rule 20.7. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [XEN PATCH 07/10] xen/efi: efibind: address violations of MISRA C Rule 20.7

2024-03-18 Thread Nicola Vetrini
On 2024-03-18 17:49, Jan Beulich wrote: On 18.03.2024 12:53, 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 02/10] AMD/IOMMU: guest: address violations of MISRA C Rule 20.7

2024-03-18 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- This local helper may disappear as a follow-up to [1], if the function that remains there after the cleanup ends up being removed, so this patch has a slight dependency on what

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

2024-03-18 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- 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/dummy.h index 8671af1ba4d3..88039fdd2

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

2024-03-18 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- This file is matched by exclude-list.json, but the fix is rather trivial and actually benefits code that is in scope for compliance. --- xen/include/efi/efierr.h | 2 +- 1 file

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

2024-03-18 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- 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/include/asm/arm64/efib

[XEN PATCH 08/10] xen/notifier: address violations of MISRA C Rule 20.7

2024-03-18 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/notifier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/notifier.h b/xen/include/xen/notifier.h index 2a952484df43..05359e8a8

[XEN PATCH 09/10] xen/wait: address violations of MISRA C Rule 20.7

2024-03-18 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/wait.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/wait.h b/xen/include/xen/wait.h index 6eb7667d9c7f..1c68bc564

[XEN PATCH 06/10] xen/arm: smmu: address violations of MISRA C Rule 20.7

2024-03-18 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/drivers/passthrough/arm/smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/sm

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

2024-03-18 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/common/sched/private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index 459d1dfb11a5..c0e7c96d2

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

2024-03-18 Thread Nicola Vetrini
(1) as function arguments; (2) as macro arguments; (3) as array indices; (4) as lhs in assignments. [2] https://lore.kernel.org/xen-devel/cover.1709896401.git.nicola.vetr...@bugseng.com/ Nicola Vetrini (10): x86/cpufeature: add parentheses to comply with Rule 20.7

[XEN PATCH 04/10] xen/device_tree: address violations of MISRA C Rule 20.7

2024-03-18 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- This patch uniforms the way these macros use parentheses, skipping the already deviated cases of the lhs of an assignment. In principle, all three could have the parentheses on

[XEN PATCH 01/10] x86/cpufeature: add parentheses to comply with Rule 20.7

2024-03-18 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/cpufeatureset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/cpufeatureset.h b/xen/arch/x86/i

[XEN PATCH v3] amd/iommu: clean up unused guest iommu related functions

2024-03-15 Thread Nicola Vetrini
Delete unused functions from 'iommu_guest.c'. No functional change. Signed-off-by: Nicola Vetrini --- guest_iommu_add_ptr_log has still one caller, but even that seems suspicious. I left it in and uniformed its parameter type at the moment, so that whether it should be kept can be sorted out

Re: [XEN PATCH v2] amd/iommu: clean up unused guest iommu related functions

2024-03-15 Thread Nicola Vetrini
On 2024-03-15 14:31, Jan Beulich wrote: On 15.03.2024 12:16, Nicola Vetrini wrote: Delete unused functions from 'iommu_guest.c'. The 'cmd' parameter of amd_iommu_send_guest_cmd is passed to a function that expects arrays of size 4, therefore specifying explicitly the size also

Re: [PATCH v2 1/2] x86/IOMMU: address violations of MISRA C:2012 Rule 14.4

2024-03-15 Thread Nicola Vetrini
mu_intremap. Thanks, Roger. Noted, thanks. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

[XEN PATCH v2] amd/iommu: clean up unused guest iommu related functions

2024-03-15 Thread Nicola Vetrini
. Signed-off-by: Nicola Vetrini --- All current users of amd_iommu_send_guest pass an array of size 4, hence this is fixing a potential issue noticed by the analyzer for MISRA C Rule 17.5, not an actual bug. guest_iommu_add_ptr_log has still one caller, but even that seems suspicious. I left

Re: [XEN PATCH] amd/iommu: add fixed size to function parameter of array type

2024-03-14 Thread Nicola Vetrini
On 2024-03-14 09:32, Jan Beulich wrote: On 14.03.2024 08:42, Nicola Vetrini wrote: The 'cmd' parameter of amd_iommu_send_guest_cmd is passed to a function that expects arrays of size 4, therefore specifying explicitly the size also in amd_iommu_send_guest_cmd allows not to accidentally pass

[XEN PATCH] amd/iommu: add fixed size to function parameter of array type

2024-03-14 Thread Nicola Vetrini
tly. No functional change. Signed-off-by: Nicola Vetrini --- All current users pass an array of size 4, hence this patch is addressing a potential issue noticed by the analyzer in the context of Rule 17.5 ("The function argument corresponding to a parameter declared to have an array type sh

Re: [XEN PATCH v2] automation/eclair_analysis: deviate certain macros for Rule 20.12

2024-03-13 Thread Nicola Vetrini
On 2024-02-15 14:06, Nicola Vetrini wrote: Certain macros are allowed to violate the Rule, since their meaning and intended use is well-known to all Xen developers. Variadic macros that rely on the GCC extension for removing a trailing comma when token pasting the variable argument

Re: [XEN PATCH v2] xen/compiler: deviate the inline macro for MISRA C Rule 20.4

2024-03-12 Thread Nicola Vetrini
On 2024-03-12 12:25, Jan Beulich wrote: On 12.03.2024 12:13, Nicola Vetrini wrote: Rule 20.4 states: "A macro shall not be defined with the same name as a keyword". Defining this macro with the same name as the inline keyword allows for additionally checking that out-of-lined sta

[XEN PATCH v2] xen/compiler: deviate the inline macro for MISRA C Rule 20.4

2024-03-12 Thread Nicola Vetrini
ive impact on the overall safety. See [1] for additional context on the motivation of this deviation. No functional change. [1] https://lore.kernel.org/xen-devel/adaa6d55-266d-4df8-8967-9340080d1...@citrix.com/ Signed-off-by: Nicola Vetrini --- Changes in v2: - Rephrased SAF comment to be mo

Re: [XEN PATCH] xen/compiler: deviate the inline macro for MISRA C Rule 20.4

2024-03-11 Thread Nicola Vetrini
On 2024-03-11 08:32, Jan Beulich wrote: On 08.03.2024 09:10, Nicola Vetrini wrote: Rule 20.4 states: "A macro shall not be defined with the same name as a keyword". Defining this macro with the same name as the inline keyword allows for additionally checking that out-of-lined sta

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

2024-03-11 Thread Nicola Vetrini
On 2024-03-11 08:48, Jan Beulich wrote: On 08.03.2024 12:21, Nicola Vetrini wrote: --- a/xen/include/xen/list.h +++ b/xen/include/xen/list.h @@ -479,9 +479,9 @@ static inline void list_splice_init(struct list_head *list, * @n: another list_head to use as temporary storage * @head

[XEN PATCH v2 4/7] xen/param: address violations of MISRA C Rule 20.7

2024-03-08 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/param.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xen/include/xen/param.h b/xen/include/xen/param.h index 13

[XEN PATCH v2 5/7] xen/arm: address some violations of MISRA C Rule 20.7

2024-03-08 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- Style in arm64/cpufeature.c has not been amended, because this file seems to be kept in sync with its Linux counterpart. Changes in v2: - Added parentheses for consistency --- xe

[XEN PATCH v2 2/7] xen/include: address violations of MISRA C Rule 20.7

2024-03-08 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: - split from an earlier patch --- xen/include/xen/bug.h | 2 +- xen/include/xen/init.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x

[XEN PATCH v2 7/7] arm/smmu: address some violations of MISRA C Rule 20.7

2024-03-08 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/drivers/passthrough/arm/smmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu.c b/x

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

2024-03-08 Thread Nicola Vetrini
ot;. - Dropped GUARD(1) hunk from the x86 patch. - Dropped patch 4, 5 and 10: they will be subject to a deviation in the future. - Patch 7, 8, 9 have been committed already. Nicola Vetrini (7): xen/spinlock: address violations of MISRA C Rule 20.7 xen/include: address violations of MISRA C

[XEN PATCH v2 6/7] x86/irq: parenthesize negative constants

2024-03-08 Thread Nicola Vetrini
shall be enclosed in parentheses"). No functional change. Signed-off-by: Nicola Vetrini --- Changes in v2: - dropped the controversial GUARD(1) hunk --- xen/arch/x86/include/asm/irq.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/include/asm/irq.h b/xe

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

2024-03-08 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

[XEN PATCH v2 1/7] xen/spinlock: address violations of MISRA C Rule 20.7

2024-03-08 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/spinlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index 1cd9120eac7a..0e6a083df

[XEN PATCH] xen/compiler: deviate the inline macro for MISRA C Rule 20.4

2024-03-08 Thread Nicola Vetrini
ive impact on the overall safety. See [1] for additional context on the motivation of this deviation. No functional change. [1] https://lore.kernel.org/xen-devel/adaa6d55-266d-4df8-8967-9340080d1...@citrix.com/ Signed-off-by: Nicola Vetrini --- docs/misra/safe.json | 8 xen/i

Re: [XEN PATCH 10/10] xen/keyhandler: address violations of MISRA C Rule 20.7

2024-03-07 Thread Nicola Vetrini
wrote: On 29.02.2024 23:57, Stefano Stabellini wrote: On Thu, 29 Feb 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 p

Re: [XEN PATCH 04/10] xen/public: address violations of MISRA C Rule 20.7

2024-03-05 Thread Nicola Vetrini
On 2024-03-05 11:26, Jan Beulich wrote: On 05.03.2024 11:21, Nicola Vetrini wrote: On 2024-02-29 23:49, Stefano Stabellini wrote: On Thu, 29 Feb 2024, Nicola Vetrini wrote: On 2024-02-29 17:40, Jan Beulich wrote: On 29.02.2024 16:27, Nicola Vetrini wrote: --- a/xen/include/public/xen.h

Re: [XEN PATCH 03/10] x86: address some violations of MISRA C Rule 20.7

2024-03-05 Thread Nicola Vetrini
On 2024-02-29 18:05, Jan Beulich wrote: On 29.02.2024 17:45, Nicola Vetrini wrote: On 2024-02-29 17:37, Jan Beulich wrote: On 29.02.2024 16:27, Nicola Vetrini wrote: --- a/xen/arch/x86/include/asm/irq.h +++ b/xen/arch/x86/include/asm/irq.h @@ -179,9 +179,9 @@ void cleanup_domain_irq_mapping

Re: [XEN PATCH 02/10] xen/arm: address some violations of MISRA C Rule 20.7

2024-03-05 Thread Nicola Vetrini
On 2024-03-05 02:43, Stefano Stabellini wrote: On Mon, 4 Mar 2024, Nicola Vetrini wrote: Hi, as the maintainers of this subsystem, would you prefer Jan's version or the one in the patch? Both are fine w.r.t MISRA Rule 20.7 because the macro arguments themselves are parenthesized. I

Re: [XEN PATCH 06/10] arm/smmu: address some violations of MISRA C Rule 20.7

2024-03-05 Thread Nicola Vetrini
On 2024-02-29 23:53, Stefano Stabellini wrote: On Thu, 29 Feb 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 04/10] xen/public: address violations of MISRA C Rule 20.7

2024-03-05 Thread Nicola Vetrini
On 2024-02-29 23:49, Stefano Stabellini wrote: On Thu, 29 Feb 2024, Nicola Vetrini wrote: On 2024-02-29 17:40, Jan Beulich wrote: > On 29.02.2024 16:27, Nicola Vetrini wrote: > > --- a/xen/include/public/xen.h > > +++ b/xen/include/public/xen.h > > @@ -988,7 +98

Re: [XEN PATCH 02/10] xen/arm: address some violations of MISRA C Rule 20.7

2024-03-04 Thread Nicola Vetrini
parentheses are not required, but I can add them if the maintainers share your view. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [XEN PATCH 02/10] xen/arm: address some violations of MISRA C Rule 20.7

2024-03-01 Thread Nicola Vetrini
On 2024-02-29 17:34, Jan Beulich wrote: On 29.02.2024 16:27, Nicola Vetrini wrote: --- a/xen/arch/arm/cpuerrata.c +++ b/xen/arch/arm/cpuerrata.c @@ -462,8 +462,8 @@ static bool has_ssbd_mitigation(const struct arm_cpu_capabilities *entry) #define MIDR_RANGE(model, min, max

Violations of MISRA C Rule 20.7 in xen/arch/x86/include/asm/hvm/trace.h

2024-03-01 Thread Nicola Vetrini
named macros in xen/arch/x86/include/asm/hvm/trace.h Andrew Cooper: sigh - I'm half way through deleting all of that guess I ought to finish Andrew Cooper: @Nicola Vetrini: https://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen.git;a=shortlog;h=refs/heads/xen-trace On second thoughts

Re: [XEN PATCH 08/10] xen/errno: address violations of MISRA C Rule 20.7

2024-03-01 Thread Nicola Vetrini
On 2024-02-29 23:55, Stefano Stabellini wrote: On Thu, 29 Feb 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: [PATCH v2 1/3] docs/misra/rules.rst: add rule 16.6 and 20.12

2024-03-01 Thread Nicola Vetrini
/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_20_13.c>`_ - Required - A line whose first token is # shall be a valid preprocessing -- 2.25.1 -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)

Re: [XEN PATCH 01/10] xen/include: address violations of MISRA C Rule 20.7

2024-02-29 Thread Nicola Vetrini
On 2024-02-29 17:47, Andrew Cooper wrote: On 29/02/2024 4:21 pm, Nicola Vetrini wrote: On 2024-02-29 17:10, Andrew Cooper wrote: On 29/02/2024 3:27 pm, Nicola Vetrini wrote: diff --git a/xen/include/xen/kconfig.h b/xen/include/xen/kconfig.h index c25dc0f6c2a9..b7e70289737b 100644 --- a/xen

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

2024-02-29 Thread Nicola Vetrini
On 2024-02-29 17:42, Jan Beulich wrote: On 29.02.2024 16:27, Nicola Vetrini wrote: --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -10,10 +10,10 @@ #include #include -#define PERFCOUNTER( var, name ) { name, TYPE_SINGLE, 0 }, -#define PERFCOUNTER_ARRAY( var, name, size

Re: [XEN PATCH 04/10] xen/public: address violations of MISRA C Rule 20.7

2024-02-29 Thread Nicola Vetrini
On 2024-02-29 17:40, Jan Beulich wrote: On 29.02.2024 16:27, Nicola Vetrini wrote: --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -988,7 +988,7 @@ typedef struct { ((b) >> 8) & 0xFF, ((b) >> 0) & 0xFF, \ ((c) >&

Re: [XEN PATCH 03/10] x86: address some violations of MISRA C Rule 20.7

2024-02-29 Thread Nicola Vetrini
On 2024-02-29 17:37, Jan Beulich wrote: On 29.02.2024 16:27, Nicola Vetrini wrote: --- a/xen/arch/x86/include/asm/irq.h +++ b/xen/arch/x86/include/asm/irq.h @@ -179,9 +179,9 @@ void cleanup_domain_irq_mapping(struct domain *d); void *__ret = radix_tree_lookup(&(d)->arch.hvm.emui

Re: [XEN PATCH 01/10] xen/include: address violations of MISRA C Rule 20.7

2024-02-29 Thread Nicola Vetrini
On 2024-02-29 17:25, Jan Beulich wrote: On 29.02.2024 16:27, Nicola Vetrini wrote: --- a/xen/include/xen/kconfig.h +++ b/xen/include/xen/kconfig.h @@ -25,7 +25,7 @@ #define __ARG_PLACEHOLDER_1 0, #define config_enabled(cfg) _config_enabled(cfg) #define _config_enabled(value

Re: [XEN PATCH 01/10] xen/include: address violations of MISRA C Rule 20.7

2024-02-29 Thread Nicola Vetrini
On 2024-02-29 17:10, Andrew Cooper wrote: On 29/02/2024 3:27 pm, Nicola Vetrini wrote: diff --git a/xen/include/xen/kconfig.h b/xen/include/xen/kconfig.h index c25dc0f6c2a9..b7e70289737b 100644 --- a/xen/include/xen/kconfig.h +++ b/xen/include/xen/kconfig.h @@ -25,7 +25,7 @@ #define

[XEN PATCH 07/10] xen/arm: smmuv3: address violations of MISRA C Rule 20.7

2024-02-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/drivers/passthrough/arm/smmu-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-

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

2024-02-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/bug.h | 2 +- xen/include/xen/init.h | 4 +-- xen/include/xen/kconfig.h | 2 +- xen/include/xen/list.h | 59 +++--

[XEN PATCH 09/10] xen/include: tasklet: address violations of MISRA C Rule 20.7

2024-02-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/tasklet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/tasklet.h b/xen/include/xen/tasklet.h index 593d6a2400fb..78760b694

[XEN PATCH 04/10] xen/public: address violations of MISRA C Rule 20.7

2024-02-29 Thread Nicola Vetrini
MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore the macro XEN_DEFINE_UUID_ should wrap its parameters in parentheses. No functional change. Signed-off-by: Nicola Vetrini --- xen/include/public/xen.h

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

2024-02-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/common/perfc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/common/perfc.c b/xen/common/perfc.c index 7400667bf0c4..02f4fc8fe032 100644

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

2024-02-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- xen/common/keyhandler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 127ca506965c..4c1ce0078

[XEN PATCH 02/10] xen/arm: address some violations of MISRA C Rule 20.7

2024-02-29 Thread Nicola Vetrini
n possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini --- Style in arm64/cpufeature.c has not been amended, because this file seems to be kept in sync with its Linux counterpart. --- xen/arch/arm/arm64/cpufeature.c | 14 +++--

[XEN PATCH 08/10] xen/errno: address violations of MISRA C Rule 20.7

2024-02-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/errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/errno.h b/xen/include/xen/errno.h index 69b28dd3c6c5..506674701

<    1   2   3   4   5   6   7   8   9   10   >