On Fri, Jul 17, 2015 at 02:01:33PM -0700, Andy Lutomirski wrote:
> On Fri, Jul 17, 2015 at 1:59 PM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> > On Fri, Jul 17, 2015 at 01:46:39PM -0700, Andy Lutomirski wrote:
> >> On Fri, Jul 17, 2015 at 1:44 PM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >> > On Fri, Jul 17, 2015 at 01:39:09PM -0700, Andy Lutomirski wrote:
> >> >> On Fri, Jul 17, 2015 at 1:37 PM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >> >> > On Fri, Jul 17, 2015 at 12:44:42PM -0700, Andy Lutomirski wrote:
> >> >> >> On Fri, Jul 17, 2015 at 12:43 PM, Ingo Molnar <mingo@kernel.org> wrote:
> >> >> >> >
> >> >> >> > * Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >> >> >> >
> >> >> >> >> ENTRY(aesni_set_key)
> >> >> >> >> + FRAME
> >> >> >> >> #ifndef __x86_64__
> >> >> >> >> pushl KEYP
> >> >> >> >> movl 8(%esp), KEYP # ctx
> >> >> >> >> @@ -1905,6 +1907,7 @@ ENTRY(aesni_set_key)
> >> >> >> >> #ifndef __x86_64__
> >> >> >> >> popl KEYP
> >> >> >> >> #endif
> >> >> >> >> + ENDFRAME
> >> >> >> >> ret
> >> >> >> >> ENDPROC(aesni_set_key)
> >> >> >> >
> >> >> >> > So cannot we make this a bit more compact and less fragile?
> >> >> >> >
> >> >> >> > Instead of:
> >> >> >> >
> >> >> >> > ENTRY(aesni_set_key)
> >> >> >> > FRAME
> >> >> >> > ...
> >> >> >> > ENDFRAME
> >> >> >> > ret
> >> >> >> > ENDPROC(aesni_set_key)
> >> >> >> >
> >> >> >> >
> >> >> >> > How about writing this as:
> >> >> >> >
> >> >> >> > FUNCTION_ENTRY(aesni_set_key)
> >> >> >> > ...
> >> >> >> > FUNCTION_RETURN(aesni_set_key)
> >> >> >> >
> >> >> >> > which does the same thing in a short, symmetric construct?
> >> >> >> >
> >> >> >> > One potential problem with this approach would be that what 'looks' like an entry
> >> >> >> > declaration, but it will now generate real code.
> >> >> >> >
> >> >> >> > OTOH if people find this intuitive enough then it's a lot harder to mess it up,
> >> >> >> > and I think 'RETURN' makes it clear enough that there's a real instruction
> >> >> >> > generated there.
> >> >> >> >
> >> >> >>
> >> >> >> How about FUNCTION_PROLOGUE and FUNCTION_EPILOGUE?
> >> >> >
> >> >> > Perhaps the macro name should describe what the epilogue does, since
> >> >> > frame pointers aren't required for _all_ functions, only those which
> >> >> > don't have call instructions.
> >> >> >
> >> >> > What do you think about ENTRY_FRAME and ENDPROC_FRAME_RETURN? The
> >> >> > ending macro is kind of long, but at least it a) matches the existing
> >> >> > ENTRY/ENDPROC convention for asm functions; b) gives a clue that frame
> >> >> > pointers are involved; and c) lets you know that the return is there.
> >> >> >
> >> >>
> >> >> This really is about frame pointers, right? How about
> >> >> ENTRY_FRAMEPTR_xyz where xyz can be prologue, epilogue, return,
> >> >> whatever?
> >> >
> >> > Wouldn't the "ENTRY" in ENTRY_FRAMEPTR_RETURN be confusing at the end of
> >> > a function?
> >>
> >> I meant ENTRY_FRAMEPTR_xyz and the beginning and ENDPROC_FRAMEPTR_xyz
> >> (ENTRY is debatable, but that's what we currently have). ENDPROC
> >> could easily be replaced with anything else.
> >
> > So do you mean ENTRY_FRAMEPTR_PROLOGUE and ENDPROC_FRAMEPTR_EPILOGUE?
> > Or something else?
> >
>
> I like it. I think this bikeshed might be well painted now!
Actually I'm not done painting. Personally it seems a little too
verbose. I still like ENTRY_FRAME and ENDPROC_FRAME_RETURN :p
--
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
> On Fri, Jul 17, 2015 at 1:59 PM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> > On Fri, Jul 17, 2015 at 01:46:39PM -0700, Andy Lutomirski wrote:
> >> On Fri, Jul 17, 2015 at 1:44 PM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >> > On Fri, Jul 17, 2015 at 01:39:09PM -0700, Andy Lutomirski wrote:
> >> >> On Fri, Jul 17, 2015 at 1:37 PM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >> >> > On Fri, Jul 17, 2015 at 12:44:42PM -0700, Andy Lutomirski wrote:
> >> >> >> On Fri, Jul 17, 2015 at 12:43 PM, Ingo Molnar <mingo@kernel.org> wrote:
> >> >> >> >
> >> >> >> > * Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >> >> >> >
> >> >> >> >> ENTRY(aesni_set_key)
> >> >> >> >> + FRAME
> >> >> >> >> #ifndef __x86_64__
> >> >> >> >> pushl KEYP
> >> >> >> >> movl 8(%esp), KEYP # ctx
> >> >> >> >> @@ -1905,6 +1907,7 @@ ENTRY(aesni_set_key)
> >> >> >> >> #ifndef __x86_64__
> >> >> >> >> popl KEYP
> >> >> >> >> #endif
> >> >> >> >> + ENDFRAME
> >> >> >> >> ret
> >> >> >> >> ENDPROC(aesni_set_key)
> >> >> >> >
> >> >> >> > So cannot we make this a bit more compact and less fragile?
> >> >> >> >
> >> >> >> > Instead of:
> >> >> >> >
> >> >> >> > ENTRY(aesni_set_key)
> >> >> >> > FRAME
> >> >> >> > ...
> >> >> >> > ENDFRAME
> >> >> >> > ret
> >> >> >> > ENDPROC(aesni_set_key)
> >> >> >> >
> >> >> >> >
> >> >> >> > How about writing this as:
> >> >> >> >
> >> >> >> > FUNCTION_ENTRY(aesni_set_key)
> >> >> >> > ...
> >> >> >> > FUNCTION_RETURN(aesni_set_key)
> >> >> >> >
> >> >> >> > which does the same thing in a short, symmetric construct?
> >> >> >> >
> >> >> >> > One potential problem with this approach would be that what 'looks' like an entry
> >> >> >> > declaration, but it will now generate real code.
> >> >> >> >
> >> >> >> > OTOH if people find this intuitive enough then it's a lot harder to mess it up,
> >> >> >> > and I think 'RETURN' makes it clear enough that there's a real instruction
> >> >> >> > generated there.
> >> >> >> >
> >> >> >>
> >> >> >> How about FUNCTION_PROLOGUE and FUNCTION_EPILOGUE?
> >> >> >
> >> >> > Perhaps the macro name should describe what the epilogue does, since
> >> >> > frame pointers aren't required for _all_ functions, only those which
> >> >> > don't have call instructions.
> >> >> >
> >> >> > What do you think about ENTRY_FRAME and ENDPROC_FRAME_RETURN? The
> >> >> > ending macro is kind of long, but at least it a) matches the existing
> >> >> > ENTRY/ENDPROC convention for asm functions; b) gives a clue that frame
> >> >> > pointers are involved; and c) lets you know that the return is there.
> >> >> >
> >> >>
> >> >> This really is about frame pointers, right? How about
> >> >> ENTRY_FRAMEPTR_xyz where xyz can be prologue, epilogue, return,
> >> >> whatever?
> >> >
> >> > Wouldn't the "ENTRY" in ENTRY_FRAMEPTR_RETURN be confusing at the end of
> >> > a function?
> >>
> >> I meant ENTRY_FRAMEPTR_xyz and the beginning and ENDPROC_FRAMEPTR_xyz
> >> (ENTRY is debatable, but that's what we currently have). ENDPROC
> >> could easily be replaced with anything else.
> >
> > So do you mean ENTRY_FRAMEPTR_PROLOGUE and ENDPROC_FRAMEPTR_EPILOGUE?
> > Or something else?
> >
>
> I like it. I think this bikeshed might be well painted now!
Actually I'm not done painting. Personally it seems a little too
verbose. I still like ENTRY_FRAME and ENDPROC_FRAME_RETURN :p
--
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/