From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
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, roger.pau@citrix.com,
Simone Ballarin <simone.ballarin@bugseng.com>,
Doug Goldstein <cardoe@cardoe.com>,
George Dunlap <george.dunlap@citrix.com>,
Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
andrew.cooper3@citrix.com
Subject: Re: [XEN PATCH][for-4.19 v3] xen: address violations of Rule 11.9
Date: Thu, 19 Oct 2023 09:32:41 +0200 [thread overview]
Message-ID: <a098b894455fa0da64d91882d3aa2f3d@bugseng.com> (raw)
In-Reply-To: <5b44bf79-24fa-abe3-1759-da1dd5d3e5de@suse.com>
On 19/10/2023 09:03, Jan Beulich wrote:
> On 19.10.2023 02:54, Stefano Stabellini wrote:
>> On Thu, 19 Oct 2023, andrew.cooper3@citrix.com wrote:
>>> On 18/10/2023 2:42 pm, Nicola Vetrini wrote:
>>>> diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
>>>> index ee7aed0609d2..1b00e4e3e9b7 100644
>>>> --- a/docs/misra/deviations.rst
>>>> +++ b/docs/misra/deviations.rst
>>>> @@ -199,6 +199,11 @@ Deviations related to MISRA C:2012 Rules:
>>>> See automation/eclair_analysis/deviations.ecl for the full
>>>> explanation.
>>>> - Tagged as `safe` for ECLAIR.
>>>>
>>>> + * - R11.9
>>>> + - __ACCESS_ONCE uses a 0 as a null pointer constant to check
>>>> if a type is
>>>> + scalar, therefore its usage for this purpose is allowed.
>>>
>>> This is still deeply misleading.
>>>
>>> There is an integer, which happens to be 0 but could be anything,
>>> used
>>> for a compile time typecheck[1]. In some cases this may be
>>> interpreted
>>> as a pointer constant, and is permitted for this purpose.
>>>
>>> ~Andrew
>>>
>>> [1] I know I wrote scalar typecheck in the comment, but I suspect
>>> that
>>> what I actually meant was non-compound-type typecheck.
>>
>> To help Nicola find the right wording do you have a concrete
>> suggestion
>> for the text to use?
>>
>> Reading your reply, I am guessing it would be:
>>
>> * - R11.9
>> - __ACCESS_ONCE uses an integer, which happens to be zero, as a
>> non-compound-type typecheck. The typecheck uses a cast. The usage
>> of
>> zero or other integers for this purpose is allowed.
>
> "non-compound" isn't correct either: __int128_t, for example, isn't a
> compound type but may not be used with ACCESS_ONCE(). Furthermore
> certain compound types are, as indicated earlier, in principle okay
> to use with ACCESS_ONCE(). Both are shortcomings of the present
> implementation, which imo shouldn't propagate into this document. I'd
> say just "as a compile time check".
>
> Jan
Ok, I'll amend it
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2023-10-19 7:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 13:42 [XEN PATCH][for-4.19 v3] xen: address violations of Rule 11.9 Nicola Vetrini
2023-10-18 15:19 ` Jan Beulich
2023-10-18 22:35 ` Stefano Stabellini
2023-10-18 23:13 ` andrew.cooper3
2023-10-19 0:54 ` Stefano Stabellini
2023-10-19 7:03 ` Jan Beulich
2023-10-19 7:32 ` Nicola Vetrini [this message]
2023-10-19 7:56 ` andrew.cooper3
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=a098b894455fa0da64d91882d3aa2f3d@bugseng.com \
--to=nicola.vetrini@bugseng.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.