Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1732511

Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more clear and consistent

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more clear and consistent
Date 2017-09-14 20:50 +0200
Message-ID <upHn4-e8-23@gated-at.bofh.it> (permalink)
References (5 earlier) <upDCO-6hR-9@gated-at.bofh.it> <upFXY-7Vl-13@gated-at.bofh.it> <upG7E-7Yy-9@gated-at.bofh.it> <upGhk-81E-9@gated-at.bofh.it> <upH3H-7A-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 14, 2017 at 11:28:30AM -0700, Linus Torvalds wrote:
> On Thu, Sep 14, 2017 at 10:33 AM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >>
> >>  a) uglifying the 15 or so relevant inline asm locations with ifdefs; or
> >
> > Actually I guess we could put the "sp" in a macro...  I'll try it.
> 
> Exactly. Do something like
> 
>    #ifdef CONFIG_FRAME_POINTER
>    # define EXTRA_ASM_CLOBBERS "rsp"
>    #else
>    # define EXTRA_ASM_CLOBBERS
>    #endif
> 
> and then replace the nasty
> 
>         register void *__sp asm(_ASM_SP);
>         ..
>         "+r" (__sp)
> 
> games with just that EXTRA_ASM_CLOBBERS thing at the end of the clobbers.
> 
> Yes, you'd probably have to document that the alternative_call_2()
> thing doesn't take a "input" argument, but a input_and_clobbers, but
> all users do that anyway.
> 
> I dunno.

There's also alternative_call(), which doesn't yet have the '__rsp'
annotation, but it probably should.  It has some callers which pass
clobbers and some which don't, so its conversion would be trickier.

So my plan is to keep patch 3 of this series, which clarifies those
alternative macro interfaces, and also separates the inputs from the
clobbers.  That'll make it really easy to add something like
EXTRA_ASM_CLOBBERS above.

In fact I'll probably keep patches 1-3, because they're all
improvements.  Then I'll replace the original patch 4 (ASM_CALL) with
the "sp" clobbers thing.

-- 
Josh

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more  clear and consistent Josh Poimboeuf <jpoimboe@redhat.com> - 2017-09-14 16:50 +0200
  Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more  clear and consistent Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-14 19:20 +0200
    Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more  clear and consistent Josh Poimboeuf <jpoimboe@redhat.com> - 2017-09-14 19:30 +0200
      Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more  clear and consistent Josh Poimboeuf <jpoimboe@redhat.com> - 2017-09-14 19:40 +0200
        Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more  clear and consistent Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-14 20:30 +0200
          Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more  clear and consistent Josh Poimboeuf <jpoimboe@redhat.com> - 2017-09-14 20:50 +0200
            Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more  clear and consistent Josh Poimboeuf <jpoimboe@redhat.com> - 2017-09-15 18:20 +0200

csiph-web