From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
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,
George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
Henry.Wang@arm.com
Subject: Re: [XEN PATCH][for-4.19 v2 2/2] docs/misra: add deviations.rst to document additional deviations.
Date: Wed, 11 Oct 2023 17:04:42 +0200 [thread overview]
Message-ID: <9fc7241a16ca8b1db9bf788d4125fe16@bugseng.com> (raw)
In-Reply-To: <186af6b6c1b34fc9088a5fb226ff2482@bugseng.com>
On 11/10/2023 17:00, Nicola Vetrini wrote:
>>>>>> +
>>>>>> + * - R2.1
>>>>>> + - The compiler implementation guarantees that the
>>>>>> unreachable code
>>>>>> is
>>>>>> + removed. Constant expressions and unreachable branches of
>>>>>> if and
>>>>>> switch
>>>>>> + statements are expected.
>>>>>> + - Tagged as `safe` for ECLAIR.
>>>>>> +
>>>>>> + * - R2.1
>>>>>> + - Some functions are intended not to be referenced.
>>>>>> + - Tagged as `deliberate` for ECLAIR.
>>>>>
>>>>> What does it mean "some functions" in this case? Should we list
>>>>> which
>>>>> functions?
>>>>>
>>>>
>>>> Well, there are a lot, typically resulting from build configurations
>>>> that do
>>>> not
>>>> use them, or because they are used only in asm code. I can mention
>>>> these
>>>> reasons in the
>>>> document, to make it easier to understand.
>>>
>>> Yes, I think we need to clarify further this point, because saying
>>> "Some
>>> functions" doesn't help the reader understand:
>>> - whether all functions can be not referenced
>>> - which subset of functions can be not referenced
>>>
>>> How to distinguish between? How do we know whether a certain patch is
>>> violating the rule or not?
>>>
>>> If there is a clear list of functions that can be not referenced,
>>> then
>>> we should list them here. If there is a methodology we can use to
>>> distinguish between them (e.g. functions called from asm only) then
>>> we
>>> can write the methodology here. Either way it is fine as long as the
>>> criteria to know if it is OK if a function is not referenced is
>>> clear.
>>
>> Aren't they more or less the one we tagged with SAF-1-safe because
>> there were no prototype? If so, we could use the same tags.
>>
>> We could introduce an extra tags for the others. An alternative would
>> be to add an attribute (e.g. asmcall) to mark each function used by
>> assembly.
>>
>> Cheers,
>
> Both suggestion do have some value. As it is, it's not distinguishable
> what causes a
> function to be unreferenced in a certain analysis config. However:
>
> - functions only used by asm code can be specified in the ECLAIR
> config so that they will
> have an extra fake reference as far as the checker is concerned. I
> can do that on a
> separate patch and list them in deviations.rst. An attribute seems a
> good way to signal the
> intention.
> - Functions that have no reference only in the current analysis should
> have their declaration
> #ifdef-ed out in the configurations where they are not used, in an
> ideal world.
> - Truly unreferenced functions should be removed, or justified
Especially the last two appear somewhat tricky to disentangle, as they
do require knowledge of
possible code paths.
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2023-10-11 15:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 15:44 [XEN PATCH][for-4.19 v2 0/2] update ecl configurations and deviations Nicola Vetrini
2023-10-09 15:44 ` [XEN PATCH][for-4.19 v2 1/2] automation/eclair: update deviations and accepted guidelines Nicola Vetrini
2023-10-10 1:20 ` Stefano Stabellini
2023-10-09 15:44 ` [XEN PATCH][for-4.19 v2 2/2] docs/misra: add deviations.rst to document additional deviations Nicola Vetrini
2023-10-10 1:19 ` Stefano Stabellini
2023-10-10 1:21 ` Henry Wang
2023-10-10 8:23 ` Nicola Vetrini
2023-10-10 22:27 ` Stefano Stabellini
2023-10-11 13:04 ` Julien Grall
2023-10-11 15:00 ` Nicola Vetrini
2023-10-11 15:04 ` Nicola Vetrini [this message]
2023-10-11 16:04 ` Nicola Vetrini
2023-10-12 23:14 ` Stefano Stabellini
2023-10-13 8:26 ` 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=9fc7241a16ca8b1db9bf788d4125fe16@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=Henry.Wang@arm.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=roger.pau@citrix.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.