Skip to contentSkip to conversation

linux-next: build failure after merge of the tpmdd tree

DISCUSSION Stephen Rothwell 3 participants 4 messages Apr 16, 2019 – Apr 30, 2019 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Jarkko,

After merging the tpmdd tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

include/linux/tpm_eventlog.h: In function '__calc_tpm2_event_size':
drivers/firmware/efi/tpm.c:7:35: error: implicit declaration of function 'early_memremap'; did you mean 'early_memtest'? [-Werror=implicit-function-declaration]

 #define TPM_MEMREMAP(start, size) early_memremap(start, size)
                                   ^~~~~~~~~~~~~~
include/linux/tpm_eventlog.h:182:13: note: in expansion of macro 'TPM_MEMREMAP'
   mapping = TPM_MEMREMAP((unsigned long)marker_start,
             ^~~~~~~~~~~~
In file included from drivers/firmware/efi/tpm.c:13:
include/linux/tpm_eventlog.h:182:11: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   mapping = TPM_MEMREMAP((unsigned long)marker_start,
           ^
drivers/firmware/efi/tpm.c:8:35: error: implicit declaration of function 'early_memunmap'; did you mean 'early_memtest'? [-Werror=implicit-function-declaration]
 #define TPM_MEMUNMAP(start, size) early_memunmap(start, size)
                                   ^~~~~~~~~~~~~~
include/linux/tpm_eventlog.h:203:4: note: in expansion of macro 'TPM_MEMUNMAP'
    TPM_MEMUNMAP(mapping, mapping_size);
    ^~~~~~~~~~~~

In file included from drivers/firmware/efi/tpm.c:13:
include/linux/tpm_eventlog.h:205:12: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
mapping = TPM_MEMREMAP((unsigned long)marker_start,
^
include/linux/tpm_eventlog.h:225:14: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
mapping = TPM_MEMREMAP((unsigned long)marker_start,
^
include/linux/tpm_eventlog.h:251:11: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
mapping = TPM_MEMREMAP((unsigned long)marker_start,

           ^

In file included from ./arch/arm/include/generated/asm/early_ioremap.h:1,
from drivers/firmware/efi/tpm.c:15:
include/asm-generic/early_ioremap.h: At top level:
include/asm-generic/early_ioremap.h:13:14: error: conflicting types for 'early_memremap'
extern void *early_memremap(resource_size_t phys_addr,

              ^~~~~~~~~~~~~~
drivers/firmware/efi/tpm.c:7:35: note: previous implicit declaration of 'early_memremap' was here
 #define TPM_MEMREMAP(start, size) early_memremap(start, size)
                                   ^~~~~~~~~~~~~~
include/linux/tpm_eventlog.h:182:13: note: in expansion of macro 'TPM_MEMREMAP'
   mapping = TPM_MEMREMAP((unsigned long)marker_start,
             ^~~~~~~~~~~~

In file included from ./arch/arm/include/generated/asm/early_ioremap.h:1,
from drivers/firmware/efi/tpm.c:15:
include/asm-generic/early_ioremap.h:20:13: warning: conflicting types for 'early_memunmap'
extern void early_memunmap(void *addr, unsigned long size);

             ^~~~~~~~~~~~~~
drivers/firmware/efi/tpm.c:8:35: note: previous implicit declaration of 'early_memunmap' was here
 #define TPM_MEMUNMAP(start, size) early_memunmap(start, size)
                                   ^~~~~~~~~~~~~~
include/linux/tpm_eventlog.h:203:4: note: in expansion of macro 'TPM_MEMUNMAP'
    TPM_MEMUNMAP(mapping, mapping_size);
    ^~~~~~~~~~~~

Caused by commit

05165bf3d231 ("tpm: Abstract crypto agile event size calculations")

and maybe

cdb75b359079 ("tpm: Reserve the TPM final events table")

I have used the tmpdd tree from next-20190415 for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 4 lines · Stephen Rothwell

Hi Jarkko,

After merging the tpmdd tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

Matthew, looking at the code I guess the includes are in wrong order i.e. early_ioremap.h should be included before tpm_eventlog.h. Do you agree that this is the correct conclusion? I can do the update.

Just as a temporary measure I removed the commits from my next branch.

/Jarkko

#2 lore raw
Quoted 3 lines · Jarkko Sakkinen

Matthew, looking at the code I guess the includes are in wrong order i.e. early_ioremap.h should be included before tpm_eventlog.h. Do you agree that this is the correct conclusion? I can do the update.

Yes, I believe that that's the correct fix.

#3 lore raw
Quoted 7 lines · Matthew Garrett
Quoted 3 lines · Jarkko Sakkinen

Matthew, looking at the code I guess the includes are in wrong order i.e. early_ioremap.h should be included before tpm_eventlog.h. Do you agree that this is the correct conclusion? I can do the update.

Yes, I believe that that's the correct fix.

I'll hold up until the previous flush of patches is in security/next-general (bug fixes for v5.1 changes).

/Jarkko