All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com,
	xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
	consulting@bugseng.com, Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 1/5] xen/domain: deviate violation of MISRA C Rule 20.12
Date: Mon, 03 Jun 2024 15:21:22 +0200	[thread overview]
Message-ID: <91e5a73aaa1abdaa7922774022843932@bugseng.com> (raw)
In-Reply-To: <7e96b887-8fd3-4ecc-a23c-98a46ea1aa8c@suse.com>

On 2024-06-03 08:39, Jan Beulich wrote:
> On 01.06.2024 12:16, Nicola Vetrini wrote:
>> 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_DEBUG_LOCK_PROFILE=y the domain_lock
>> macro is used both as a regular macro argument and as an operand for
>> stringification in the expansion of macro spin_lock_init_prof.
> 
> The shouldn't the marker be on the definition of spin_lock_init_prof(),
> rather than ...
> 
>> --- a/xen/common/domain.c
>> +++ b/xen/common/domain.c
>> @@ -632,6 +632,7 @@ struct domain *domain_create(domid_t domid,
>> 
>>      atomic_set(&d->refcnt, 1);
>>      RCU_READ_LOCK_INIT(&d->rcu_lock);
>> +    /* SAF-6-safe Rule 20.12 expansion of macro domain_lock in debug 
>> builds */
>>      rspin_lock_init_prof(d, domain_lock);
>>      rspin_lock_init_prof(d, page_alloc_lock);
>>      spin_lock_init(&d->hypercall_deadlock_mutex);
> 
> ... actually just one of the two uses here (and presumably several more
> elsewhere)?
> 
> Jan

Actually it seems that this violation went away with some refactorings, 
so this patch is no longer needed other than for the addition to 
safe.json, so it can be folded into the next one.
I'll make the adjustment.

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


  reply	other threads:[~2024-06-03 13:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-01 10:16 [XEN PATCH 0/5] address violations of MISRA C rules Nicola Vetrini
2024-06-01 10:16 ` [XEN PATCH 1/5] xen/domain: deviate violation of MISRA C Rule 20.12 Nicola Vetrini
2024-06-03  6:39   ` Jan Beulich
2024-06-03 13:21     ` Nicola Vetrini [this message]
2024-06-01 10:16 ` [XEN PATCH 2/5] x86/domain: " Nicola Vetrini
2024-06-04  5:58   ` Jan Beulich
2024-06-01 10:16 ` [XEN PATCH 3/5] x86: " Nicola Vetrini
2024-06-04  6:08   ` Jan Beulich
2024-06-07 14:34     ` Nicola Vetrini
2024-06-01 10:16 ` [XEN PATCH 4/5] automation/eclair_analysis: address remaining violations " Nicola Vetrini
2024-06-03  5:58   ` Jan Beulich
2024-06-03  7:13     ` Nicola Vetrini
2024-06-03 18:52       ` Jan Beulich
2024-06-03 19:12         ` Nicola Vetrini
2024-06-03 21:24           ` Jan Beulich
2024-06-03 21:37             ` Nicola Vetrini
2024-06-20  1:28   ` Stefano Stabellini
2024-06-01 10:16 ` [XEN PATCH 5/5] xen: fix MISRA regressions on rule 20.9 and 20.12 Nicola Vetrini
2024-06-01 12:47   ` Andrew Cooper
2024-06-01 12:58     ` Nicola Vetrini
2024-06-01 13:08       ` Andrew Cooper
2024-06-01 13:52         ` Nicola Vetrini
2024-06-01 14:01           ` Andrew Cooper
2024-06-01 14:37 ` [XEN PATCH 0/5] address violations of MISRA C rules Andrew Cooper
2024-06-01 17:19   ` Nicola Vetrini
2024-06-01 17:22     ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91e5a73aaa1abdaa7922774022843932@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xenia.ragiadakou@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.