Skip to contentSkip to conversation

efi/tpm: fix section mismatch warning

PATCH In review Arnd Bergmann 5 participants 8 messages Apr 29, 2020 – Apr 30, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi/tpm: fix section mismatch warning

Building with gcc-10 causes a harmless warning about a section mismatch:

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

Add the missing annotation.

Fixes e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")
---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/tpm.c +1 -1
index 31f9f0e369b9..55b031d2c989 100644
@@ -16,7 +16,7 @@
 int efi_tpm_final_log_size;
 EXPORT_SYMBOL(efi_tpm_final_log_size);
 
-static int tpm2_calc_event_log_size(void *data, int count, void *size_info)
+static int __init tpm2_calc_event_log_size(void *data, int count, void *size_info)
 {
 	struct tcg_pcr_event2_head *header;
 	int event_size, size = 0;
Signature · 1 line
2.26.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Arnd Bergmann

Building with gcc-10 causes a harmless warning about a section mismatch:

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

Quoted 7 lines

Add the missing annotation.

Fixes e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")
---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Jason

maintainer
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

Building with gcc-10 causes a harmless warning about a section mismatch:

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

Quoted 4 lines

Add the missing annotation.

Fixes e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")

Thanks, I'll take it as a fix.

Quoted 20 lines
---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/tpm.c +1 -2
index 31f9f0e369b9..55b031d2c989 100644
@@ -16,7 +16,7 @@
 int efi_tpm_final_log_size;
 EXPORT_SYMBOL(efi_tpm_final_log_size);
 
-static int tpm2_calc_event_log_size(void *data, int count, void *size_info)
+static int __init tpm2_calc_event_log_size(void *data, int count, void *size_info)
 {
        struct tcg_pcr_event2_head *header;
        int event_size, size = 0;
--

2.26.0

Acked-by on v1 1/1
#3 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

Building with gcc-10 causes a harmless warning about a section mismatch:

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

Quoted 4 lines

Add the missing annotation.

Fixes e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")

/Jarkko

#4 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

Building with gcc-10 causes a harmless warning about a section mismatch:

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

Quoted 4 lines

Add the missing annotation.

Fixes e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")

Minor thing, but should the Fixes be c46f3405692d ("tpm: Reserve the TPM final events table")? Or what am I missing about e658c82be556 that causes this? Just trying to understand what I did. :)

Regards,
Jerry

Quoted 20 lines

---
drivers/firmware/efi/tpm.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/tpm.c +1 -1
index 31f9f0e369b9..55b031d2c989 100644
@@ -16,7 +16,7 @@
 int efi_tpm_final_log_size;
 EXPORT_SYMBOL(efi_tpm_final_log_size);
 
-static int tpm2_calc_event_log_size(void *data, int count, void *size_info)
+static int __init tpm2_calc_event_log_size(void *data, int count, void *size_info)
 {
 	struct tcg_pcr_event2_head *header;
 	int event_size, size = 0;
Signature · 1 line
2.26.0
#5 lore raw
Quoted 10 lines · Jerry Snitselaar
Quoted 8 lines · Arnd Bergmann

Building with gcc-10 causes a harmless warning about a section mismatch:

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

Quoted 7 lines
Quoted 4 lines

Add the missing annotation.

Fixes e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")

Minor thing, but should the Fixes be c46f3405692d ("tpm: Reserve the TPM final events table")? Or what am I missing about e658c82be556 that causes this? Just trying to understand what I did. :)

You are right, I misread the git history. Can you fix it up when applying the patch, or should I resend it?

Arnd

maintainer
#6 lore raw
Quoted 14 lines · Arnd Bergmann
Quoted 12 lines · Jerry Snitselaar
Quoted 10 lines · Arnd Bergmann

Building with gcc-10 causes a harmless warning about a section mismatch:

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

Add the missing annotation.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Fixes e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")

Minor thing, but should the Fixes be c46f3405692d ("tpm: Reserve the TPM final events table")? Or what am I missing about e658c82be556 that causes this? Just trying to understand what I did. :)

You are right, I misread the git history. Can you fix it up when applying the patch, or should I resend it?

I can fix it up, no worries.

Reviewed-by
#7 lore raw
Quoted 18 lines · Ard Biesheuvel
Quoted 17 lines · Arnd Bergmann
Quoted 15 lines · Jerry Snitselaar
Quoted 12 lines · Arnd Bergmann

Building with gcc-10 causes a harmless warning about a section mismatch:

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

Add the missing annotation.

Fixes e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Minor thing, but should the Fixes be c46f3405692d ("tpm: Reserve the TPM final events table")? Or what am I missing about e658c82be556 that causes this? Just trying to understand what I did. :)

You are right, I misread the git history. Can you fix it up when applying the patch, or should I resend it?

I can fix it up, no worries.

With the fix applied: