From: Greg Kroah-Hartman Date: Wed, 5 Jun 2013 04:47:21 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.81~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de1d45eaf0e185a27f5df2e41b03d72fdab3b253;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: xen-events-handle-virq_timer-before-any-other-hardirq-in-event-loop.patch --- diff --git a/queue-3.0/series b/queue-3.0/series index 7582d646236..35f2002576a 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -25,3 +25,4 @@ drm-radeon-fix-card_posted-check-for-newer-asics.patch cifs-fix-potential-buffer-overrun-when-composing-a-new-options-string.patch usb-io_ti-fix-null-dereference-in-chase_port.patch libata-make-ata_exec_internal_sg-honor-dmadir.patch +xen-events-handle-virq_timer-before-any-other-hardirq-in-event-loop.patch diff --git a/queue-3.0/xen-events-handle-virq_timer-before-any-other-hardirq-in-event-loop.patch b/queue-3.0/xen-events-handle-virq_timer-before-any-other-hardirq-in-event-loop.patch new file mode 100644 index 00000000000..0a8899c2145 --- /dev/null +++ b/queue-3.0/xen-events-handle-virq_timer-before-any-other-hardirq-in-event-loop.patch @@ -0,0 +1,82 @@ +From bee980d9e9642e96351fa3ca9077b853ecf62f57 Mon Sep 17 00:00:00 2001 +From: Keir Fraser +Date: Thu, 28 Mar 2013 10:03:36 -0400 +Subject: xen/events: Handle VIRQ_TIMER before any other hardirq in event loop. + +From: Keir Fraser + +commit bee980d9e9642e96351fa3ca9077b853ecf62f57 upstream. + +This avoids any other hardirq handler seeing a very stale jiffies +value immediately after wakeup from a long idle period. The one +observable symptom of this was a USB keyboard, with software keyboard +repeat, which would always repeat a key immediately that it was +pressed. This is due to the key press waking the guest, the key +handler immediately runs, sees an old jiffies value, and then that +jiffies value significantly updated, before the key is unpressed. + +Reviewed-by: David Vrabel +Signed-off-by: Keir Fraser +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/xen/events.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +--- a/drivers/xen/events.c ++++ b/drivers/xen/events.c +@@ -1153,7 +1153,7 @@ static void __xen_evtchn_do_upcall(void) + { + int start_word_idx, start_bit_idx; + int word_idx, bit_idx; +- int i; ++ int i, irq; + int cpu = get_cpu(); + struct shared_info *s = HYPERVISOR_shared_info; + struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); +@@ -1161,6 +1161,8 @@ static void __xen_evtchn_do_upcall(void) + + do { + unsigned long pending_words; ++ unsigned long pending_bits; ++ struct irq_desc *desc; + + vcpu_info->evtchn_upcall_pending = 0; + +@@ -1171,6 +1173,17 @@ static void __xen_evtchn_do_upcall(void) + /* Clear master flag /before/ clearing selector flag. */ + wmb(); + #endif ++ if ((irq = per_cpu(virq_to_irq, cpu)[VIRQ_TIMER]) != -1) { ++ int evtchn = evtchn_from_irq(irq); ++ word_idx = evtchn / BITS_PER_LONG; ++ pending_bits = evtchn % BITS_PER_LONG; ++ if (active_evtchns(cpu, s, word_idx) & (1ULL << pending_bits)) { ++ desc = irq_to_desc(irq); ++ if (desc) ++ generic_handle_irq_desc(irq, desc); ++ } ++ } ++ + pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0); + + start_word_idx = __this_cpu_read(current_word_idx); +@@ -1179,7 +1192,6 @@ static void __xen_evtchn_do_upcall(void) + word_idx = start_word_idx; + + for (i = 0; pending_words != 0; i++) { +- unsigned long pending_bits; + unsigned long words; + + words = MASK_LSBS(pending_words, word_idx); +@@ -1208,8 +1220,7 @@ static void __xen_evtchn_do_upcall(void) + + do { + unsigned long bits; +- int port, irq; +- struct irq_desc *desc; ++ int port; + + bits = MASK_LSBS(pending_bits, bit_idx); +