Re: [PATCH v4 09/39] x86/vdso: Enable sframe generation in VDSO
On Fri, 24 Jan 2025 08:43:32 -0800 Josh Poimboeuf wrote: > On Fri, Jan 24, 2025 at 05:00:27PM +0100, Jens Remus wrote: > > On 22.01.2025 03:31, Josh Poimboeuf wrote: > > > diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h > > > index b195b3c8677e..1c354f648505 100644 > > > --- a/arch/x86/include/asm/dwarf2.h > > > +++ b/arch/x86/include/asm/dwarf2.h > > > @@ -12,8 +12,11 @@ > > >* For the vDSO, emit both runtime unwind information and debug > > >* symbols for the .dbg file. > > >*/ > > > - > > > > Nit: Deleted blank line you introduced in "[PATCH v4 05/39] x86/asm: > > Avoid emitting DWARF CFI for non-VDSO". > > Indeed. Note, I'm getting ready to send out an update of Josh's patches. This particular nit isn't really an issue, as #ifdef's do sometimes replace blank lines. Just mentioning this so you don't think I'm ignoring it, when I post patches. -- Steve
Re: [PATCH v4 09/39] x86/vdso: Enable sframe generation in VDSO
On Fri, Jan 24, 2025 at 05:30:36PM +0100, Jens Remus wrote: > On 22.01.2025 03:31, Josh Poimboeuf wrote: > > Enable sframe generation in the VDSO library so kernel and user space > > can unwind through it. > > > > Signed-off-by: Josh Poimboeuf > > > diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile > > > @@ -47,13 +47,17 @@ quiet_cmd_vdso2c = VDSO2C $@ > > $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c > > FORCE > > $(call if_changed,vdso2c) > > +#ifdef CONFIG_AS_SFRAME > > +SFRAME_CFLAGS := -Wa$(comma)-gsframe > > +#endif > > + > > You probably erroneously mixed up C preprocessor and Makefile syntax? :-) > > ifeq ($(CONFIG_AS_SFRAME),y) >SFRAME_CFLAGS := -Wa,--gsframe > endif > > $(comma) does not appear to be required in this context. Yeah, before it was in a Makefile macro which needed the $(comma) to distinguish it from the macro arguments. -- Josh
Re: [PATCH v4 09/39] x86/vdso: Enable sframe generation in VDSO
On Fri, Jan 24, 2025 at 08:43:35AM -0800, Josh Poimboeuf wrote: > On Fri, Jan 24, 2025 at 05:00:27PM +0100, Jens Remus wrote: > > On 22.01.2025 03:31, Josh Poimboeuf wrote: > > > +#ifdef __x86_64__ > > > > #if defined(__x86_64__) && defined(CONFIG_AS_SFRAME) > > > > AFAIK the kernel has a minimum binutils requirement of 2.25 [1] > > and assembler option "--gsframe" as well as directive > > ".cfi_sections .sframe" were introduced with 2.40. > > True, I'll change it to just '#ifdef CONFIG_AS_SFRAME' since that's what > really matters (and 32-bit doesn't support it anyway). Actually, just CONFIG_AS_CFAME didn't work as 64-bit still compiles some 32-bit asm files. I'll go with your suggestion. -- Josh
Re: [PATCH v4 09/39] x86/vdso: Enable sframe generation in VDSO
On Fri, Jan 24, 2025 at 05:00:27PM +0100, Jens Remus wrote: > On 22.01.2025 03:31, Josh Poimboeuf wrote: > > diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h > > index b195b3c8677e..1c354f648505 100644 > > --- a/arch/x86/include/asm/dwarf2.h > > +++ b/arch/x86/include/asm/dwarf2.h > > @@ -12,8 +12,11 @@ > > * For the vDSO, emit both runtime unwind information and debug > > * symbols for the .dbg file. > > */ > > - > > Nit: Deleted blank line you introduced in "[PATCH v4 05/39] x86/asm: > Avoid emitting DWARF CFI for non-VDSO". Indeed. > > +#ifdef __x86_64__ > > #if defined(__x86_64__) && defined(CONFIG_AS_SFRAME) > > AFAIK the kernel has a minimum binutils requirement of 2.25 [1] > and assembler option "--gsframe" as well as directive > ".cfi_sections .sframe" were introduced with 2.40. True, I'll change it to just '#ifdef CONFIG_AS_SFRAME' since that's what really matters (and 32-bit doesn't support it anyway). > > + .cfi_sections .eh_frame, .debug_frame, .sframe > > +#else > > .cfi_sections .eh_frame, .debug_frame > > +#endif > > #define CFI_STARTPROC .cfi_startproc > > #define CFI_ENDPROC .cfi_endproc -- Josh
Re: [PATCH v4 09/39] x86/vdso: Enable sframe generation in VDSO
On 22.01.2025 03:31, Josh Poimboeuf wrote: Enable sframe generation in the VDSO library so kernel and user space can unwind through it. Signed-off-by: Josh Poimboeuf diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile @@ -47,13 +47,17 @@ quiet_cmd_vdso2c = VDSO2C $@ $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE $(call if_changed,vdso2c) +#ifdef CONFIG_AS_SFRAME +SFRAME_CFLAGS := -Wa$(comma)-gsframe +#endif + You probably erroneously mixed up C preprocessor and Makefile syntax? :-) ifeq ($(CONFIG_AS_SFRAME),y) SFRAME_CFLAGS := -Wa,--gsframe endif $(comma) does not appear to be required in this context. Regards, Jens -- Jens Remus Linux on Z Development (D3303) +49-7031-16-1128 Office [email protected] IBM IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294 IBM Data Privacy Statement: https://www.ibm.com/privacy/
Re: [PATCH v4 09/39] x86/vdso: Enable sframe generation in VDSO
On 22.01.2025 03:31, Josh Poimboeuf wrote: Enable sframe generation in the VDSO library so kernel and user space can unwind through it. Signed-off-by: Josh Poimboeuf ... diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index b195b3c8677e..1c354f648505 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h @@ -12,8 +12,11 @@ * For the vDSO, emit both runtime unwind information and debug * symbols for the .dbg file. */ - Nit: Deleted blank line you introduced in "[PATCH v4 05/39] x86/asm: Avoid emitting DWARF CFI for non-VDSO". +#ifdef __x86_64__ #if defined(__x86_64__) && defined(CONFIG_AS_SFRAME) AFAIK the kernel has a minimum binutils requirement of 2.25 [1] and assembler option "--gsframe" as well as directive ".cfi_sections .sframe" were introduced with 2.40. + .cfi_sections .eh_frame, .debug_frame, .sframe +#else .cfi_sections .eh_frame, .debug_frame +#endif #define CFI_STARTPROC .cfi_startproc #define CFI_ENDPROC .cfi_endproc [1]: https://docs.kernel.org/process/changes.html Regards, Jens -- Jens Remus Linux on Z Development (D3303) +49-7031-16-1128 Office [email protected] IBM IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294 IBM Data Privacy Statement: https://www.ibm.com/privacy/
