From: Greg Kroah-Hartman Date: Sun, 4 Dec 2016 11:51:06 +0000 (+0100) Subject: 4.8-stable patches X-Git-Tag: v4.8.13~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b79fe6f9089fc1a8d80ca632f4243da305707dfe;p=thirdparty%2Fkernel%2Fstable-queue.git 4.8-stable patches added patches: drm-i915-don-t-touch-null-sg-on-i915_gem_object_get_pages_gtt-error.patch drm-i915-drop-the-struct_mutex-when-wedged-or-trying-to-reset.patch kvm-arm-arm64-vgic-don-t-notify-eoi-for-non-spis.patch --- diff --git a/queue-4.8/drm-i915-don-t-touch-null-sg-on-i915_gem_object_get_pages_gtt-error.patch b/queue-4.8/drm-i915-don-t-touch-null-sg-on-i915_gem_object_get_pages_gtt-error.patch new file mode 100644 index 00000000000..7109a30f34f --- /dev/null +++ b/queue-4.8/drm-i915-don-t-touch-null-sg-on-i915_gem_object_get_pages_gtt-error.patch @@ -0,0 +1,49 @@ +From 2420489bcb8910188578acc0c11c75445c2e4b92 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Mon, 14 Nov 2016 11:29:30 +0000 +Subject: drm/i915: Don't touch NULL sg on i915_gem_object_get_pages_gtt() error + +From: Chris Wilson + +commit 2420489bcb8910188578acc0c11c75445c2e4b92 upstream. + +On the DMA mapping error path, sg may be NULL (it has already been +marked as the last scatterlist entry), and we should avoid dereferencing +it again. + +Reported-by: Dan Carpenter +Fixes: e227330223a7 ("drm/i915: avoid leaking DMA mappings") +Signed-off-by: Chris Wilson +Cc: Imre Deak +Link: http://patchwork.freedesktop.org/patch/msgid/20161114112930.2033-1-chris@chris-wilson.co.uk +Reviewed-by: Matthew Auld +(cherry picked from commit b17993b7b29612369270567643bcff814f4b3d7f) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_gem.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -2540,7 +2540,7 @@ i915_gem_object_get_pages_gtt(struct drm + page = shmem_read_mapping_page(mapping, i); + if (IS_ERR(page)) { + ret = PTR_ERR(page); +- goto err_pages; ++ goto err_sg; + } + } + #ifdef CONFIG_SWIOTLB +@@ -2583,8 +2583,9 @@ i915_gem_object_get_pages_gtt(struct drm + + return 0; + +-err_pages: ++err_sg: + sg_mark_end(sg); ++err_pages: + for_each_sgt_page(page, sgt_iter, st) + put_page(page); + sg_free_table(st); diff --git a/queue-4.8/drm-i915-drop-the-struct_mutex-when-wedged-or-trying-to-reset.patch b/queue-4.8/drm-i915-drop-the-struct_mutex-when-wedged-or-trying-to-reset.patch new file mode 100644 index 00000000000..c1a8533aa7c --- /dev/null +++ b/queue-4.8/drm-i915-drop-the-struct_mutex-when-wedged-or-trying-to-reset.patch @@ -0,0 +1,47 @@ +From e411072d5740a49cdc9d0713798c30440757e451 Mon Sep 17 00:00:00 2001 +From: Matthew Auld +Date: Mon, 28 Nov 2016 10:36:48 +0000 +Subject: drm/i915: drop the struct_mutex when wedged or trying to reset + +From: Matthew Auld + +commit e411072d5740a49cdc9d0713798c30440757e451 upstream. + +We grab the struct_mutex in intel_crtc_page_flip, but if we are wedged +or a reset is in progress we bail early but never seem to actually +release the lock. + +Fixes: 7f1847ebf48b ("drm/i915: Simplify checking of GPU reset_counter in display pageflips") +Cc: Chris Wilson +Signed-off-by: Matthew Auld +Link: http://patchwork.freedesktop.org/patch/msgid/20161128103648.9235-1-matthew.auld@intel.com +Reviewed-by: Joonas Lahtinen +Reviewed-by: Chris Wilson +Signed-off-by: Chris Wilson +(cherry picked from commit ddbb271aea87fc6004d3c8bcdb0710e980c7ec85) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_display.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/intel_display.c ++++ b/drivers/gpu/drm/i915/intel_display.c +@@ -11791,7 +11791,7 @@ static int intel_crtc_page_flip(struct d + intel_crtc->reset_counter = i915_reset_counter(&dev_priv->gpu_error); + if (__i915_reset_in_progress_or_wedged(intel_crtc->reset_counter)) { + ret = -EIO; +- goto cleanup; ++ goto unlock; + } + + atomic_inc(&intel_crtc->unpin_work_count); +@@ -11877,6 +11877,7 @@ cleanup_pending: + if (!IS_ERR_OR_NULL(request)) + i915_add_request_no_flush(request); + atomic_dec(&intel_crtc->unpin_work_count); ++unlock: + mutex_unlock(&dev->struct_mutex); + cleanup: + crtc->primary->fb = old_fb; diff --git a/queue-4.8/kvm-arm-arm64-vgic-don-t-notify-eoi-for-non-spis.patch b/queue-4.8/kvm-arm-arm64-vgic-don-t-notify-eoi-for-non-spis.patch new file mode 100644 index 00000000000..2cc9d02efac --- /dev/null +++ b/queue-4.8/kvm-arm-arm64-vgic-don-t-notify-eoi-for-non-spis.patch @@ -0,0 +1,62 @@ +From 8ca18eec2b2276b449c1dc86b98bf083c5fe4e09 Mon Sep 17 00:00:00 2001 +From: Marc Zyngier +Date: Wed, 23 Nov 2016 10:11:21 +0000 +Subject: KVM: arm/arm64: vgic: Don't notify EOI for non-SPIs + +From: Marc Zyngier + +commit 8ca18eec2b2276b449c1dc86b98bf083c5fe4e09 upstream. + +When we inject a level triggerered interrupt (and unless it +is backed by the physical distributor - timer style), we request +a maintenance interrupt. Part of the processing for that interrupt +is to feed to the rest of KVM (and to the eventfd subsystem) the +information that the interrupt has been EOIed. + +But that notification only makes sense for SPIs, and not PPIs +(such as the PMU interrupt). Skip over the notification if +the interrupt is not an SPI. + +Fixes: 140b086dd197 ("KVM: arm/arm64: vgic-new: Add GICv2 world switch backend") +Fixes: 59529f69f504 ("KVM: arm/arm64: vgic-new: Add GICv3 world switch backend") +Reported-by: Catalin Marinas +Tested-by: Catalin Marinas +Acked-by: Christoffer Dall +Signed-off-by: Marc Zyngier +Signed-off-by: Greg Kroah-Hartman + +--- + virt/kvm/arm/vgic/vgic-v2.c | 6 ++++-- + virt/kvm/arm/vgic/vgic-v3.c | 6 ++++-- + 2 files changed, 8 insertions(+), 4 deletions(-) + +--- a/virt/kvm/arm/vgic/vgic-v2.c ++++ b/virt/kvm/arm/vgic/vgic-v2.c +@@ -50,8 +50,10 @@ void vgic_v2_process_maintenance(struct + + WARN_ON(cpuif->vgic_lr[lr] & GICH_LR_STATE); + +- kvm_notify_acked_irq(vcpu->kvm, 0, +- intid - VGIC_NR_PRIVATE_IRQS); ++ /* Only SPIs require notification */ ++ if (vgic_valid_spi(vcpu->kvm, intid)) ++ kvm_notify_acked_irq(vcpu->kvm, 0, ++ intid - VGIC_NR_PRIVATE_IRQS); + } + } + +--- a/virt/kvm/arm/vgic/vgic-v3.c ++++ b/virt/kvm/arm/vgic/vgic-v3.c +@@ -41,8 +41,10 @@ void vgic_v3_process_maintenance(struct + + WARN_ON(cpuif->vgic_lr[lr] & ICH_LR_STATE); + +- kvm_notify_acked_irq(vcpu->kvm, 0, +- intid - VGIC_NR_PRIVATE_IRQS); ++ /* Only SPIs require notification */ ++ if (vgic_valid_spi(vcpu->kvm, intid)) ++ kvm_notify_acked_irq(vcpu->kvm, 0, ++ intid - VGIC_NR_PRIVATE_IRQS); + } + + /* diff --git a/queue-4.8/series b/queue-4.8/series index 0fa675448fc..711d4b2b0ad 100644 --- a/queue-4.8/series +++ b/queue-4.8/series @@ -15,3 +15,6 @@ rcu-fix-soft-lockup-for-rcu_nocb_kthread.patch mm-workingset-fix-null-ptr-in-count_shadow_nodes.patch pci-set-read-completion-boundary-to-128-iff-root-port-supports-it-_hpx.patch mwifiex-printk-overflow-with-32-byte-ssids.patch +kvm-arm-arm64-vgic-don-t-notify-eoi-for-non-spis.patch +drm-i915-don-t-touch-null-sg-on-i915_gem_object_get_pages_gtt-error.patch +drm-i915-drop-the-struct_mutex-when-wedged-or-trying-to-reset.patch