OSDN Git Service

tpm: use GFP_KERNEL instead of GFP_HIGHMEM for tpm_buf
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 11 Oct 2019 16:02:59 +0000 (09:02 -0700)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 12 Nov 2019 19:45:37 +0000 (21:45 +0200)
commit44abdb377b7c399dfec48de7252c564bdde8d26e
tree11b24209034b5dc69aeeab8227a4c63bb5f5f504
parentf1689114acc5e89a196fec6d732dae3e48edb6ad
tpm: use GFP_KERNEL instead of GFP_HIGHMEM for tpm_buf

The current code uses GFP_HIGHMEM, which is wrong because GFP_HIGHMEM
(on 32 bit systems) is memory ordinarily inaccessible to the kernel
and should only be used for allocations affecting userspace.  In order
to make highmem visible to the kernel on 32 bit it has to be kmapped,
which consumes valuable entries in the kmap region.  Since the tpm_buf
is only ever used in the kernel, switch to using a GFP_KERNEL
allocation so as not to waste kmap space on 32 bits.

Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm.h