[PATCH v3 6/8] arm64/module, sframe: Add sframe support for modules.

Jens Remus jremus at linux.ibm.com
Mon Apr 20 02:54:57 PDT 2026


On 4/6/2026 8:49 PM, Dylan Hatch wrote:
> Add sframe table to mod_arch_specific and support sframe PC lookups when
> an .sframe section can be found on incoming modules.
> 
> Signed-off-by: Dylan Hatch <dylanbhatch at google.com>
> Signed-off-by: Weinan Liu <wnliu at google.com>

> diff --git a/kernel/unwind/sframe.c b/kernel/unwind/sframe.c

> +void sframe_module_init(struct module *mod, void *sframe, size_t sframe_size,
> +			void *text, size_t text_size)
> +{
> +	struct sframe_section sec;
> +

I think sec should better be explicitly zero-initialized, as it is done
in sframe_add_section() for user space.  IIUC likewise is not needed in
init_sframe_table() for the kernel vmlinux, as static variables are
zero-initialized.

	memset(&sec, 0, sizeof(sec));

> +	sec.sec_type	 = SFRAME_KERNEL;
> +	sec.sframe_start = (unsigned long)sframe;
> +	sec.sframe_end   = (unsigned long)sframe + sframe_size;
> +	sec.text_start   = (unsigned long)text;
> +	sec.text_end     = (unsigned long)text + text_size;
> +
> +	if (WARN_ON(sframe_read_header(&sec)))
> +		return;
> +
> +	mod->arch.sframe_sec = sec;
> +	mod->arch.sframe_init = true;
> +}
Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
jremus at de.ibm.com / jremus at linux.ibm.com

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/




More information about the linux-arm-kernel mailing list