All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>, Julien Grall <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	Wei Liu <wl@xen.org>
Subject: Re: [PATCH] x86: make hypervisor build with gcc11
Date: Thu, 27 May 2021 10:48:16 +0200	[thread overview]
Message-ID: <YK9c0DaIEo7uZ5Gk@Air-de-Roger> (raw)
In-Reply-To: <ca7a78e5-2ee9-4109-7905-3b9186475f3d@suse.com>

On Wed, May 19, 2021 at 05:39:50PM +0200, Jan Beulich wrote:
> Gcc 11 looks to make incorrect assumptions about valid ranges that
> pointers may be used for addressing when they are derived from e.g. a
> plain constant. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100680.
> 
> Utilize RELOC_HIDE() to work around the issue, which for x86 manifests
> in at least
> - mpparse.c:efi_check_config(),
> - tboot.c:tboot_probe(),
> - tboot.c:tboot_gen_frametable_integrity(),
> - x86_emulate.c:x86_emulate() (at -O2 only).
> The last case is particularly odd not just because it only triggers at
> higher optimization levels, but also because it only affects one of at
> least three similar constructs. Various "note" diagnostics claim the
> valid index range to be [0, 2⁶³-1].
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

This is all quite ugly, but I don't have any recommendation short of
getting gcc fixed (or being able to disable those heuristics).

> 
> --- a/tools/tests/x86_emulator/x86-emulate.c
> +++ b/tools/tests/x86_emulator/x86-emulate.c
> @@ -8,6 +8,13 @@
>  
>  #define ERR_PTR(val) NULL
>  
> +/* See gcc bug 100680, but here don't bother making this version dependent. */

Might be worth also referencing 99578 which seems to be the parent
bug? (as 100680 has been closed as a duplicate)

Thanks, Roger.


  parent reply	other threads:[~2021-05-27  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 15:39 [PATCH] x86: make hypervisor build with gcc11 Jan Beulich
2021-05-26 17:23 ` Jason Andryuk
2021-05-27  8:48 ` Roger Pau Monné [this message]
2021-05-27  9: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=YK9c0DaIEo7uZ5Gk@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --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.