All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andi Kleen <ak@linux.intel.com>, Paul Turner <pjt@google.com>,
	Greg Kroah-Hartman <gregkh@linux-foundation.org>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Kees Cook <keescook@google.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Jiri Kosina <jikos@kernel.org>,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH 2/3] objtool: Ignore retpoline alternatives
Date: Fri, 12 Jan 2018 21:36:21 +0100	[thread overview]
Message-ID: <20180112203621.yjoymm3qfmsvpt76@gmail.com> (raw)
In-Reply-To: <20180111175626.GJ6176@hirez.programming.kicks-ass.net>


* Peter Zijlstra <peterz@infradead.org> wrote:

> > But if you're an actual human, the "small numbers as labels" is fine.
> 
> I find descriptive labels much nicer than random numbers, I'll take some
> crazy characters if so required.
> 
> 
> Consider the retpoline thing:
> 
>  call .Lset_up_target
> .Lcapture_spec:
>   pause
>   jmp .Lcapture_spec
> .Lset_up_target:
>   mov %r11, (%rsp);
>   ret;
> 
> 
> over:
> 
>  call 2f
> 1:
>  pause
>  jmp 1b
> 2:
>  mov %r11, (%rsp)
>  ret
> 
> 
> give me the first any day of the week.

Absolutely, in fact I detest what we have:

+#define __FILL_RETURN_BUFFER(reg, nr, sp)      \
+       mov     $(nr/2), reg;                   \
+771:                                           \
+       call    772f;                           \
+773:   /* speculation trap */                  \
+       pause;                                  \
+       jmp     773b;                           \
+772:                                           \
+       call    774f;                           \
+775:   /* speculation trap */                  \
+       pause;                                  \
+       jmp     775b;                           \
+774:                                           \
+       dec     reg;                            \
+       jnz     771b;                           \
+       add     $(BITS_PER_LONG/8) * nr, sp;

I mean, WTF??

Also, note that this:

>  call .Lset_up_target
> .Lcapture_spec:
>   pause
>   jmp .Lcapture_spec
> .Lset_up_target:
>   mov %r11, (%rsp);
>   ret;
> 

becomes even more readable with a bit more human-readability improvements:

	call .L_set_up_target

 .L_capture_spec:
	pause
	jmp .L_capture_spec

 .L_set_up_target:
	mov %r11, (%rsp)
	ret 

I.e. the underscores in the label names, the tabs and the newlines create better 
vertical and horizontal separation between the syntactical elements and provide 
grouping of larger constructs.

Thanks,

	Ingo

  reply	other threads:[~2018-01-12 20:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  1:48 [PATCH 0/3] objtool: retpoline compatibility Josh Poimboeuf
2018-01-11  1:48 ` [PATCH 1/3] objtool: Detect jumps to retpoline thunks Josh Poimboeuf
2018-01-11  1:48 ` [PATCH 2/3] objtool: Ignore retpoline alternatives Josh Poimboeuf
2018-01-11 16:27   ` David Woodhouse
2018-01-11 16:33     ` Josh Poimboeuf
2018-01-11 16:39       ` David Woodhouse
2018-01-11 16:48         ` Josh Poimboeuf
2018-01-11 16:55           ` David Woodhouse
2018-01-11 17:25             ` Josh Poimboeuf
2018-01-11 16:58           ` Peter Zijlstra
2018-01-11 17:05             ` Jiri Kosina
2018-01-11 17:01           ` Jiri Kosina
2018-01-11 17:05             ` Peter Zijlstra
2018-01-11 17:19               ` David Woodhouse
2018-01-11 17:23                 ` Peter Zijlstra
2018-01-11 16:44       ` Peter Zijlstra
2018-01-11 17:29     ` Linus Torvalds
2018-01-11 17:37       ` Josh Poimboeuf
2018-01-11 17:43       ` David Woodhouse
2018-01-11 17:56       ` Peter Zijlstra
2018-01-12 20:36         ` Ingo Molnar [this message]
2018-01-11 17:57       ` David Woodhouse
2018-01-11  1:48 ` [PATCH 3/3] Revert "x86/retpoline: Temporarily disable objtool when CONFIG_RETPOLINE=y" Josh Poimboeuf
2018-01-11 10:22 ` [PATCH 0/3] objtool: retpoline compatibility David Woodhouse

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=20180112203621.yjoymm3qfmsvpt76@gmail.com \
    --to=mingo@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dwmw2@infradead.org \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linux-foundation.org \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    --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.