From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jann Horn <jannh@google.com>, Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
the arch/x86 maintainers <x86@kernel.org>,
kernel list <linux-kernel@vger.kernel.org>,
alexandre.chartre@oracle.com
Subject: Re: x86 entry perf unwinding failure (missing IRET_REGS annotation on stack switch?)
Date: Tue, 28 Apr 2020 18:44:44 +0200 [thread overview]
Message-ID: <20200428164444.GD16910@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200428154909.4cjwetyyb2zhnq5i@treble>
On Tue, Apr 28, 2020 at 10:49:09AM -0500, Josh Poimboeuf wrote:
> > @@ -2439,12 +2445,6 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
> >
> > sec = insn->sec;
> >
> > - if (insn->alt_group && list_empty(&insn->alts)) {
> > - WARN_FUNC("don't know how to handle branch to middle of alternative instruction group",
> > - sec, insn->offset);
> > - return 1;
> > - }
> > -
>
> ACK (separate patch)
>
> > while (1) {
> > next_insn = next_insn_same_sec(file, insn);
> >
Yeah, there is one from Julien that does this:
20200327152847.15294-6-jthierry@redhat.com
> > @@ -2494,8 +2494,16 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
> > }
> > }
> >
> > - if (skip_orig)
> > + if (skip_orig) {
> > + struct instruction *prev_insn = insn;
> > + sec_for_each_insn_continue(file, insn) {
> > + if (!insn->alt_group)
> > + break;
> > + if (!insn->visited)
> > + insn->cfi = prev_insn->cfi;
> > + }
> > return 0;
> > + }
>
> NACK :-)
>
> What happens if you have two alternatives adjacent to each other (which
> can definitely happen in this scenario)?
Alexandre's alt_group would help:
20200414103618.12657-3-alexandre.chartre@oracle.com
Then we can do something like:
static void fill_alternative(struct instruction *insn)
{
struct instruction *first_insn = insn;
int alt_group = insn->alt_group;
sec_for_each_insn_continue(file, insn) {
if (insn->alt_group != alt_group)
break;
if (!insn->visited)
insn->cfi = first_insn->cfi;
}
}
> I still like my patch, at least the hack is done before the validate
> code, so validate_branch() itself is simpler.
But it doesn't handle the case where the alternatives themselves have
unreachable holes in them, if that happens we'll generate spurious ORC
entries for them.
next prev parent reply other threads:[~2020-04-28 16:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-01 6:02 x86 entry perf unwinding failure (missing IRET_REGS annotation on stack switch?) Jann Horn
2020-03-02 14:58 ` Peter Zijlstra
2020-03-02 15:18 ` Josh Poimboeuf
2020-03-02 15:52 ` Josh Poimboeuf
2020-04-28 7:04 ` Josh Poimboeuf
2020-04-28 12:46 ` Peter Zijlstra
2020-04-28 14:14 ` Josh Poimboeuf
2020-04-28 14:35 ` Peter Zijlstra
2020-04-28 14:16 ` Peter Zijlstra
2020-04-28 14:31 ` Josh Poimboeuf
2020-04-28 15:25 ` Peter Zijlstra
2020-04-28 15:49 ` Josh Poimboeuf
2020-04-28 15:54 ` Josh Poimboeuf
2020-04-28 16:25 ` Sean Christopherson
2020-04-28 16:33 ` Josh Poimboeuf
2020-04-28 18:28 ` Peter Zijlstra
2020-04-28 16:44 ` Peter Zijlstra [this message]
2020-04-28 17:01 ` 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=20200428164444.GD16910@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=alexandre.chartre@oracle.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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