alistair23-linux/drivers/char
Roberto Sassu bcfff8384f tpm: dynamically allocate the allocated_banks array
This patch renames active_banks (member of tpm_chip) to allocated_banks,
stores the number of allocated PCR banks in nr_allocated_banks (new member
of tpm_chip), and replaces the static array with a pointer to a dynamically
allocated array.

tpm2_get_pcr_allocation() determines if a PCR bank is allocated by checking
the mask in the TPML_PCR_SELECTION structure returned by the TPM for
TPM2_Get_Capability(). If a bank is not allocated, the TPM returns that
bank in TPML_PCR_SELECTION, with all bits in the mask set to zero. In this
case, the bank is not included in chip->allocated_banks, to avoid that TPM
driver users unnecessarily calculate a digest for that bank.

One PCR bank with algorithm set to SHA1 is always allocated for TPM 1.x.

As a consequence of the introduction of nr_allocated_banks,
tpm_pcr_extend() does not check anymore if the algorithm stored in tpm_chip
is equal to zero.

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
2019-02-13 09:48:50 +02:00
..
agp mm: convert totalram_pages and totalhigh_pages variables to atomic 2018-12-28 12:11:47 -08:00
hw_random hwrng: bcm2835 - Switch to SPDX identifier 2018-11-16 14:11:04 +08:00
ipmi drivers/ipmi: Replace synchronize_sched() with synchronize_rcu() 2018-11-27 09:21:36 -08:00
mwave
pcmcia Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
tpm tpm: dynamically allocate the allocated_banks array 2019-02-13 09:48:50 +02:00
xilinx_hwicap
xillybus
adi.c
apm-emulation.c
applicom.c
applicom.h
bsr.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
generic_nvram.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
hangcheck-timer.c
hpet.c hpet: remove redundant pointer hpet 2018-07-03 13:01:57 +02:00
Kconfig ttyprintk: make the printk log level configurable 2018-11-09 08:58:18 -08:00
lp.c char: lp: use new parport device model 2018-12-19 10:40:17 +01:00
Makefile
mbcs.c
mbcs.h
mem.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
misc.c
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c
ps3flash.c
random.c crypto: chacha20-generic - refactor to allow varying number of rounds 2018-11-20 14:26:55 +08:00
raw.c
rtc.c RTC for 4.21 2019-01-01 13:24:31 -08:00
scx200_gpio.c
snsc.c
snsc.h
snsc_event.c
sonypi.c
tb0219.c
tlclk.c tlclk: clean an indentation issue, remove extraneous tabs 2018-11-11 12:58:27 -08:00
toshiba.c
ttyprintk.c ttyprintk: make the printk log level configurable 2018-11-09 08:58:18 -08:00
uv_mmtimer.c
virtio_console.c char: virtio: Change to use DEFINE_SHOW_ATTRIBUTE macro 2018-12-06 15:42:18 +01:00