* [XEN PATCH for-4.19 v2 0/3] address remaining violations of Rule 20.12
@ 2024-06-07 20:13 Nicola Vetrini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 1/3] x86/domain: deviate violation of MISRA C " Nicola Vetrini
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Nicola Vetrini @ 2024-06-07 20:13 UTC (permalink / raw)
To: nicola.vetrini, xen-devel
Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
consulting, Andrew Cooper, George Dunlap, Jan Beulich,
Julien Grall, Roger Pau Monné, Simone Ballarin,
Doug Goldstein, Oleksii Kurochko
This series addresses the remaining violations of Rule 20.12, and
consequently sets the rule (and others) as clean to enable the gating.
Patches 1 and 2 are retained from the previous version, while patch 3
was sent standalone and now merged in this series, as it depends
on the previous two patches.
Nicola Vetrini (3):
x86/domain: deviate violation of MISRA C Rule 20.12
automation/eclair_analysis: address remaining violations of MISRA C
Rule 20.12
automation/eclair_analysis: add more clean MISRA guidelines
automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++
automation/eclair_analysis/ECLAIR/tagging.ecl | 4 +++-
docs/misra/safe.json | 8 ++++++++
xen/arch/x86/domain.c | 1 +
xen/arch/x86/domctl.c | 1 +
5 files changed, 19 insertions(+), 1 deletion(-)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [XEN PATCH for-4.19 v2 1/3] x86/domain: deviate violation of MISRA C Rule 20.12
2024-06-07 20:13 [XEN PATCH for-4.19 v2 0/3] address remaining violations of Rule 20.12 Nicola Vetrini
@ 2024-06-07 20:13 ` Nicola Vetrini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 2/3] automation/eclair_analysis: address remaining violations " Nicola Vetrini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines Nicola Vetrini
2 siblings, 0 replies; 8+ messages in thread
From: Nicola Vetrini @ 2024-06-07 20:13 UTC (permalink / raw)
To: nicola.vetrini, xen-devel
Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
consulting, Andrew Cooper, George Dunlap, Jan Beulich,
Julien Grall, Roger Pau Monné, Oleksii Kurochko
MISRA C Rule 20.12 states: "A macro parameter used as an operand to
the # or ## operators, which is itself subject to further macro replacement,
shall only be used as an operand to these operators".
In this case, builds where CONFIG_COMPAT=y the fpu_ctxt
macro is used both as a regular macro argument and as an operand for
stringification in the expansion of CHECK_FIELD_.
This is deviated using a SAF-x-safe comment.
No functional change.
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
docs/misra/safe.json | 8 ++++++++
xen/arch/x86/domain.c | 1 +
xen/arch/x86/domctl.c | 1 +
3 files changed, 10 insertions(+)
diff --git a/docs/misra/safe.json b/docs/misra/safe.json
index 9b13bcf71706..c213e0a0be3b 100644
--- a/docs/misra/safe.json
+++ b/docs/misra/safe.json
@@ -52,6 +52,14 @@
},
{
"id": "SAF-6-safe",
+ "analyser": {
+ "eclair": "MC3R1.R20.12"
+ },
+ "name": "MC3R1.R20.12: use of a macro argument that deliberately violates the Rule",
+ "text": "A macro parameter that is itself a macro is intentionally used within the macro both as a regular parameter and for text replacement."
+ },
+ {
+ "id": "SAF-7-safe",
"analyser": {},
"name": "Sentinel",
"text": "Next ID to be used"
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 536542841ef5..ccadfe0c9e70 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1084,6 +1084,7 @@ void arch_domain_creation_finished(struct domain *d)
#ifdef CONFIG_COMPAT
#define xen_vcpu_guest_context vcpu_guest_context
#define fpu_ctxt fpu_ctxt.x
+/* SAF-6-safe Rule 20.12 expansion of macro fpu_ctxt with CONFIG_COMPAT */
CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt);
#undef fpu_ctxt
#undef xen_vcpu_guest_context
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 9a72d57333e9..335aedf46d03 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1326,6 +1326,7 @@ long arch_do_domctl(
#ifdef CONFIG_COMPAT
#define xen_vcpu_guest_context vcpu_guest_context
#define fpu_ctxt fpu_ctxt.x
+/* SAF-6-safe Rule 20.12 expansion of macro fpu_ctxt with CONFIG_COMPAT */
CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt);
#undef fpu_ctxt
#undef xen_vcpu_guest_context
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [XEN PATCH for-4.19 v2 2/3] automation/eclair_analysis: address remaining violations of MISRA C Rule 20.12
2024-06-07 20:13 [XEN PATCH for-4.19 v2 0/3] address remaining violations of Rule 20.12 Nicola Vetrini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 1/3] x86/domain: deviate violation of MISRA C " Nicola Vetrini
@ 2024-06-07 20:13 ` Nicola Vetrini
2024-06-18 1:11 ` Stefano Stabellini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines Nicola Vetrini
2 siblings, 1 reply; 8+ messages in thread
From: Nicola Vetrini @ 2024-06-07 20:13 UTC (permalink / raw)
To: nicola.vetrini, xen-devel
Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
consulting, Simone Ballarin, Doug Goldstein, Oleksii Kurochko
The DEFINE macro in asm-offsets.c (for all architectures) still generates
violations despite the file(s) being excluded from compliance, due to the
fact that in its expansion it sometimes refers entities in non-excluded files.
These corner cases are deviated by the configuration.
No functional change.
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
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
index 447c1e6661d1..e2653f77eb2c 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -483,6 +483,12 @@ leads to a violation of the Rule are deviated."
-config=MC3R1.R20.12,macros+={deliberate, "name(GENERATE_CASE)&&loc(file(deliberate_generate_case))"}
-doc_end
+-doc_begin="The macro DEFINE is defined and used in excluded files asm-offsets.c.
+This may still cause violations if entities outside these files are referred to
+in the expansion."
+-config=MC3R1.R20.12,macros+={deliberate, "name(DEFINE)&&loc(file(asm_offsets))"}
+-doc_end
+
#
# Series 21.
#
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines
2024-06-07 20:13 [XEN PATCH for-4.19 v2 0/3] address remaining violations of Rule 20.12 Nicola Vetrini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 1/3] x86/domain: deviate violation of MISRA C " Nicola Vetrini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 2/3] automation/eclair_analysis: address remaining violations " Nicola Vetrini
@ 2024-06-07 20:13 ` Nicola Vetrini
2024-06-10 7:43 ` Jan Beulich
2 siblings, 1 reply; 8+ messages in thread
From: Nicola Vetrini @ 2024-06-07 20:13 UTC (permalink / raw)
To: nicola.vetrini, xen-devel
Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
consulting, Simone Ballarin, Doug Goldstein, Oleksii Kurochko
Rules 20.9, 20.12 and 14.4 are now clean on ARM and x86, so they are added
to the list of clean guidelines.
Some guidelines listed in the additional clean section for ARM are also
clean on x86, so they can be removed from there.
No functional change.
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
automation/eclair_analysis/ECLAIR/tagging.ecl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
index a354ff322e03..b829655ca0bc 100644
--- a/automation/eclair_analysis/ECLAIR/tagging.ecl
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -60,6 +60,7 @@ MC3R1.R11.7||
MC3R1.R11.9||
MC3R1.R12.5||
MC3R1.R14.1||
+MC3R1.R14.4||
MC3R1.R16.7||
MC3R1.R17.1||
MC3R1.R17.3||
@@ -73,6 +74,7 @@ MC3R1.R20.4||
MC3R1.R20.6||
MC3R1.R20.9||
MC3R1.R20.11||
+MC3R1.R20.12||
MC3R1.R20.13||
MC3R1.R20.14||
MC3R1.R21.3||
@@ -105,7 +107,7 @@ if(string_equal(target,"x86_64"),
)
if(string_equal(target,"arm64"),
- service_selector({"additional_clean_guidelines","MC3R1.R14.4||MC3R1.R16.6||MC3R1.R20.12||MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.2||MC3R1.R7.3||MC3R1.R8.6||MC3R1.R9.3"})
+ service_selector({"additional_clean_guidelines","MC3R1.R16.6||MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.3"})
)
-reports+={clean:added,"service(clean_guidelines_common||additional_clean_guidelines)"}
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines Nicola Vetrini
@ 2024-06-10 7:43 ` Jan Beulich
2024-06-10 8:14 ` Nicola Vetrini
0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2024-06-10 7:43 UTC (permalink / raw)
To: Nicola Vetrini
Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
consulting, Simone Ballarin, Doug Goldstein, Oleksii Kurochko,
xen-devel
On 07.06.2024 22:13, Nicola Vetrini wrote:
> Rules 20.9, 20.12 and 14.4 are now clean on ARM and x86, so they are added
> to the list of clean guidelines.
Why is 20.9 being mentioned here when ...
> --- a/automation/eclair_analysis/ECLAIR/tagging.ecl
> +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
> @@ -60,6 +60,7 @@ MC3R1.R11.7||
> MC3R1.R11.9||
> MC3R1.R12.5||
> MC3R1.R14.1||
> +MC3R1.R14.4||
> MC3R1.R16.7||
> MC3R1.R17.1||
> MC3R1.R17.3||
> @@ -73,6 +74,7 @@ MC3R1.R20.4||
> MC3R1.R20.6||
> MC3R1.R20.9||
> MC3R1.R20.11||
> +MC3R1.R20.12||
> MC3R1.R20.13||
> MC3R1.R20.14||
> MC3R1.R21.3||
... nothing changes in its regard?
Jan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines
2024-06-10 7:43 ` Jan Beulich
@ 2024-06-10 8:14 ` Nicola Vetrini
2024-06-18 1:16 ` Stefano Stabellini
0 siblings, 1 reply; 8+ messages in thread
From: Nicola Vetrini @ 2024-06-10 8:14 UTC (permalink / raw)
To: Jan Beulich
Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
consulting, Simone Ballarin, Doug Goldstein, Oleksii Kurochko,
xen-devel
On 2024-06-10 09:43, Jan Beulich wrote:
> On 07.06.2024 22:13, Nicola Vetrini wrote:
>> Rules 20.9, 20.12 and 14.4 are now clean on ARM and x86, so they are
>> added
>> to the list of clean guidelines.
>
> Why is 20.9 being mentioned here when ...
>
>> --- a/automation/eclair_analysis/ECLAIR/tagging.ecl
>> +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
>> @@ -60,6 +60,7 @@ MC3R1.R11.7||
>> MC3R1.R11.9||
>> MC3R1.R12.5||
>> MC3R1.R14.1||
>> +MC3R1.R14.4||
>> MC3R1.R16.7||
>> MC3R1.R17.1||
>> MC3R1.R17.3||
>> @@ -73,6 +74,7 @@ MC3R1.R20.4||
>> MC3R1.R20.6||
>> MC3R1.R20.9||
>> MC3R1.R20.11||
>> +MC3R1.R20.12||
>> MC3R1.R20.13||
>> MC3R1.R20.14||
>> MC3R1.R21.3||
>
> ... nothing changes in its regard?
>
Right, it should be removed from the message.
> Jan
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [XEN PATCH for-4.19 v2 2/3] automation/eclair_analysis: address remaining violations of MISRA C Rule 20.12
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 2/3] automation/eclair_analysis: address remaining violations " Nicola Vetrini
@ 2024-06-18 1:11 ` Stefano Stabellini
0 siblings, 0 replies; 8+ messages in thread
From: Stefano Stabellini @ 2024-06-18 1:11 UTC (permalink / raw)
To: Nicola Vetrini
Cc: xen-devel, sstabellini, michal.orzel, xenia.ragiadakou,
ayan.kumar.halder, consulting, Simone Ballarin, Doug Goldstein,
Oleksii Kurochko
On Fri, 7 Jun 2024, Nicola Vetrini wrote:
> The DEFINE macro in asm-offsets.c (for all architectures) still generates
> violations despite the file(s) being excluded from compliance, due to the
> fact that in its expansion it sometimes refers entities in non-excluded files.
> These corner cases are deviated by the configuration.
>
> No functional change.
>
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
> 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
> index 447c1e6661d1..e2653f77eb2c 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -483,6 +483,12 @@ leads to a violation of the Rule are deviated."
> -config=MC3R1.R20.12,macros+={deliberate, "name(GENERATE_CASE)&&loc(file(deliberate_generate_case))"}
> -doc_end
>
> +-doc_begin="The macro DEFINE is defined and used in excluded files asm-offsets.c.
> +This may still cause violations if entities outside these files are referred to
> +in the expansion."
> +-config=MC3R1.R20.12,macros+={deliberate, "name(DEFINE)&&loc(file(asm_offsets))"}
> +-doc_end
> +
> #
> # Series 21.
> #
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines
2024-06-10 8:14 ` Nicola Vetrini
@ 2024-06-18 1:16 ` Stefano Stabellini
0 siblings, 0 replies; 8+ messages in thread
From: Stefano Stabellini @ 2024-06-18 1:16 UTC (permalink / raw)
To: Nicola Vetrini
Cc: Jan Beulich, sstabellini, michal.orzel, xenia.ragiadakou,
ayan.kumar.halder, consulting, Simone Ballarin, Doug Goldstein,
Oleksii Kurochko, xen-devel
On Mon, 10 Jun 2024, Nicola Vetrini wrote:
> On 2024-06-10 09:43, Jan Beulich wrote:
> > On 07.06.2024 22:13, Nicola Vetrini wrote:
> > > Rules 20.9, 20.12 and 14.4 are now clean on ARM and x86, so they are added
> > > to the list of clean guidelines.
> >
> > Why is 20.9 being mentioned here when ...
> >
> > > --- a/automation/eclair_analysis/ECLAIR/tagging.ecl
> > > +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
> > > @@ -60,6 +60,7 @@ MC3R1.R11.7||
> > > MC3R1.R11.9||
> > > MC3R1.R12.5||
> > > MC3R1.R14.1||
> > > +MC3R1.R14.4||
> > > MC3R1.R16.7||
> > > MC3R1.R17.1||
> > > MC3R1.R17.3||
> > > @@ -73,6 +74,7 @@ MC3R1.R20.4||
> > > MC3R1.R20.6||
> > > MC3R1.R20.9||
> > > MC3R1.R20.11||
> > > +MC3R1.R20.12||
> > > MC3R1.R20.13||
> > > MC3R1.R20.14||
> > > MC3R1.R21.3||
> >
> > ... nothing changes in its regard?
> >
>
> Right, it should be removed from the message.
I fixed the commit message, acked the patch and committed it
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-06-18 1:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-07 20:13 [XEN PATCH for-4.19 v2 0/3] address remaining violations of Rule 20.12 Nicola Vetrini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 1/3] x86/domain: deviate violation of MISRA C " Nicola Vetrini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 2/3] automation/eclair_analysis: address remaining violations " Nicola Vetrini
2024-06-18 1:11 ` Stefano Stabellini
2024-06-07 20:13 ` [XEN PATCH for-4.19 v2 3/3] automation/eclair_analysis: add more clean MISRA guidelines Nicola Vetrini
2024-06-10 7:43 ` Jan Beulich
2024-06-10 8:14 ` Nicola Vetrini
2024-06-18 1:16 ` Stefano Stabellini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.