All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
	"Teddy Astie" <teddy.astie@vates.tech>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/MCE: adjust ID2COOKIE() for Misra C:2012 rule 11.2
Date: Fri, 15 May 2026 08:26:22 +0200	[thread overview]
Message-ID: <b20a2e70-f08e-41da-ad81-913d5e5d2b7e@suse.com> (raw)
In-Reply-To: <8ef5af19-7660-4ee9-9cf6-094c744abd0c@citrix.com>

On 13.05.2026 19:00, Andrew Cooper wrote:
> On 13/05/2026 3:03 pm, Jan Beulich wrote:
>> --- a/xen/arch/x86/cpu/mcheck/mce.c
>> +++ b/xen/arch/x86/cpu/mcheck/mce.c
>> @@ -1264,7 +1264,7 @@ static void cf_check __maybe_unused x86_
>>  
>>  #if BITS_PER_LONG == 64
>>  
>> -#define ID2COOKIE(id) ((mctelem_cookie_t)(id))
>> +#define ID2COOKIE(id) ((mctelem_cookie_t)(void *)(id))
> 
> The interface here is horrible, because we're passing a pointer to a
> uint64_t to userspace and back.

Indeed.

> But, can't we just cast through unsigned long instead?  The compiler is
> happy, and that feels safer than using a pointer type.
I can check if that also helps. Casting to void * let's us, aiui, get away
without leveraging any custom deviations that we have.

Jan


  reply	other threads:[~2026-05-15  6:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 14:03 [PATCH] x86/MCE: adjust ID2COOKIE() for Misra C:2012 rule 11.2 Jan Beulich
2026-05-13 17:00 ` Andrew Cooper
2026-05-15  6:26   ` Jan Beulich [this message]
2026-05-13 20:47 ` Nicola Vetrini
2026-05-15  6:28   ` Jan Beulich
2026-05-15  6:33     ` 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=b20a2e70-f08e-41da-ad81-913d5e5d2b7e@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=teddy.astie@vates.tech \
    --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.