All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: Re: [PATCH] x86/cet: Fix build on newer versions of GCC
Date: Tue, 17 Aug 2021 13:46:26 +0200	[thread overview]
Message-ID: <YRuhkuvuknY7SMR9@mail-itl> (raw)
In-Reply-To: <e80d5b51-47a2-c778-f9ef-707efd73aa5f@citrix.com>

[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]

On Tue, Aug 17, 2021 at 12:17:31PM +0100, Andrew Cooper wrote:
> On 17/08/2021 12:14, Marek Marczykowski-Górecki wrote:
> > On Tue, Aug 17, 2021 at 11:56:56AM +0100, Andrew Cooper wrote:
> >> Some versions of GCC complain with:
> >>
> >>   traps.c:405:22: error: 'get_shstk_bottom' defined but not used [-Werror=unused-function]
> >>    static unsigned long get_shstk_bottom(unsigned long sp)
> >>                         ^~~~~~~~~~~~~~~~
> >>   cc1: all warnings being treated as errors
> >>
> >> Change #ifdef to if ( IS_ENABLED(...) ) to make the sole user of
> >> get_shstk_bottom() visible to the compiler.
> >>
> >> Fixes: 35727551c070 ("x86/cet: Fix shskt manipulation error with BUGFRAME_{warn,run_fn}")
> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >> ---
> >> CC: Jan Beulich <JBeulich@suse.com>
> >> CC: Roger Pau Monné <roger.pau@citrix.com>
> >> CC: Wei Liu <wl@xen.org>
> >> CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> >>
> >> Not actually tested.  I don't seem to have a new enough GCC to hand.
> > I have just compile-tested it and it seems to fix the issue (indeed it
> > failed before with CONFIG_XEN_SHSTK disabled).
> 
> Oh, thanks!

And I can confirm it doesn't break anything runtime (but that's pretty
obvious looking at the patch).

> >> Most of the delta here is indentation.  This diff is more easily reviewed with
> >> `git show --ignore-all-space`
> > Wouldn't this make the compiler include the code even if
> > CONFIG_XEN_SHSTK is disabled (not a huge issue...)? Or is it smart
> > enough to optimize it out in that case?
> 
> Its a trivial dead-code elimination example, and yes - the compiler is
> smart enough.

:)

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-08-17 11:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 10:56 [PATCH] x86/cet: Fix build on newer versions of GCC Andrew Cooper
2021-08-17 11:14 ` Marek Marczykowski-Górecki
2021-08-17 11:17   ` Andrew Cooper
2021-08-17 11:46     ` Marek Marczykowski-Górecki [this message]
2021-08-17 11:50 ` 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=YRuhkuvuknY7SMR9@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.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.