From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Xen-devel <xen-devel@lists.xenproject.org>,
michal.orzel@amd.com, xenia.ragiadakou@amd.com,
ayan.kumar.halder@amd.com, consulting@bugseng.com,
jbeulich@suse.com, andrew.cooper3@citrix.com,
roger.pau@citrix.com,
Simone Ballarin <simone.ballarin@bugseng.com>,
Doug Goldstein <cardoe@cardoe.com>,
George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH][for-4.19 v5] xen: Add deviations for MISRA C:2012 Rule 7.1
Date: Tue, 31 Oct 2023 16:10:34 +0100 [thread overview]
Message-ID: <2201cad3353f5deb567f929e91e90fd2@bugseng.com> (raw)
In-Reply-To: <DFC25ACE-FFBE-43CF-9CE2-90671D122CEC@arm.com>
On 2023-10-31 15:13, Luca Fancellu wrote:
>> On 31 Oct 2023, at 13:27, Julien Grall <julien@xen.org> wrote:
>>
>> Hi Stefano,
>>
>> On 30/10/2023 22:49, Stefano Stabellini wrote:
>>> On Mon, 30 Oct 2023, Julien Grall wrote:
>>>> Hi Nicola,
>>>>
>>>> On 27/10/2023 16:11, Nicola Vetrini wrote:
>>>>> diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
>>>>> index 8511a189253b..8aaaa1473fb4 100644
>>>>> --- a/docs/misra/deviations.rst
>>>>> +++ b/docs/misra/deviations.rst
>>>>> @@ -90,6 +90,13 @@ Deviations related to MISRA C:2012 Rules:
>>>>> - __emulate_2op and __emulate_2op_nobyte
>>>>> - read_debugreg and write_debugreg
>>>>> + * - R7.1
>>>>> + - It is safe to use certain octal constants the way they are
>>>>> defined
>>>>> + in specifications, manuals, and algorithm descriptions.
>>>>> Such places
>>>>> + are marked safe with a /\* octal-ok \*/ in-code comment, or
>>>>> with a
>>>>> SAF
>>>>> + comment (see safe.json).
>>>>
>>>> Reading this, it is unclear to me why we have two ways to deviate
>>>> the rule
>>>> r7.1. And more importantely, how would the developper decide which
>>>> one to use?
>>> I agree with you on this and we were discussing this topic just this
>>> morning in the FUSA community call. I think we need a way to do this
>>> with the SAF framework:
>>> if (some code with violation) /* SAF-xx-safe */
>>> This doesn't work today unfortunately. It can only be done this way:
>>> /* SAF-xx-safe */
>>> if (some code with violation)
>>> Which is not always desirable. octal-ok is just an ad-hoc solution
>>> for
>>> one specific violation but we need a generic way to do this. Luca is
>>> investigating possible ways to support the previous format in SAF.
>>
>> Why can't we use octal-ok everywhere for now? My point here is to make
>> simple for the developper to know what to use.
>>
>>> I think we should take this patch for now and harmonize it once SAF
>>> is
>>> improved.
>>
>> The description of the deviation needs some improvement. To give an
>> example, with the current wording, one could they can use octal-ok
>> everywhere. But above, you are implying that SAF-xx-safe should be
>> preferred.
>>
>> I would still strongly prefer if we use octal-ok everywhere because
>> this is simple to remember. But if the other are happy to have both
>> SAF-XX and octal-ok, then the description needs to be completely
>> unambiguous and the patch should contain some explanation why we have
>> two different ways to deviate.
>
> Would it be ok to have both, for example: /* SAF-XX-safe octal-ok */
>
> So that the suppression engine do what it should (currently it doesn’t
> suppress the same line, but we could do something about it) and the
> developer
> has a way to understand what is the violation here without going to the
> justification database.
I guess. It could overflow the 80-char limit in
xen/arch/x86/hvm/svm/svm.h, though.
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2023-10-31 15:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0c86b50a796ba2aaab01e30935ed559ab719d33a.1698418578.git.nicola.vetrini@bugseng.com>
2023-10-27 20:52 ` [XEN PATCH][for-4.19 v5] xen: Add deviations for MISRA C:2012 Rule 7.1 Stefano Stabellini
2023-10-30 14:51 ` Julien Grall
2023-10-30 22:49 ` Stefano Stabellini
2023-10-31 13:27 ` Julien Grall
2023-10-31 14:13 ` Luca Fancellu
2023-10-31 15:10 ` Nicola Vetrini [this message]
2023-10-31 15:12 ` Luca Fancellu
2023-10-31 15:27 ` Julien Grall
2023-10-31 15:32 ` Luca Fancellu
2023-10-31 15:36 ` Julien Grall
2023-10-31 16:09 ` Luca Fancellu
2023-10-31 21:41 ` Stefano Stabellini
2023-11-02 8:36 ` Nicola Vetrini
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=2201cad3353f5deb567f929e91e90fd2@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=Luca.Fancellu@arm.com \
--cc=andrew.cooper3@citrix.com \
--cc=ayan.kumar.halder@amd.com \
--cc=cardoe@cardoe.com \
--cc=consulting@bugseng.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=simone.ballarin@bugseng.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.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.