From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Cc: "Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: struct mctelem_cookie missing definition
Date: Thu, 13 Feb 2025 01:34:41 +0000 [thread overview]
Message-ID: <1823d604-aa29-4828-a954-b8a08fbdbda7@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2502121721490.619090@ubuntu-linux-20-04-desktop>
On 13/02/2025 1:25 am, Stefano Stabellini wrote:
> Hi all,
>
> I am looking through the few remaining MISRA violations that we have
> left. One of them is R11.2:
>
> https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/hardware/xen/ECLAIR_normal/staging/X86_64/9118578464/PROJECT.ecd;/by_service/MC3A2.R11.2.html#{%22select%22:true,%22selection%22:{%22hiddenAreaKinds%22:[],%22hiddenSubareaKinds%22:[],%22show%22:false,%22selector%22:{%22enabled%22:true,%22negated%22:true,%22kind%22:0,%22domain%22:%22kind%22,%22inputs%22:[{%22enabled%22:true,%22text%22:%22violation%22}]}}}
>
> Specifically, mctelem_cookie_t is a pointer to incomplete type and
> therefore COOKIE2MCTE triggers a "conversion between a pointer to an
> incomplete type and any other type".
>
> mctelem_cookie_t is defined as:
>
> typedef struct mctelem_cookie *mctelem_cookie_t;
>
> I am looking through the code and I genuinely cannot find the definition
> of struct mctelem_cookie.
>
> If mctelem_cookie_t is only used as a pointer, wouldn't it make more
> sense to do:
>
> typedef struct mctelem_ent *mctelem_cookie_t;
>
> ?
>
> What am I missing?
Nothing. Or perhaps the twisted thinking of the original author.
It is genuinely a pointer type (== known size) which you can't deference
(because there is no definition), and can only operate on by casting to
an integer. Except the code also requires it to be a uint64_t which is
why there's some fun disabling of relevant hypercalls for compat guests.
If someone could find the time to file it in /dev/null and replace it
with literally anything else, I'd be very thankful.
~Andrew
next prev parent reply other threads:[~2025-02-13 1:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 1:25 struct mctelem_cookie missing definition Stefano Stabellini
2025-02-13 1:34 ` Andrew Cooper [this message]
2025-02-13 1:39 ` Stefano Stabellini
2025-02-13 2:00 ` Stefano Stabellini
2025-02-13 7:47 ` Jan Beulich
2025-02-13 21:47 ` Stefano Stabellini
2025-02-14 3:00 ` Stefano Stabellini
2025-02-14 7:39 ` Jan Beulich
2025-02-14 7:46 ` Nicola Vetrini
2025-02-14 7:55 ` Jan Beulich
2025-02-14 23:04 ` Stefano Stabellini
2025-02-15 8:59 ` Nicola Vetrini
2025-02-17 7:47 ` Jan Beulich
2025-02-18 2:45 ` Stefano Stabellini
2025-02-18 3:11 ` Stefano Stabellini
2025-02-18 11:29 ` Jan Beulich
2025-02-18 21:37 ` Stefano Stabellini
2025-02-19 7:53 ` Jan Beulich
2025-02-19 11:05 ` Nicola Vetrini
2025-02-14 7:18 ` Jan Beulich
2025-02-13 7:34 ` Jan Beulich
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=1823d604-aa29-4828-a954-b8a08fbdbda7@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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.