Re: [PATCH -next] efi/tpm: fix a compilation warning

From: Arnd Bergmann
Date: Thu Jun 13 2019 - 11:27:09 EST


On Thu, Jun 13, 2019 at 1:41 PM Bartosz Szczepanek <bsz@xxxxxxxxxxxx> wrote:
>
> On Thu, Jun 13, 2019 at 10:55 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> >
> > - efi.tpm_final_log is a physical address that gets passed into
> > memremap() to return a pointer
> > - tpm2_calc_event_log_size() takes a pointer argument and
> > dereferences it.
>
> Where does it? It's passed with some added offset to
> __calc_tpm2_event_size, which does the remapping part. That's why
> physical address is used here.

Ah, right. I was confused by how __calc_tpm2_event_size()
may or may not do the mapping again based on the 'bool do_mapping'
argument, which is 'true' here.

Would it be correct to change that to 'false' then (or completely remove
the additional remap, given that the other two callers pass false
already) and pass final_tbl?

Arnd