All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Keir Fraser <keir.fraser@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 28/93] xen/events: Handle VIRQ_TIMER before any other hardirq in event loop.
Date: Tue, 18 Jun 2013 12:42:36 +0100	[thread overview]
Message-ID: <1371555821-12820-29-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1371555821-12820-1-git-send-email-luis.henriques@canonical.com>

3.5.7.15 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Keir Fraser <keir.fraser@citrix.com>

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 <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[ luis: backported to 3.5:
  - replaced xen_ulong_t by unsigned long ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/xen/events.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 99c5345..b5b559a 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -1267,7 +1267,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);
@@ -1275,6 +1275,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;
 
@@ -1285,6 +1287,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);
@@ -1293,7 +1306,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);
@@ -1322,8 +1334,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);
 
-- 
1.8.1.2


  parent reply	other threads:[~2013-06-18 12:03 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 11:42 [ 3.5.y.z extended stable ] Linux 3.5.7.15 stable review Luis Henriques
2013-06-18 11:42 ` [PATCH 01/93] ata_piix: add PCI IDs for Intel BayTail Luis Henriques
2013-06-18 11:42 ` [PATCH 02/93] libata: make ata_exec_internal_sg honor DMADIR Luis Henriques
2013-06-18 11:42 ` [PATCH 03/93] cfg80211: check wdev->netdev in connection work Luis Henriques
2013-06-18 11:42 ` [PATCH 04/93] xhci-mem: init list heads at the beginning of init Luis Henriques
2013-06-18 11:42 ` [PATCH 05/93] xhci: fix list access before init Luis Henriques
2013-06-18 11:42 ` [PATCH 06/93] xhci - correct comp_mode_recovery_timer on return from hibernate Luis Henriques
2013-06-18 11:42 ` [PATCH 07/93] mac80211: close AP_VLAN interfaces before unregistering all Luis Henriques
2013-06-18 11:42 ` [PATCH 08/93] iwlwifi: dvm: fix zero LQ CMD sending avoidance Luis Henriques
2013-06-18 11:42 ` [PATCH 09/93] usb: dwc3: gadget: free trb pool only from epnum 2 Luis Henriques
2013-06-18 11:42 ` [PATCH 10/93] USB: revert periodic scheduling bugfix Luis Henriques
2013-06-18 11:42 ` [PATCH 11/93] USB: serial: fix Treo/Kyocera interrrupt-in urb context Luis Henriques
2013-06-18 11:42 ` [PATCH 12/93] USB: visor: fix initialisation of Treo/Kyocera devices Luis Henriques
2013-06-18 11:42 ` [PATCH 13/93] USB: mos7720: fix DMA to stack Luis Henriques
2013-06-18 11:42 ` [PATCH 14/93] USB: mos7840: " Luis Henriques
2013-06-18 11:42 ` [PATCH 15/93] USB: ark3116: fix control-message timeout Luis Henriques
2013-06-18 11:42 ` [PATCH 16/93] USB: iuu_phoenix: fix bulk-message timeout Luis Henriques
2013-06-18 11:42 ` [PATCH 17/93] USB: mos7720: fix message timeouts Luis Henriques
2013-06-18 11:42 ` [PATCH 18/93] regulator: palmas: Fix "enable_reg" to point to the correct reg for SMPS10 Luis Henriques
2013-06-18 11:42 ` [PATCH 19/93] m68k/mac: Fix unexpected interrupt with CONFIG_EARLY_PRINTK Luis Henriques
2013-06-18 11:42 ` [PATCH 20/93] USB: Serial: cypress_M8: Enable FRWD Dongle hidcom device Luis Henriques
2013-06-18 11:42 ` [PATCH 21/93] USB: serial: Add Option GTM681W to qcserial device table Luis Henriques
2013-06-18 11:42 ` [PATCH 22/93] USB: keyspan: fix bogus array index Luis Henriques
2013-06-18 11:42 ` [PATCH 23/93] USB: mos7720: fix hardware flow control Luis Henriques
2013-06-18 11:42 ` [PATCH 24/93] USB: whiteheat: fix broken port configuration Luis Henriques
2013-06-18 11:42 ` [PATCH 25/93] USB: option: blacklist network interface on Huawei E1820 Luis Henriques
2013-06-18 11:42 ` [PATCH 26/93] iommu/amd: Re-enable IOMMU event log interrupt after handling Luis Henriques
2013-06-18 11:42 ` [PATCH 27/93] iommu/amd: Workaround for ERBT1312 Luis Henriques
2013-06-18 11:42 ` Luis Henriques [this message]
2013-06-18 11:42 ` [PATCH 29/93] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR Luis Henriques
2013-06-18 11:42 ` [PATCH 30/93] klist: del waiter from klist_remove_waiters before wakeup waitting process Luis Henriques
2013-06-18 11:42 ` [PATCH 31/93] ACPI video: ignore BIOS backlight value for HP dm4 Luis Henriques
2013-06-18 11:42 ` [PATCH 32/93] ACPI video: ignore BIOS initial backlight value for HP 1000 Luis Henriques
2013-06-18 11:42 ` [PATCH 33/93] dmaengine: ste_dma40: fix pm runtime ref counting Luis Henriques
2013-06-18 11:42 ` [PATCH 34/93] ACPI / video: ignore BIOS initial backlight value for HP m4 Luis Henriques
2013-06-18 11:42 ` [PATCH 35/93] ACPI / video: ignore BIOS initial backlight value for HP Pavilion g6 Luis Henriques
2013-06-18 11:42 ` [PATCH 36/93] ALSA: usb-audio: fix Roland/Cakewalk UM-3G support Luis Henriques
2013-06-18 11:42 ` [PATCH 37/93] drm: fix a use-after-free when GPU acceleration disabled Luis Henriques
2013-06-18 11:42 ` [PATCH 38/93] drm/mgag200: Add missing write to index before accessing data register Luis Henriques
2013-06-18 11:42 ` [PATCH 39/93] drm/i915: no lvds quirk for hp t5740 Luis Henriques
2013-06-18 11:42 ` [PATCH 40/93] radeon: Fix system hang issue when using KMS with older cards Luis Henriques
2013-06-18 11:42 ` [PATCH 41/93] drm/radeon: don't allow audio on DCE6 Luis Henriques
2013-06-18 11:42 ` [PATCH 42/93] ALSA: usb-audio - Apply Logitech QuickCam Pro 9000 quirk only to audio iface Luis Henriques
2013-06-18 11:42 ` [PATCH 43/93] drm/i915/sdvo: Use &intel_sdvo->ddc instead of intel_sdvo->i2c for DDC Luis Henriques
2013-06-18 11:42 ` [PATCH 44/93] ALSA: usb-audio - Fix invalid volume resolution on Logitech HD webcam c270 Luis Henriques
2013-06-18 11:42 ` [PATCH 45/93] ARM: 7742/1: topology: export cpu_topology Luis Henriques
2013-06-18 11:42 ` [PATCH 46/93] ARM: 7743/1: compressed/head.S: work around new binutils warning Luis Henriques
2013-06-18 11:42 ` [PATCH 47/93] hwmon: (adm1021) Strengthen chip detection for ADM1021, LM84 and MAX1617 Luis Henriques
2013-06-18 11:42 ` [PATCH 48/93] hpfs: drop vmtruncate Luis Henriques
2013-06-18 11:42 ` [PATCH 49/93] hpfs: fix warnings when the filesystem fills up Luis Henriques
2013-06-18 11:42 ` [PATCH 50/93] powerpc/eeh: Don't check RTAS token to get PE addr Luis Henriques
2013-06-18 11:42 ` [PATCH 51/93] drm/gma500: Increase max resolution for mode setting Luis Henriques
2013-06-18 11:43 ` [PATCH 52/93] USB: ftdi_sio: Quiet sparse noise about using plain integer was NULL pointer Luis Henriques
2013-06-18 11:43 ` [PATCH 53/93] tg3: Add New 5719 Read DMA workaround Luis Henriques
2013-06-18 11:43 ` [PATCH 54/93] tg3: Add read dma workaround for 5720 Luis Henriques
2013-06-18 11:43 ` [PATCH 55/93] libceph: clear messenger auth_retry flag when we authenticate Luis Henriques
2013-06-18 11:43 ` [PATCH 56/93] libceph: fix authorizer invalidation Luis Henriques
2013-06-18 11:43 ` [PATCH 57/93] libceph: add update_authorizer auth method Luis Henriques
2013-06-18 11:43 ` [PATCH 58/93] libceph: wrap auth ops in wrapper functions Luis Henriques
2013-06-18 11:43 ` [PATCH 59/93] libceph: wrap auth methods in a mutex Luis Henriques
2013-06-18 11:43 ` [PATCH 60/93] libceph: register request before unregister linger Luis Henriques
2013-06-18 11:43 ` [PATCH 61/93] libceph: always reset osds when kicking Luis Henriques
2013-06-18 11:43 ` [PATCH 62/93] libceph: must hold mutex for reset_changed_osds() Luis Henriques
2013-06-18 11:43 ` [PATCH 63/93] ceph: add cpu_to_le32() calls when encoding a reconnect capability Luis Henriques
2013-06-18 11:43 ` [PATCH 64/93] ceph: ceph_pagelist_append might sleep while atomic Luis Henriques
2013-06-18 11:43 ` [PATCH 65/93] drm/gma500/psb: Unpin framebuffer on crtc disable Luis Henriques
2013-06-18 11:43 ` [PATCH 66/93] drm/gma500/cdv: " Luis Henriques
2013-06-18 11:43 ` [PATCH 67/93] drm/i915: prefer VBT modes for SVDO-LVDS over EDID Luis Henriques
2013-06-18 11:43 ` [PATCH 68/93] Bluetooth: Fix mgmt handling of power on failures Luis Henriques
2013-06-18 11:43 ` [PATCH 69/93] ath9k: Disable PowerSave by default Luis Henriques
2013-06-18 11:43 ` [PATCH 70/93] Revert "ath9k_hw: Update rx gain initval to improve rx sensitivity" Luis Henriques
2013-06-18 11:43 ` [PATCH 71/93] ath9k: Use minstrel rate control by default Luis Henriques
2013-06-18 11:43 ` [PATCH 72/93] b43: stop format string leaking into error msgs Luis Henriques
2013-06-18 11:43 ` [PATCH 73/93] CPU hotplug: provide a generic helper to disable/enable CPU hotplug Luis Henriques
2013-06-18 11:43 ` [PATCH 74/93] reboot: rigrate shutdown/reboot to boot cpu Luis Henriques
2013-06-18 11:43 ` [PATCH 75/93] kmsg: honor dmesg_restrict sysctl on /dev/kmsg Luis Henriques
2013-06-18 11:43 ` [PATCH 76/93] cciss: fix broken mutex usage in ioctl Luis Henriques
2013-06-18 11:43 ` [PATCH 77/93] drivers/rtc/rtc-twl.c: fix missing device_init_wakeup() when booted with device tree Luis Henriques
2013-06-18 11:43 ` [PATCH 78/93] swap: avoid read_swap_cache_async() race to deadlock while waiting on discard I/O completion Luis Henriques
2013-06-18 11:43 ` [PATCH 79/93] mm: migration: add migrate_entry_wait_huge() Luis Henriques
2013-06-18 11:43 ` [PATCH 80/93] ceph: fix statvfs fr_size Luis Henriques
2013-06-18 11:43 ` [PATCH 81/93] x86: Fix typo in kexec register clearing Luis Henriques
2013-06-18 11:43 ` [PATCH 82/93] md/raid1: consider WRITE as successful only if at least one non-Faulty and non-rebuilding drive completed it Luis Henriques
2013-06-18 11:43 ` [PATCH 83/93] md/raid1,raid10: use freeze_array in place of raise_barrier in various places Luis Henriques
2013-06-18 11:43 ` [PATCH 84/93] USB: spcp8x5: fix device initialisation at open Luis Henriques
2013-06-18 11:43 ` [PATCH 85/93] USB: pl2303: " Luis Henriques
2013-06-18 11:43 ` [PATCH 86/93] tg3: Wait for boot code to finish after power on Luis Henriques
2013-06-18 11:43 ` [PATCH 87/93] powerpc: Fix stack overflow crash in resume_kernel when ftracing Luis Henriques
2013-06-18 11:43 ` [PATCH 88/93] powerpc: Fix emulation of illegal instructions on PowerNV platform Luis Henriques
2013-06-18 11:43 ` [PATCH 89/93] powerpc: Fix missing/delayed calls to irq_work Luis Henriques
2013-06-18 11:43 ` [PATCH 90/93] audit: wait_for_auditd() should use TASK_UNINTERRUPTIBLE Luis Henriques
2013-06-18 11:43 ` [PATCH 91/93] xen-netfront: reduce gso_max_size to account for max TCP header Luis Henriques
2013-06-18 11:43 ` [PATCH 92/93] ext4: lock i_mutex when truncating orphan inodes Luis Henriques
2013-06-18 11:43 ` [PATCH 93/93] snd_pcm_link(): fix a leak Luis Henriques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371555821-12820-29-git-send-email-luis.henriques@canonical.com \
    --to=luis.henriques@canonical.com \
    --cc=keir.fraser@citrix.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.