Re: [PATCH] x86: introduce push/pop macros which generate CFI_REL_OFFSET and CFI_RESTORE

From: Borislav Petkov
Date: Mon Jan 12 2015 - 14:23:25 EST


On Mon, Jan 12, 2015 at 12:07:35AM +0100, Denys Vlasenko wrote:
> Sequences
> pushl_cfi %reg
> CFI_REL_OFFSET reg, 0
> and
> popl_cfi %reg
> CFI_RESTORE reg
> happen quite often. This patch adds macros which generate them.
>
> No assembly changes (verified with objdump -dr vmlinux.o).

...

> diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h
> index f6f1598..de1cdaf 100644
> --- a/arch/x86/include/asm/dwarf2.h
> +++ b/arch/x86/include/asm/dwarf2.h
> @@ -86,11 +86,23 @@
> CFI_ADJUST_CFA_OFFSET 8
> .endm
>
> + .macro pushq_cfi_reg reg
> + pushq %\reg
> + CFI_ADJUST_CFA_OFFSET 8
> + CFI_REL_OFFSET \reg, 0
> + .endm

What's wrong with adding the CFI_REL_OFFSET to the pushl/popl_cfi macro
and not add two new _reg macros?

I.e., have the _cfi macros add all the CFI annotations needed.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/