From b9a0234e81bcd35318ba59598aa452070a7bfa0c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 31 Jul 2017 18:16:04 -0700 Subject: [PATCH] 3.18-stable patches added patches: drm-vmwgfx-fix-gcc-7.1.1-warning.patch kvm-ppc-book3s-hv-enable-tm-before-accessing-tm-registers.patch md-raid5-add-thread_group-worker-async_tx_issue_pending_all.patch --- .../drm-vmwgfx-fix-gcc-7.1.1-warning.patch | 34 ++++++++ ...ble-tm-before-accessing-tm-registers.patch | 81 +++++++++++++++++++ ...up-worker-async_tx_issue_pending_all.patch | 39 +++++++++ queue-3.18/series | 3 + 4 files changed, 157 insertions(+) create mode 100644 queue-3.18/drm-vmwgfx-fix-gcc-7.1.1-warning.patch create mode 100644 queue-3.18/kvm-ppc-book3s-hv-enable-tm-before-accessing-tm-registers.patch create mode 100644 queue-3.18/md-raid5-add-thread_group-worker-async_tx_issue_pending_all.patch diff --git a/queue-3.18/drm-vmwgfx-fix-gcc-7.1.1-warning.patch b/queue-3.18/drm-vmwgfx-fix-gcc-7.1.1-warning.patch new file mode 100644 index 00000000000..be23cf87927 --- /dev/null +++ b/queue-3.18/drm-vmwgfx-fix-gcc-7.1.1-warning.patch @@ -0,0 +1,34 @@ +From fcfffdd8f98ac305285dca568b5065ef86be6458 Mon Sep 17 00:00:00 2001 +From: Sinclair Yeh +Date: Mon, 17 Jul 2017 23:28:36 -0700 +Subject: drm/vmwgfx: Fix gcc-7.1.1 warning + +From: Sinclair Yeh + +commit fcfffdd8f98ac305285dca568b5065ef86be6458 upstream. + +The current code does not look correct, and the reason for it is +probably lost. Since this now generates a compiler warning, +fix it to what makes sense. + +Reported-by: Arnd Bergmann +Reported-by: Linus Torvalds +Signed-off-by: Sinclair Yeh +Reviewed-by: Brian Paul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +@@ -285,7 +285,7 @@ static int vmw_cmd_invalid(struct vmw_pr + struct vmw_sw_context *sw_context, + SVGA3dCmdHeader *header) + { +- return capable(CAP_SYS_ADMIN) ? : -EINVAL; ++ return -EINVAL; + } + + static int vmw_cmd_ok(struct vmw_private *dev_priv, diff --git a/queue-3.18/kvm-ppc-book3s-hv-enable-tm-before-accessing-tm-registers.patch b/queue-3.18/kvm-ppc-book3s-hv-enable-tm-before-accessing-tm-registers.patch new file mode 100644 index 00000000000..faa984ae176 --- /dev/null +++ b/queue-3.18/kvm-ppc-book3s-hv-enable-tm-before-accessing-tm-registers.patch @@ -0,0 +1,81 @@ +From e47057151422a67ce08747176fa21cb3b526a2c9 Mon Sep 17 00:00:00 2001 +From: Paul Mackerras +Date: Fri, 21 Jul 2017 13:57:14 +1000 +Subject: KVM: PPC: Book3S HV: Enable TM before accessing TM registers + +From: Paul Mackerras + +commit e47057151422a67ce08747176fa21cb3b526a2c9 upstream. + +Commit 46a704f8409f ("KVM: PPC: Book3S HV: Preserve userspace HTM state +properly", 2017-06-15) added code to read transactional memory (TM) +registers but forgot to enable TM before doing so. The result is +that if userspace does have live values in the TM registers, a KVM_RUN +ioctl will cause a host kernel crash like this: + +[ 181.328511] Unrecoverable TM Unavailable Exception f60 at d00000001e7d9980 +[ 181.328605] Oops: Unrecoverable TM Unavailable Exception, sig: 6 [#1] +[ 181.328613] SMP NR_CPUS=2048 +[ 181.328613] NUMA +[ 181.328618] PowerNV +[ 181.328646] Modules linked in: vhost_net vhost tap nfs_layout_nfsv41_files rpcsec_gss_krb5 nfsv4 dns_resolver nfs ++fscache xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat ++nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 tun ebtable_filter ebtables ++ip6table_filter ip6_tables iptable_filter bridge stp llc kvm_hv kvm nfsd ses enclosure scsi_transport_sas ghash_generic ++auth_rpcgss gf128mul xts sg ctr nfs_acl lockd vmx_crypto shpchp ipmi_powernv i2c_opal grace ipmi_devintf i2c_core ++powernv_rng sunrpc ipmi_msghandler ibmpowernv uio_pdrv_genirq uio leds_powernv powernv_op_panel ip_tables xfs sd_mod ++lpfc ipr bnx2x libata mdio ptp pps_core scsi_transport_fc libcrc32c dm_mirror dm_region_hash dm_log dm_mod +[ 181.329278] CPU: 40 PID: 9926 Comm: CPU 0/KVM Not tainted 4.12.0+ #1 +[ 181.329337] task: c000003fc6980000 task.stack: c000003fe4d80000 +[ 181.329396] NIP: d00000001e7d9980 LR: d00000001e77381c CTR: d00000001e7d98f0 +[ 181.329465] REGS: c000003fe4d837e0 TRAP: 0f60 Not tainted (4.12.0+) +[ 181.329523] MSR: 9000000000009033 +[ 181.329527] CR: 24022448 XER: 00000000 +[ 181.329608] CFAR: d00000001e773818 SOFTE: 1 +[ 181.329608] GPR00: d00000001e77381c c000003fe4d83a60 d00000001e7ef410 c000003fdcfe0000 +[ 181.329608] GPR04: c000003fe4f00000 0000000000000000 0000000000000000 c000003fd7954800 +[ 181.329608] GPR08: 0000000000000001 c000003fc6980000 0000000000000000 d00000001e7e2880 +[ 181.329608] GPR12: d00000001e7d98f0 c000000007b19000 00000001295220e0 00007fffc0ce2090 +[ 181.329608] GPR16: 0000010011886608 00007fff8c89f260 0000000000000001 00007fff8c080028 +[ 181.329608] GPR20: 0000000000000000 00000100118500a6 0000010011850000 0000010011850000 +[ 181.329608] GPR24: 00007fffc0ce1b48 0000010011850000 00000000d673b901 0000000000000000 +[ 181.329608] GPR28: 0000000000000000 c000003fdcfe0000 c000003fdcfe0000 c000003fe4f00000 +[ 181.330199] NIP [d00000001e7d9980] kvmppc_vcpu_run_hv+0x90/0x6b0 [kvm_hv] +[ 181.330264] LR [d00000001e77381c] kvmppc_vcpu_run+0x2c/0x40 [kvm] +[ 181.330322] Call Trace: +[ 181.330351] [c000003fe4d83a60] [d00000001e773478] kvmppc_set_one_reg+0x48/0x340 [kvm] (unreliable) +[ 181.330437] [c000003fe4d83b30] [d00000001e77381c] kvmppc_vcpu_run+0x2c/0x40 [kvm] +[ 181.330513] [c000003fe4d83b50] [d00000001e7700b4] kvm_arch_vcpu_ioctl_run+0x114/0x2a0 [kvm] +[ 181.330586] [c000003fe4d83bd0] [d00000001e7642f8] kvm_vcpu_ioctl+0x598/0x7a0 [kvm] +[ 181.330658] [c000003fe4d83d40] [c0000000003451b8] do_vfs_ioctl+0xc8/0x8b0 +[ 181.330717] [c000003fe4d83de0] [c000000000345a64] SyS_ioctl+0xc4/0x120 +[ 181.330776] [c000003fe4d83e30] [c00000000000b004] system_call+0x58/0x6c +[ 181.330833] Instruction dump: +[ 181.330869] e92d0260 e9290b50 e9290108 792807e3 41820058 e92d0260 e9290b50 e9290108 +[ 181.330941] 792ae8a4 794a1f87 408204f4 e92d0260 <7d4022a6> f9490ff0 e92d0260 7d4122a6 +[ 181.331013] ---[ end trace 6f6ddeb4bfe92a92 ]--- + +The fix is just to turn on the TM bit in the MSR before accessing the +registers. + +Fixes: 46a704f8409f ("KVM: PPC: Book3S HV: Preserve userspace HTM state properly") +Reported-by: Jan Stancek +Tested-by: Jan Stancek +Signed-off-by: Paul Mackerras +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kvm/book3s_hv.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/powerpc/kvm/book3s_hv.c ++++ b/arch/powerpc/kvm/book3s_hv.c +@@ -1971,6 +1971,8 @@ static int kvmppc_vcpu_run_hv(struct kvm + run->fail_entry.hardware_entry_failure_reason = 0; + return -EINVAL; + } ++ /* Enable TM so we can read the TM SPRs */ ++ mtmsr(mfmsr() | MSR_TM); + current->thread.tm_tfhar = mfspr(SPRN_TFHAR); + current->thread.tm_tfiar = mfspr(SPRN_TFIAR); + current->thread.tm_texasr = mfspr(SPRN_TEXASR); diff --git a/queue-3.18/md-raid5-add-thread_group-worker-async_tx_issue_pending_all.patch b/queue-3.18/md-raid5-add-thread_group-worker-async_tx_issue_pending_all.patch new file mode 100644 index 00000000000..1c765d5d081 --- /dev/null +++ b/queue-3.18/md-raid5-add-thread_group-worker-async_tx_issue_pending_all.patch @@ -0,0 +1,39 @@ +From 7e96d559634b73a8158ee99a7abece2eacec2668 Mon Sep 17 00:00:00 2001 +From: Ofer Heifetz +Date: Mon, 24 Jul 2017 09:17:40 +0300 +Subject: md/raid5: add thread_group worker async_tx_issue_pending_all + +From: Ofer Heifetz + +commit 7e96d559634b73a8158ee99a7abece2eacec2668 upstream. + +Since thread_group worker and raid5d kthread are not in sync, if +worker writes stripe before raid5d then requests will be waiting +for issue_pendig. + +Issue observed when building raid5 with ext4, in some build runs +jbd2 would get hung and requests were waiting in the HW engine +waiting to be issued. + +Fix this by adding a call to async_tx_issue_pending_all in the +raid5_do_work. + +Signed-off-by: Ofer Heifetz +Signed-off-by: Shaohua Li +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/raid5.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -5224,6 +5224,8 @@ static void raid5_do_work(struct work_st + pr_debug("%d stripes handled\n", handled); + + spin_unlock_irq(&conf->device_lock); ++ ++ async_tx_issue_pending_all(); + blk_finish_plug(&plug); + + pr_debug("--- raid5worker inactive\n"); diff --git a/queue-3.18/series b/queue-3.18/series index 31ca9345c7f..490ed0da2a6 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -2,3 +2,6 @@ af_key-add-lock-to-key-dump.patch pstore-make-spinlock-per-zone-instead-of-global.patch net-reduce-skb_warn_bad_offload-noise.patch powerpc-pseries-fix-of_node_put-underflow-during-reconfig-remove.patch +kvm-ppc-book3s-hv-enable-tm-before-accessing-tm-registers.patch +md-raid5-add-thread_group-worker-async_tx_issue_pending_all.patch +drm-vmwgfx-fix-gcc-7.1.1-warning.patch -- 2.47.3