lkml.org 
[lkml]   [2018]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] objtool: Ignore retpoline alternatives

* 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

\
 
 \ /
  Last update: 2018-01-14 23:26    [W:0.060 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site