summaryrefslogtreecommitdiff
path: root/kernel/irq
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-08-21 18:38:50 (GMT)
committerScott Wood <scottwood@freescale.com>2014-05-14 18:38:47 (GMT)
commit23c62705013c96c8a6c78345639a79462cdf2fdb (patch)
treee3107d9e061ff91ddff45c986a04ad3ab26b75bf /kernel/irq
parente8b6fb1229641f26058e37860a7a32fee453b736 (diff)
downloadlinux-fsl-qoriq-23c62705013c96c8a6c78345639a79462cdf2fdb.tar.xz
random: Make it work on rt
Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq descriptor and feed it into the random generator as a source of entropy. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable-rt@vger.kernel.org
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/handle.c8
-rw-r--r--kernel/irq/manage.c6
2 files changed, 13 insertions, 1 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 131ca17..7f50c55 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -132,6 +132,8 @@ static void irq_wake_thread(struct irq_desc *desc, struct irqaction *action)
irqreturn_t
handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
{
+ struct pt_regs *regs = get_irq_regs();
+ u64 ip = regs ? instruction_pointer(regs) : 0;
irqreturn_t retval = IRQ_NONE;
unsigned int flags = 0, irq = desc->irq_data.irq;
@@ -172,7 +174,11 @@ handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
action = action->next;
} while (action);
- add_interrupt_randomness(irq, flags);
+#ifndef CONFIG_PREEMPT_RT_FULL
+ add_interrupt_randomness(irq, flags, ip);
+#else
+ desc->random_ip = ip;
+#endif
if (!noirqdebug)
note_interrupt(irq, desc, retval);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index b1b37ea..252bf10 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -947,6 +947,12 @@ static int irq_thread(void *data)
if (!noirqdebug)
note_interrupt(action->irq, desc, action_ret);
+#ifdef CONFIG_PREEMPT_RT_FULL
+ migrate_disable();
+ add_interrupt_randomness(action->irq, 0,
+ desc->random_ip ^ (unsigned long) action);
+ migrate_enable();
+#endif
wake_threads_waitq(desc);
}