]> git.baikalelectronics.ru Git - kernel.git/commit
tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH
authorHuacai Chen <chenhuacai@loongson.cn>
Mon, 11 Jul 2022 01:17:38 +0000 (09:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:18:11 +0000 (11:18 +0200)
commitb95992342afa74c80e85ad303577d8aded6a9647
treea192dcc29703e30835cff7c7c12b67752b602a5d
parentb316aab7e12e4bfb6a7aa31c162b24a07bc2717d
tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH

commit 00c3ae02cde100ef1284de7f28338cf9029cda8e upstream.

If DEBUG_SECTION_MISMATCH enabled, __calc_tpm2_event_size() will not be
inlined, this cause section mismatch like this:

WARNING: modpost: vmlinux.o(.text.unlikely+0xe30c): Section mismatch in reference from the variable L0 to the function .init.text:early_ioremap()
The function L0() references
the function __init early_memremap().
This is often because L0 lacks a __init
annotation or the annotation of early_ioremap is wrong.

Fix it by using __always_inline instead of inline for the called-once
function __calc_tpm2_event_size().

Fixes: e1322134f1f2 ("tpm: Abstract crypto agile event size calculations")
Cc: stable@vger.kernel.org # v5.3
Reported-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/tpm_eventlog.h