From: Greg Kroah-Hartman Date: Wed, 4 Jun 2014 16:00:25 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.14.6~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5971d7157f0bf4097ba54e5007c3046a4345deb7;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: powerpc-tm-fix-crash-when-forking-inside-a-transaction.patch --- diff --git a/queue-3.10/iwlwifi-pcie-disable-interrupts-upon-pcie-alloc.patch b/queue-3.10/iwlwifi-pcie-disable-interrupts-upon-pcie-alloc.patch deleted file mode 100644 index 19ae46b2bfd..00000000000 --- a/queue-3.10/iwlwifi-pcie-disable-interrupts-upon-pcie-alloc.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 83f7a85f1134c6e914453f5747435415a23d516b Mon Sep 17 00:00:00 2001 -From: Emmanuel Grumbach -Date: Sun, 13 Apr 2014 16:03:11 +0300 -Subject: iwlwifi: pcie: disable interrupts upon PCIe alloc - -From: Emmanuel Grumbach - -commit 83f7a85f1134c6e914453f5747435415a23d516b upstream. - -In case RFKILL is in KILL position, the NIC will issue an -interrupt straight away. This interrupt won't be sent -because it is masked in the hardware. -But if our interrupt service routine is called for another -reason (SHARED_IRQ), then we'll look at the interrupt cause -and service it. This can cause bad things if we are not -ready yet. -Explicitly clean the interrupt cause register to make sure -we won't service anything before we are ready to. - -Reported-and-tested-by: Alexander Monakov -Reviewed-by: Johannes Berg -Signed-off-by: Emmanuel Grumbach -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/net/wireless/iwlwifi/pcie/trans.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - ---- a/drivers/net/wireless/iwlwifi/pcie/trans.c -+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c -@@ -1538,6 +1538,10 @@ struct iwl_trans *iwl_trans_pcie_alloc(s - * PCI Tx retries from interfering with C3 CPU state */ - pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00); - -+ trans->dev = &pdev->dev; -+ trans_pcie->pci_dev = pdev; -+ iwl_disable_interrupts(trans); -+ - err = pci_enable_msi(pdev); - if (err) { - dev_err(&pdev->dev, "pci_enable_msi failed(0X%x)\n", err); -@@ -1549,8 +1553,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(s - } - } - -- trans->dev = &pdev->dev; -- trans_pcie->pci_dev = pdev; - trans->hw_rev = iwl_read32(trans, CSR_HW_REV); - trans->hw_id = (pdev->device << 16) + pdev->subsystem_device; - snprintf(trans->hw_id_str, sizeof(trans->hw_id_str), -@@ -1574,8 +1576,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(s - if (!trans->dev_cmd_pool) - goto out_pci_disable_msi; - -- trans_pcie->inta_mask = CSR_INI_SET_MASK; -- - if (iwl_pcie_alloc_ict(trans)) - goto out_free_cmd_pool; - -@@ -1586,6 +1586,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(s - goto out_free_ict; - } - -+ trans_pcie->inta_mask = CSR_INI_SET_MASK; -+ - return trans; - - out_free_ict: diff --git a/queue-3.10/powerpc-tm-fix-crash-when-forking-inside-a-transaction.patch b/queue-3.10/powerpc-tm-fix-crash-when-forking-inside-a-transaction.patch new file mode 100644 index 00000000000..b690104e8ee --- /dev/null +++ b/queue-3.10/powerpc-tm-fix-crash-when-forking-inside-a-transaction.patch @@ -0,0 +1,69 @@ +From 621b5060e823301d0cba4cb52a7ee3491922d291 Mon Sep 17 00:00:00 2001 +From: Michael Neuling +Date: Mon, 3 Mar 2014 14:21:40 +1100 +Subject: powerpc/tm: Fix crash when forking inside a transaction + +From: Michael Neuling + +commit 621b5060e823301d0cba4cb52a7ee3491922d291 upstream. + +When we fork/clone we currently don't copy any of the TM state to the new +thread. This results in a TM bad thing (program check) when the new process is +switched in as the kernel does a tmrechkpt with TEXASR FS not set. Also, since +R1 is from userspace, we trigger the bad kernel stack pointer detection. So we +end up with something like this: + + Bad kernel stack pointer 0 at c0000000000404fc + cpu 0x2: Vector: 700 (Program Check) at [c00000003ffefd40] + pc: c0000000000404fc: restore_gprs+0xc0/0x148 + lr: 0000000000000000 + sp: 0 + msr: 9000000100201030 + current = 0xc000001dd1417c30 + paca = 0xc00000000fe00800 softe: 0 irq_happened: 0x01 + pid = 0, comm = swapper/2 + WARNING: exception is not recoverable, can't continue + +The below fixes this by flushing the TM state before we copy the task_struct to +the clone. To do this we go through the tmreclaim patch, which removes the +checkpointed registers from the CPU and transitions the CPU out of TM suspend +mode. Hence we need to call tmrechkpt after to restore the checkpointed state +and the TM mode for the current task. + +To make this fail from userspace is simply: + tbegin + li r0, 2 + sc + + +Kudos to Adhemerval Zanella Neto for finding this. + +Signed-off-by: Michael Neuling +cc: Adhemerval Zanella Neto +Signed-off-by: Benjamin Herrenschmidt +[Backported to 3.10: context adjust] +Signed-off-by: Xue Liu +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/kernel/process.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/arch/powerpc/kernel/process.c ++++ b/arch/powerpc/kernel/process.c +@@ -948,6 +948,16 @@ int arch_dup_task_struct(struct task_str + flush_altivec_to_thread(src); + flush_vsx_to_thread(src); + flush_spe_to_thread(src); ++ /* ++ * Flush TM state out so we can copy it. __switch_to_tm() does this ++ * flush but it removes the checkpointed state from the current CPU and ++ * transitions the CPU out of TM mode. Hence we need to call ++ * tm_recheckpoint_new_task() (on the same task) to restore the ++ * checkpointed state back and the TM mode. ++ */ ++ __switch_to_tm(src); ++ tm_recheckpoint_new_task(src); ++ + *dst = *src; + return 0; + } diff --git a/queue-3.10/series b/queue-3.10/series index e75842adc9f..7b76dc7f192 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -78,7 +78,6 @@ bus-mvebu-mbus-allow-several-windows-with-the-same-target-attribute.patch percpu-make-pcpu_alloc_chunk-use-pcpu_mem_free-instead-of-kfree.patch xen-blkfront-revoke-foreign-access-for-grants-not-mapped-by-the-backend.patch xen-blkfront-restore-the-non-persistent-data-path.patch -iwlwifi-pcie-disable-interrupts-upon-pcie-alloc.patch asoc-wm8962-update-register-class_d_control_1-to-be-non-volatile.patch metag-fix-memory-barriers.patch metag-reduce-maximum-stack-size-to-256mb.patch @@ -88,3 +87,4 @@ pci-shpchp-check-bridge-s-secondary-not-primary-bus-speed.patch target-iser-fix-wrong-connection-requests-list-addition.patch target-iser-fix-iscsit_accept_np-and-rdma_cm-racy-flow.patch target-don-t-allow-setting-wc-emulation-if-device-doesn-t-support.patch +powerpc-tm-fix-crash-when-forking-inside-a-transaction.patch