From 56713fd74e07f55635bae1a7e186cf5485e7daf5 Mon Sep 17 00:00:00 2001 From: Stephan Mueller Date: Mon, 2 May 2016 02:14:34 -0400 Subject: [PATCH] random: add interrupt callback to VMBus IRQ handler commit 4b44f2d18a330565227a7348844493c59366171e upstream. The Hyper-V Linux Integration Services use the VMBus implementation for communication with the Hypervisor. VMBus registers its own interrupt handler that completely bypasses the common Linux interrupt handling. This implies that the interrupt entropy collector is not triggered. This patch adds the interrupt entropy collection callback into the VMBus interrupt handler function. Signed-off-by: Stephan Mueller Signed-off-by: Stephan Mueller Signed-off-by: Theodore Ts'o [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- drivers/char/random.c | 1 + drivers/hv/vmbus_drv.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/char/random.c b/drivers/char/random.c index 645d356545d13..692482b7c2fbc 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -956,6 +956,7 @@ static void _xfer_secondary_pool(struct entropy_store *r, size_t nbytes) mix_pool_bytes(r, tmp, bytes, NULL); credit_entropy_bits(r, bytes*8); } +EXPORT_SYMBOL_GPL(add_interrupt_randomness); /* * Used as a workqueue function so that when the input pool is getting diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 233da0b9f4b9a..1f2fff71dbe31 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -795,6 +796,8 @@ int __vmbus_driver_register(struct hv_driver *hv_driver, struct module *owner, c EXPORT_SYMBOL_GPL(__vmbus_driver_register); /** + + add_interrupt_randomness(HYPERVISOR_CALLBACK_VECTOR, 0); * vmbus_driver_unregister() - Unregister a vmbus's driver * @drv: Pointer to driver structure you want to un-register * -- 2.47.3