From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH 3/4] x86/uaccess: rework user access speculative harden guards
Date: Tue, 19 Nov 2024 15:42:18 +0100 [thread overview]
Message-ID: <ZzyjyvxP0CmBJaD4@macbook> (raw)
In-Reply-To: <f733e721-f9b8-4fef-8145-176ebcbdaa01@suse.com>
On Tue, Nov 19, 2024 at 03:29:58PM +0100, Jan Beulich wrote:
> On 19.11.2024 11:34, Roger Pau Monne wrote:
> > The current guards to select whether user accesses should be speculative
> > hardened violate Misra rule 20.7, as the UA_KEEP() macro doesn't (and can't)
> > parenthesize the 'args' argument.
> >
> > Change the logic so the guard is implemented inside the assembly block using
> > the .if assembly directive.
>
> Hmm, interesting idea. I don't overly like emitting stuff to pre-processed
> and even assembly files, but doing so is probably warranted here. Nevertheless:
> Did we consider at all to deviate these macros instead?
I think the proposal is not overly ugly, as I would otherwise simply
suggest to deviate. I'm assuming the preference is to attempt to fix
when possible rather than deviate.
> > --- a/xen/arch/x86/usercopy.c
> > +++ b/xen/arch/x86/usercopy.c
> > @@ -11,23 +11,23 @@
> > #include <asm/uaccess.h>
> >
> > #ifndef GUARD
> > -# define GUARD UA_KEEP
> > +# define GUARD 1
> > #endif
>
> At least in cases like this one I think a comment is necessary, perhaps as
> terse as /* Keep */ (and /* Drop */ further down).
Right, can adjust if we agree this is the way forward.
Thanks, Roger.
next prev parent reply other threads:[~2024-11-19 14:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 10:34 [PATCH 0/4] x86/misra: fix remaining violations of rule 20.7 Roger Pau Monne
2024-11-19 10:34 ` [PATCH 1/4] x8&/mm: fix IS_LnE_ALIGNED() to comply with Misra Rule 20.7 Roger Pau Monne
2024-11-19 10:52 ` Frediano Ziglio
2024-11-19 14:10 ` Roger Pau Monné
2024-11-19 11:06 ` Jan Beulich
2024-11-19 10:34 ` [PATCH 2/4] x86/msi: fix Misra Rule 20.7 in msi.h Roger Pau Monne
2024-11-19 14:21 ` Andrew Cooper
2024-11-19 14:39 ` Roger Pau Monné
2024-11-19 15:35 ` Andrew Cooper
2024-11-19 16:37 ` Roger Pau Monné
2024-11-19 10:34 ` [PATCH 3/4] x86/uaccess: rework user access speculative harden guards Roger Pau Monne
2024-11-19 14:29 ` Jan Beulich
2024-11-19 14:42 ` Roger Pau Monné [this message]
2024-11-19 15:31 ` Andrew Cooper
2024-11-19 16:35 ` Roger Pau Monné
2024-11-25 15:54 ` Jan Beulich
2024-11-19 10:34 ` [PATCH 4/4] automation/eclair: make Misra rule 20.7 blocking for x86 also Roger Pau Monne
2024-11-19 15:32 ` Andrew Cooper
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=ZzyjyvxP0CmBJaD4@macbook \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--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.