From ce4b284ff8ea186a5af6a3f366372fa5022f829b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 25 Mar 2014 14:24:52 -0700 Subject: [PATCH] 3.4-stable patches added patches: input-elantech-improve-clickpad-detection.patch kvm-mmu-handle-invalid-root_hpa-at-__direct_map.patch kvm-vmx-fix-use-after-free-of-vmx-loaded_vmcs.patch xhci-fix-resume-issues-on-renesas-chips-in-samsung-laptops.patch --- ...-elantech-improve-clickpad-detection.patch | 111 ++++++++++++++++++ ...dle-invalid-root_hpa-at-__direct_map.patch | 43 +++++++ ...ix-use-after-free-of-vmx-loaded_vmcs.patch | 39 ++++++ queue-3.4/series | 4 + ...-on-renesas-chips-in-samsung-laptops.patch | 43 +++++++ 5 files changed, 240 insertions(+) create mode 100644 queue-3.4/input-elantech-improve-clickpad-detection.patch create mode 100644 queue-3.4/kvm-mmu-handle-invalid-root_hpa-at-__direct_map.patch create mode 100644 queue-3.4/kvm-vmx-fix-use-after-free-of-vmx-loaded_vmcs.patch create mode 100644 queue-3.4/xhci-fix-resume-issues-on-renesas-chips-in-samsung-laptops.patch diff --git a/queue-3.4/input-elantech-improve-clickpad-detection.patch b/queue-3.4/input-elantech-improve-clickpad-detection.patch new file mode 100644 index 00000000000..6ce87da9996 --- /dev/null +++ b/queue-3.4/input-elantech-improve-clickpad-detection.patch @@ -0,0 +1,111 @@ +From c15bdfd5b9831e4cab8cfc118243956e267dd30e Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 16 Dec 2013 07:09:25 -0800 +Subject: Input: elantech - improve clickpad detection + +From: Hans de Goede + +commit c15bdfd5b9831e4cab8cfc118243956e267dd30e upstream. + +The current assumption in the elantech driver that hw version 3 touchpads +are never clickpads and hw version 4 touchpads are always clickpads is +wrong. + +There are several bug reports for this, ie: +https://bugzilla.redhat.com/show_bug.cgi?id=1030802 +http://superuser.com/questions/619582/right-elantech-touchpad-button-not-working-in-linux + +I've spend a couple of hours wading through various bugzillas, launchpads +and forum posts to create a list of fw-versions and capabilities for +different laptop models to find a good method to differentiate between +clickpads and versions with separate hardware buttons. + +Which shows that a device being a clickpad is reliable indicated by bit 12 +being set in the fw_version. I've included the gathered list inside the +driver, so that we've this info at hand if we need to revisit this later. + +Signed-off-by: Hans de Goede +Reviewed-by: Benjamin Tissoires +Signed-off-by: Dmitry Torokhov +Cc: Josh Boyer +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/mouse/elantech.c | 45 ++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 42 insertions(+), 3 deletions(-) + +--- a/drivers/input/mouse/elantech.c ++++ b/drivers/input/mouse/elantech.c +@@ -486,6 +486,7 @@ static void elantech_input_sync_v4(struc + unsigned char *packet = psmouse->packet; + + input_report_key(dev, BTN_LEFT, packet[0] & 0x01); ++ input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); + input_mt_report_pointer_emulation(dev, true); + input_sync(dev); + } +@@ -954,6 +955,44 @@ static int elantech_get_resolution_v4(st + } + + /* ++ * Advertise INPUT_PROP_BUTTONPAD for clickpads. The testing of bit 12 in ++ * fw_version for this is based on the following fw_version & caps table: ++ * ++ * Laptop-model: fw_version: caps: buttons: ++ * Acer S3 0x461f00 10, 13, 0e clickpad ++ * Acer S7-392 0x581f01 50, 17, 0d clickpad ++ * Acer V5-131 0x461f02 01, 16, 0c clickpad ++ * Acer V5-551 0x461f00 ? clickpad ++ * Asus K53SV 0x450f01 78, 15, 0c 2 hw buttons ++ * Asus G46VW 0x460f02 00, 18, 0c 2 hw buttons ++ * Asus G750JX 0x360f00 00, 16, 0c 2 hw buttons ++ * Asus UX31 0x361f00 20, 15, 0e clickpad ++ * Asus UX32VD 0x361f02 00, 15, 0e clickpad ++ * Avatar AVIU-145A2 0x361f00 ? clickpad ++ * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons ++ * Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*) ++ * Samsung NF210 0x150b00 78, 14, 0a 2 hw buttons ++ * Samsung NP770Z5E 0x575f01 10, 15, 0f clickpad ++ * Samsung NP700Z5B 0x361f06 21, 15, 0f clickpad ++ * Samsung NP900X3E-A02 0x575f03 ? clickpad ++ * Samsung NP-QX410 0x851b00 19, 14, 0c clickpad ++ * Samsung RC512 0x450f00 08, 15, 0c 2 hw buttons ++ * Samsung RF710 0x450f00 ? 2 hw buttons ++ * System76 Pangolin 0x250f01 ? 2 hw buttons ++ * (*) + 3 trackpoint buttons ++ */ ++static void elantech_set_buttonpad_prop(struct psmouse *psmouse) ++{ ++ struct input_dev *dev = psmouse->dev; ++ struct elantech_data *etd = psmouse->private; ++ ++ if (etd->fw_version & 0x001000) { ++ __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); ++ __clear_bit(BTN_RIGHT, dev->keybit); ++ } ++} ++ ++/* + * Set the appropriate event bits for the input subsystem + */ + static int elantech_set_input_params(struct psmouse *psmouse) +@@ -996,6 +1035,8 @@ static int elantech_set_input_params(str + __set_bit(INPUT_PROP_SEMI_MT, dev->propbit); + /* fall through */ + case 3: ++ if (etd->hw_version == 3) ++ elantech_set_buttonpad_prop(psmouse); + input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); + input_set_abs_params(dev, ABS_Y, y_min, y_max, 0, 0); + if (etd->reports_pressure) { +@@ -1017,9 +1058,7 @@ static int elantech_set_input_params(str + */ + psmouse_warn(psmouse, "couldn't query resolution data.\n"); + } +- /* v4 is clickpad, with only one button. */ +- __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); +- __clear_bit(BTN_RIGHT, dev->keybit); ++ elantech_set_buttonpad_prop(psmouse); + __set_bit(BTN_TOOL_QUADTAP, dev->keybit); + /* For X to recognize me as touchpad. */ + input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); diff --git a/queue-3.4/kvm-mmu-handle-invalid-root_hpa-at-__direct_map.patch b/queue-3.4/kvm-mmu-handle-invalid-root_hpa-at-__direct_map.patch new file mode 100644 index 00000000000..235329fbe8e --- /dev/null +++ b/queue-3.4/kvm-mmu-handle-invalid-root_hpa-at-__direct_map.patch @@ -0,0 +1,43 @@ +From 989c6b34f6a9480e397b170cc62237e89bf4fdb9 Mon Sep 17 00:00:00 2001 +From: Marcelo Tosatti +Date: Thu, 19 Dec 2013 15:28:51 -0200 +Subject: KVM: MMU: handle invalid root_hpa at __direct_map + +From: Marcelo Tosatti + +commit 989c6b34f6a9480e397b170cc62237e89bf4fdb9 upstream. + +It is possible for __direct_map to be called on invalid root_hpa +(-1), two examples: + +1) try_async_pf -> can_do_async_pf + -> vmx_interrupt_allowed -> nested_vmx_vmexit +2) vmx_handle_exit -> vmx_interrupt_allowed -> nested_vmx_vmexit + +Then to load_vmcs12_host_state and kvm_mmu_reset_context. + +Check for this possibility, let fault exception be regenerated. + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=924916 + +Signed-off-by: Marcelo Tosatti +Signed-off-by: Paolo Bonzini +Cc: Josh Boyer +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/mmu.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/x86/kvm/mmu.c ++++ b/arch/x86/kvm/mmu.c +@@ -2451,6 +2451,9 @@ static int __direct_map(struct kvm_vcpu + int emulate = 0; + gfn_t pseudo_gfn; + ++ if (!VALID_PAGE(vcpu->arch.mmu.root_hpa)) ++ return 0; ++ + for_each_shadow_entry(vcpu, (u64)gfn << PAGE_SHIFT, iterator) { + if (iterator.level == level) { + unsigned pte_access = ACC_ALL; diff --git a/queue-3.4/kvm-vmx-fix-use-after-free-of-vmx-loaded_vmcs.patch b/queue-3.4/kvm-vmx-fix-use-after-free-of-vmx-loaded_vmcs.patch new file mode 100644 index 00000000000..cd5e1251bb5 --- /dev/null +++ b/queue-3.4/kvm-vmx-fix-use-after-free-of-vmx-loaded_vmcs.patch @@ -0,0 +1,39 @@ +From 26a865f4aa8e66a6d94958de7656f7f1b03c6c56 Mon Sep 17 00:00:00 2001 +From: Marcelo Tosatti +Date: Fri, 3 Jan 2014 17:00:51 -0200 +Subject: KVM: VMX: fix use after free of vmx->loaded_vmcs + +From: Marcelo Tosatti + +commit 26a865f4aa8e66a6d94958de7656f7f1b03c6c56 upstream. + +After free_loaded_vmcs executes, the "loaded_vmcs" structure +is kfreed, and now vmx->loaded_vmcs points to a kfreed area. +Subsequent free_loaded_vmcs then attempts to manipulate +vmx->loaded_vmcs. + +Switch the order to avoid the problem. + +https://bugzilla.redhat.com/show_bug.cgi?id=1047892 + +Reviewed-by: Jan Kiszka +Signed-off-by: Marcelo Tosatti +Cc: Josh Boyer +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/vmx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kvm/vmx.c ++++ b/arch/x86/kvm/vmx.c +@@ -6281,8 +6281,8 @@ static void vmx_free_vcpu(struct kvm_vcp + struct vcpu_vmx *vmx = to_vmx(vcpu); + + free_vpid(vmx); +- free_nested(vmx); + free_loaded_vmcs(vmx->loaded_vmcs); ++ free_nested(vmx); + kfree(vmx->guest_msrs); + kvm_vcpu_uninit(vcpu); + kmem_cache_free(kvm_vcpu_cache, vmx); diff --git a/queue-3.4/series b/queue-3.4/series index 7b3fdb38b3d..9d4ca175783 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -7,3 +7,7 @@ deb-pkg-fix-cross-building-linux-headers-package.patch p54-clamp-properly-instead-of-just-truncating.patch i7300_edac-fix-device-reference-count.patch arm-move-outer_cache-declaration-out-of-ifdef.patch +input-elantech-improve-clickpad-detection.patch +kvm-mmu-handle-invalid-root_hpa-at-__direct_map.patch +kvm-vmx-fix-use-after-free-of-vmx-loaded_vmcs.patch +xhci-fix-resume-issues-on-renesas-chips-in-samsung-laptops.patch diff --git a/queue-3.4/xhci-fix-resume-issues-on-renesas-chips-in-samsung-laptops.patch b/queue-3.4/xhci-fix-resume-issues-on-renesas-chips-in-samsung-laptops.patch new file mode 100644 index 00000000000..de71c7a7597 --- /dev/null +++ b/queue-3.4/xhci-fix-resume-issues-on-renesas-chips-in-samsung-laptops.patch @@ -0,0 +1,43 @@ +From 1aa9578c1a9450fb21501c4f549f5b1edb557e6d Mon Sep 17 00:00:00 2001 +From: Sarah Sharp +Date: Fri, 17 Jan 2014 15:38:12 -0800 +Subject: xhci: Fix resume issues on Renesas chips in Samsung laptops + +From: Sarah Sharp + +commit 1aa9578c1a9450fb21501c4f549f5b1edb557e6d upstream. + +Don Zickus writes: + +Some co-workers of mine bought Samsung laptops that had mostly usb3 ports. +Those ports did not resume correctly (the driver would timeout communicating +and fail). This led to frustration as suspend/resume is a common use for +laptops. + +Poking around, I applied the reset on resume quirk to this chipset and the +resume started working. Reloading the xhci_hcd module had been the temporary +workaround. + +Signed-off-by: Sarah Sharp +Reported-by: Don Zickus +Tested-by: Prarit Bhargava +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-pci.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -109,6 +109,11 @@ static void xhci_pci_quirks(struct devic + xhci_dbg(xhci, "QUIRK: Resetting on resume\n"); + xhci->quirks |= XHCI_TRUST_TX_LENGTH; + } ++ if (pdev->vendor == PCI_VENDOR_ID_RENESAS && ++ pdev->device == 0x0015 && ++ pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG && ++ pdev->subsystem_device == 0xc0cd) ++ xhci->quirks |= XHCI_RESET_ON_RESUME; + if (pdev->vendor == PCI_VENDOR_ID_VIA) + xhci->quirks |= XHCI_RESET_ON_RESUME; + } -- 2.47.3