mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	DRI <dri-devel@lists.freedesktop.org>
Subject: Re: objtool warning: "duplicate frame pointer save"
Date: Wed, 25 May 2016 12:56:31 -0500	[thread overview]
Message-ID: <20160525175631.44xgcylo24ysftss@treble> (raw)
In-Reply-To: <CA+55aFzJ=5D64V_qOqecerteESmim4tVRn2PDacR6DYsTN3EdQ@mail.gmail.com>

On Wed, May 25, 2016 at 10:14:24AM -0700, Linus Torvalds wrote:
> Josh,
>  my current git version (with gcc 5.3.1) makes objtool warn about
> "duplicate frame pointer save" in drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> for both vmw_send_msg() and vmw_host_get_guestinfo().
> 
> The reason is that VMW_PORT_HB_OUT() uses a magic instruction sequence
> (a "rep outsb") to communicate with the hypervisor (it's a virtual GPU
> driver for vmware), and %rbp is part of the communication. So the
> inline asm does a save-and-restore of the frame pointer around the
> instruction sequence.
> 
> I actually find the objtool warning to be quite reasonable, so it's
> not exactly a false positive, since in this case it actually does
> point out that the frame pointer won't be reliable over that
> instruction sequence.
> 
> But in this particular case it just ends up being the wrong thing -
> the code is what it is, and %rbp just can't have the frame information
> due to annoying magic calling conventions.
> 
> Is there some way to override objtool for this situation? I hate
> seeing warnings that I need to ignore, it has just too often caused me
> to mistakenly ignore warnings I *should* have reacted to.
> 
> I guess a STACK_FRAME_NON_STANDARD will shut objtool up (or just
> disabling it entirely for the whole file), but I was wondering about
> something more targeted that could be marked in the inline asm itself
> (rather than have to mark the functions that use it)

I used to have a STACKTOOL_IGNORE_INSN macro that would tell the tool to
skip warnings for specific instructions in inline asm:

Here's an example of it how it was used:

  https://lkml.kernel.org/r/c0c1a92df921961cae5cce208247bb8d8a975d6d.1450442274.git.jpoimboe@redhat.com

And here's the implementation of the macro:

  https://lkml.kernel.org/r/cd7778181d2a5251c3dc21811fdbcaa2c16c98c3.1450442274.git.jpoimboe@redhat.com

As it turns out, we didn't need the macro, so I removed it.  But I can
easily add something like that again to get rid of the warnings.

There were objections to having "OBJTOOL" in the names of macros, so I
guess I'll call it STACK_INSN_NON_STANDARD, unless anybody has a better
idea.

-- 
Josh

  reply	other threads:[~2016-05-25 17:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 17:14 Linus Torvalds
2016-05-25 17:56 ` Josh Poimboeuf [this message]
2016-05-25 23:51   ` Linus Torvalds
2016-05-26 18:43     ` [PATCH] drm/vmwgfx: fix "duplicate frame pointer save" warning Josh Poimboeuf
2016-05-26 18:58       ` Linus Torvalds
2016-06-08 14:27       ` [tip:core/urgent] objtool, drm/vmwgfx: Fix " tip-bot for Josh Poimboeuf

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=20160525175631.44xgcylo24ysftss@treble \
    --to=jpoimboe@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®