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

Re: [Xen-devel] [PATCH RFC v1 19/74] x86: introduce ELFNOTE macro



>>> On 04.01.18 at 14:05, <wei.liu2@xxxxxxxxxx> wrote:
> It is needed later for introducing PVH entry point.

Perhaps worth moving the addition there, rather than introducing
dead code here?

> --- a/xen/include/asm-x86/asm_defns.h
> +++ b/xen/include/asm-x86/asm_defns.h
> @@ -409,4 +409,16 @@ static always_inline void stac(void)
>  #define REX64_PREFIX "rex64/"
>  #endif
>  
> +#define ELFNOTE(name, type, desc)           \
> +    .pushsection .note.name               ; \

Please also specify section attributes and type.

> +    .align 4                              ; \

I think we should try to avoid the ambiguous .align, and instead
use .balign or .p2align in new code.

> +    .long 2f - 1f       /* namesz */      ; \
> +    .long 4f - 3f       /* descsz */      ; \
> +    .long type          /* type   */      ; \
> +1:.asciz #name          /* name   */      ; \
> +2:.align 4                                ; \
> +3:desc                  /* desc   */      ; \
> +4:.align 4                                ; \

I'd prefer if you used .L-prefixed labels in new macros, to eliminate
the risk of references around the macro use sites becoming broken.
And if you really meant to stick with numeric labels, please add two
padding blanks after each of them, to align the directives.

Considering this is meant to be used by assembly code only, perhaps
it would be better to make this an assembler macro rather than a C
one (eliminating the need for all the "; \")?

Jan


_______________________________________________
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®.