[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:

    .globl    __x86_indirect_thunk_rax
    .hidden    __x86_indirect_thunk_rax
    .type    __x86_indirect_thunk_rax, @function
    call    .LIND1
    jmp    .LIND0
    mov    %rax, (%rsp)

> --- 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



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