All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Joe Perches <joe@perches.com>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, Kan Liang <kan.liang@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kees Cook <keescook@chromium.org>, Shawn Landden <shawn@git.icu>,
	Nathan Chancellor <natechancellor@gmail.com>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Chandler Carruth <chandlerc@google.com>,
	Jann Horn <jannh@google.com>, Bill Wendling <morbo@google.com>,
	Alexander Potapenko <glider@google.com>
Subject: Re: [PATCH] perf/x86/intel: Mark expected switch fall-throughs
Date: Fri, 28 Jun 2019 11:44:16 -0700	[thread overview]
Message-ID: <CAKwvOdkx+=Z5-Ov4CY6y+XhMCNWa35BBFUdQWgP49PBTLr-Erg@mail.gmail.com> (raw)
In-Reply-To: <20190628133105.GD3463@hirez.programming.kicks-ass.net>

On Fri, Jun 28, 2019 at 6:31 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Thu, Jun 27, 2019 at 09:12:50AM +0200, Peter Zijlstra wrote:
>
> > Josh came up with the following:
> >
> > +             /* If the jump target is close, do a 2-byte nop: */
> > +             ".skip -(%l[l_yes] - 1b <= 126), 0x66\n"
> > +             ".skip -(%l[l_yes] - 1b <= 126), 0x90\n"
> > +             /* Otherwise do a 5-byte nop: */
> > +             ".skip -(%l[l_yes] - 1b > 126), 0x0f\n"
> > +             ".skip -(%l[l_yes] - 1b > 126), 0x1f\n"
> > +             ".skip -(%l[l_yes] - 1b > 126), 0x44\n"
> > +             ".skip -(%l[l_yes] - 1b > 126), 0x00\n"
> > +             ".skip -(%l[l_yes] - 1b > 126), 0x00\n"
> >
> > Which is a wonderfully gruesome hack :-) So I'll be playing with that
> > for a bit.
>
> For those with interest; full patches at:
>
>   https://lkml.kernel.org/r/20190628102113.360432762@infradead.org

Do you have a branch pushed that I can pull this from to quickly test w/ Clang?

The .skip trick is wild; I don't quite understand the negation in the
above or patch 8/8 for is_byte/is_long.

Also, the comment on 8/8 about patching early hits home; we had a
sign-extending-booleans bug that was causing the address calculation
to be off by two.  Jann and Bill had to help me debug that one, and
funnily enough Kees fixed it in LLVM.  Fetching exception frames out
of early_idt_handler_common has been my most memorable kernel
debugging experience to date, and hope I don't have to do that ever
again.  Kees this week adjusted where arm64 does static_key enablement
(moved it earlier for Alexander Potapenko's slab
initialization/poisoning set).

For the wrong __jump_table entry; I consider that a critical issue we
need to fix before the clang-9 release.  I'm unloading my current
responsibilities at work to be able to sit and focus on bug.  I'll
probably start a new thread with you, tglx, Josh, and our mailing list
next week (sorry for co-opting this thread).  I have been using
creduce quite successfully for finding and fixing our previous codegen
bugs (https://nickdesaulniers.github.io/blog/2019/01/18/finding-compiler-bugs-with-c-reduce/),
but I need to sit and understand the precise failure more in order to
reduce the input.  We can see pretty well where in the compilation
pipeline things go wrong; I just find it hard to page through large
inputs such as whole translation units.
-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2019-06-28 18:44 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 16:19 [PATCH] perf/x86/intel: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-06-24 19:31 ` Peter Zijlstra
2019-06-24 19:45   ` Joe Perches
2019-06-24 20:37     ` Peter Zijlstra
2019-06-24 20:53       ` Gustavo A. R. Silva
2019-06-24 20:57         ` Joe Perches
2019-06-25  7:20           ` Peter Zijlstra
2019-06-24 22:28         ` Miguel Ojeda
2019-06-25  7:18           ` Peter Zijlstra
2019-06-25 12:47             ` Miguel Ojeda
2019-06-25 18:15               ` Nick Desaulniers
2019-06-25 22:29                 ` Joe Perches
2019-06-25 22:57                   ` Nick Desaulniers
2019-06-25 23:25                     ` Joe Perches
2019-06-26  8:49                 ` Peter Zijlstra
2019-06-26 22:14                   ` Nick Desaulniers
2019-06-27  7:12                     ` Peter Zijlstra
2019-06-28 13:31                       ` Peter Zijlstra
2019-06-28 18:44                         ` Nick Desaulniers [this message]
2019-06-29  7:10                           ` Peter Zijlstra
2019-06-25 17:12             ` Kees Cook
2019-06-25 18:05               ` Nathan Chancellor
2019-06-25 19:53                 ` Thomas Gleixner
2019-06-25 20:27                   ` Nathan Chancellor
2019-06-25 20:37                     ` Nick Desaulniers
2019-06-25 21:47                     ` Thomas Gleixner
2019-06-26  5:10                       ` Nathan Chancellor
2019-06-26 15:18                         ` Thomas Gleixner
2019-06-26 19:00                           ` Nathan Chancellor
2019-06-26 19:46                             ` Thomas Gleixner
2019-06-26 20:03                               ` Nathan Chancellor
2019-06-26  9:24                       ` Peter Zijlstra
2019-06-26  9:55                         ` Peter Zijlstra
2019-06-26 22:23                           ` Nick Desaulniers
2019-06-27  7:35                             ` Peter Zijlstra
2019-06-26 10:43                         ` Peter Zijlstra
2019-06-26 22:15                         ` Nick Desaulniers
2019-06-27  7:16                           ` Peter Zijlstra
2019-06-26 16:30                       ` Peter Zijlstra
2019-06-26 22:33                         ` Nick Desaulniers
2019-06-26 23:11                           ` Thomas Gleixner
2019-06-27  7:11                           ` Peter Zijlstra
2019-06-25 23:46                     ` Arnaldo Carvalho de Melo
2019-06-26  5:14                       ` Nathan Chancellor
2019-06-25 20:09                 ` Kees Cook
2019-06-26  8:06               ` Peter Zijlstra
2019-06-25  7:15         ` Peter Zijlstra
2019-07-25 16:27 ` [tip:perf/urgent] " tip-bot for Gustavo A. R. Silva
2019-07-25 17:06   ` Borislav Petkov
2019-07-25 17:35     ` Peter Zijlstra
2019-07-25 23:18       ` Joe Perches
2019-07-25 23:28         ` Kees Cook

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='CAKwvOdkx+=Z5-Ov4CY6y+XhMCNWa35BBFUdQWgP49PBTLr-Erg@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=chandlerc@google.com \
    --cc=glider@google.com \
    --cc=gustavo@embeddedor.com \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=joe@perches.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=namhyung@kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=peterz@infradead.org \
    --cc=shawn@git.icu \
    --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 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.