[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86: add .size directive to indirect thunk generation macro



On 23/02/18 10:24, Jan Beulich wrote:
> Not adding .type, as these are neither functions nor objects.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

@function is for executable code in general.  It is not restricted to
C's idea of function.

This is how GCC writes a repoline thunk:

    .section   
.text.__x86_indirect_thunk_rax,"axG",@progbits,__x86_indirect_thunk_rax,comdat
    .globl    __x86_indirect_thunk_rax
    .hidden    __x86_indirect_thunk_rax
    .type    __x86_indirect_thunk_rax, @function
__x86_indirect_thunk_rax:
.LFB1:
    .cfi_startproc
    call    .LIND1
.LIND0:
    lfence
    jmp    .LIND0
.LIND1:
    mov    %rax, (%rsp)
    ret
    .cfi_endproc


>
> --- a/xen/arch/x86/indirect-thunk.S
> +++ b/xen/arch/x86/indirect-thunk.S
> @@ -41,6 +41,7 @@ ENTRY(__x86_indirect_thunk_\reg)
>          ALTERNATIVE_2 __stringify(IND_THUNK_RETPOLINE \reg),              \
>          __stringify(IND_THUNK_LFENCE \reg), X86_FEATURE_IND_THUNK_LFENCE, \
>          __stringify(IND_THUNK_JMP \reg),    X86_FEATURE_IND_THUNK_JMP

Newline please.

> +        .size __x86_indirect_thunk_\reg, . - __x86_indirect_thunk_\reg

Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, ideally with a
.type as well.

>  .endm
>  
>  /* Instantiate GEN_INDIRECT_THUNK for each register except %rsp. */
>
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.