linux/drivers
Jonathan McDowell 668f953bb4 tpm: Lazily flush auth session when getting random data
Lazy flushing of TPM auth sessions was introduced to speed up IMA
measurments into the TPM. Make use of it in tpm2_get_random as well,
which has the added benefit of not needlessly cleaning up the session
that IMA is using when there are no userspace accesses taking place.

Command trace before for every call:

hwrng (0x00000161): 14 (52965242 ns)
hwrng (0x00000176): 48 (161612432 ns)
hwrng (0x00000165): 10 (2410494 ns)
hwrng (0x0000017B): 117 (70699883 ns)
hwrng (0x0000017B): 117 (70959666 ns)
hwrng (0x00000165): 10 (2756827 ns)

After, with repeated calls showing no setup:

hwrng (0x00000161): 14 (53044582 ns)
hwrng (0x00000176): 48 (160491333 ns)
hwrng (0x00000165): 10 (2408220 ns)
hwrng (0x0000017B): 117 (70695037 ns)
hwrng (0x0000017B): 117 (70994984 ns)
hwrng (0x0000017B): 117 (70195388 ns)
hwrng (0x0000017B): 117 (70973835 ns)

Signed-off-by: Jonathan McDowell <noodles@meta.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2025-03-27 15:34:04 +02:00
..
accel A sched fence reference leak fix, two fence fixes for v3d, two overflow 2025-03-21 10:41:51 +10:00
accessibility
acpi Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
amba iommu: Get DT/ACPI parsing into the proper probe path 2025-03-11 14:05:43 +01:00
android
ata ata changes for 6.15 2025-03-26 19:49:02 -07:00
atm
auxdisplay auxdisplay: hd44780: Rename hd to hdc in hd44780_common_alloc() 2025-03-10 18:03:02 +02:00
base IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
bcma
block for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
bluetooth Bluetooth: btnxpuart: Fix kernel panic during FW release 2025-03-25 15:22:17 -04:00
bus Merge branches 'apple/dart', 'arm/smmu/updates', 'arm/smmu/bindings', 'rockchip', 's390', 'core', 'intel/vt-d' and 'amd/amd-vi' into next 2025-03-20 09:11:09 +01:00
cache
cdrom
cdx Merge branches 'apple/dart', 'arm/smmu/updates', 'arm/smmu/bindings', 'rockchip', 's390', 'core', 'intel/vt-d' and 'amd/amd-vi' into next 2025-03-20 09:11:09 +01:00
char tpm: Lazily flush auth session when getting random data 2025-03-27 15:34:04 +02:00
clk Samsung clock controller fixes for v6.14 2025-03-11 10:51:13 -07:00
clocksource Updates for clocksource/event drivers: 2025-03-26 13:30:27 -07:00
comedi
connector
counter
cpufreq Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
cpuidle pmdomain core: 2025-03-25 20:40:51 -07:00
crypto CRC updates for 6.15 2025-03-25 18:33:04 -07:00
cxl
dax
dca
devfreq
dio
dma dmaengine fixes for v6.14 2025-03-02 10:08:45 -08:00
dma-buf
dpll Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-03-20 21:38:01 +01:00
edac - Add infrastructure support to EDAC in order to be able to register memory 2025-03-25 14:00:26 -07:00
eisa
extcon
firewire
firmware sound updates for 6.15-rc1 2025-03-26 09:41:55 -07:00
fpga
fsi
gnss
gpio Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
gpu A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
greybus
hid Merge branch 'for-6.15/wacom' into for-linus 2025-03-26 13:56:38 +01:00
hsi
hte
hv hyperv-next for 6.15 2025-03-25 14:47:04 -07:00
hwmon platform-drivers-x86 for v6.15-1 2025-03-26 09:54:40 -07:00
hwspinlock
hwtracing ARM: 2025-03-25 14:22:07 -07:00
i2c A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
i3c
idle Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
iio regulator: Updates for v6.15 2025-03-25 19:04:20 -07:00
infiniband Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
input Input updates for v6.14-rc6 2025-03-15 15:46:29 -10:00
interconnect
iommu IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
ipack
irqchip IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
isdn
leds gpio updates for v6.15-rc1 2025-03-25 20:05:43 -07:00
macintosh
mailbox
mcb
md for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
media [GIT PULL for v6.15] media updates 2025-03-25 21:00:31 -07:00
memory memory: omap-gpmc: drop no compatible check 2025-03-14 17:59:17 +01:00
memstick for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
message SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
mfd
misc A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
mmc for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
most
mtd for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
mux
net Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
nfc
ntb A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
nubus
nvdimm badblocks: use sector_t instead of int to avoid truncation of badblocks length 2025-03-06 08:04:52 -07:00
nvme for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
nvmem net, treewide: define and use MAC_ADDR_STR_LEN 2025-03-19 19:17:58 +01:00
of Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
opp
parisc
parport
pci IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
pcmcia
peci
perf lsm/stable-6.15 PR 20250323 2025-03-25 15:44:19 -07:00
phy Linux 6.14-rc5 2025-03-03 09:32:11 +01:00
pinctrl pinctrl: spacemit: PINCTRL_SPACEMIT_K1 should not default to y unconditionally 2025-03-18 14:11:46 +01:00
platform platform-drivers-x86 for v6.15-1 2025-03-26 09:54:40 -07:00
pmdomain pmdomain: arm: scmi_pm_domain: Remove redundant state verification 2025-03-17 11:12:01 +01:00
pnp PNP: Remove prehistoric deadcode 2025-03-12 20:37:56 +01:00
power A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
powercap Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
pps
ps3
ptp ptp: ocp: reject unsupported periodic output flags 2025-03-20 08:50:03 +01:00
pwm pwm: stmpe: Allow to compile as a module 2025-03-03 10:38:54 +01:00
rapidio rapidio: add check for rio_add_net() in rio_scan_alloc_net() 2025-03-05 21:36:19 -08:00
ras
regulator regulator: Updates for v6.15 2025-03-25 19:04:20 -07:00
remoteproc
reset reset: mchp: sparx5: Fix for lan966x 2025-03-13 09:40:26 +01:00
rpmsg
rtc
s390 Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
sbus
scsi SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
sh
siox
slimbus
soc Updates for MSI interrupts 2025-03-25 09:15:17 -07:00
soundwire
spi spi: Updates for v6.15 2025-03-25 19:28:14 -07:00
spmi
ssb
staging [GIT PULL for v6.15] media updates 2025-03-25 21:00:31 -07:00
target SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
tc
tee
thermal Thermal control updates for 6.15-rc1 2025-03-25 15:13:31 -07:00
thunderbolt CRC updates for 6.15 2025-03-25 18:33:04 -07:00
tty
ufs SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
uio
usb SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
vdpa
vfio
vhost vhost: return task creation error instead of NULL 2025-03-01 02:52:52 -05:00
video fbdev: hyperv_fb: Allow graceful removal of framebuffer 2025-03-09 23:56:29 +00:00
virt Linux 6.14-rc7 2025-03-19 11:03:06 +01:00
virtio
w1
watchdog
xen xen/pci: Do not register devices with segments >= 0x10000 2025-03-21 08:15:26 +01:00
zorro
Kconfig
Makefile