This is a note to let you know that I've just added the patch titled sparc64: Do not insert non-valid PTEs into the TSB hash table. to the 3.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sparc64-do-not-insert-non-valid-ptes-into-the-tsb-hash-table.patch and it can be found in the queue-3.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Fri Aug 8 09:03:00 PDT 2014 From: "David S. Miller" <davem@xxxxxxxxxxxxx> Date: Mon, 4 Aug 2014 16:34:01 -0700 Subject: sparc64: Do not insert non-valid PTEs into the TSB hash table. From: "David S. Miller" <davem@xxxxxxxxxxxxx> [ Upstream commit 18f38132528c3e603c66ea464727b29e9bbcb91b ] The assumption was that update_mmu_cache() (and the equivalent for PMDs) would only be called when the PTE being installed will be accessible by the user. This is not true for code paths originating from remove_migration_pte(). There are dire consequences for placing a non-valid PTE into the TSB. The TLB miss frramework assumes thatwhen a TSB entry matches we can just load it into the TLB and return from the TLB miss trap. So if a non-valid PTE is in there, we will deadlock taking the TLB miss over and over, never satisfying the miss. Just exit early from update_mmu_cache() and friends in this situation. Based upon a report and patch from Christopher Alexander Tobias Schulze. Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/sparc/mm/init_64.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -350,6 +350,10 @@ void update_mmu_cache(struct vm_area_str mm = vma->vm_mm; + /* Don't insert a non-valid PTE into the TSB, we'll deadlock. */ + if (!pte_accessible(mm, pte)) + return; + spin_lock_irqsave(&mm->context.lock, flags); #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE) @@ -2614,6 +2618,10 @@ void update_mmu_cache_pmd(struct vm_area pte = pmd_val(entry); + /* Don't insert a non-valid PMD into the TSB, we'll deadlock. */ + if (!(pte & _PAGE_VALID)) + return; + /* We are fabricating 8MB pages using 4MB real hw pages. */ pte |= (addr & (1UL << REAL_HPAGE_SHIFT)); Patches currently in stable-queue which might be from davem@xxxxxxxxxxxxx are queue-3.15/sctp-fix-possible-seqlock-seadlock-in-sctp_packet_transmit.patch queue-3.15/net-sendmsg-fix-null-pointer-dereference.patch queue-3.15/sparc64-ldc_connect-should-not-return-einval-when-handshake-is-in-progress.patch queue-3.15/sparc64-do-not-insert-non-valid-ptes-into-the-tsb-hash-table.patch queue-3.15/iovec-make-sure-the-caller-actually-wants-anything-in-memcpy_fromiovecend.patch queue-3.15/net-bcmgenet-correctly-pad-short-packets.patch queue-3.15/net-phy-re-apply-phy-fixups-during-phy_register_device.patch queue-3.15/arch-sparc-math-emu-math_32.c-drop-stray-break-operator.patch queue-3.15/net-correctly-set-segment-mac_len-in-skb_segment.patch queue-3.15/ip-make-ip-identifiers-less-predictable.patch queue-3.15/sparc-hook-up-renameat2-syscall.patch queue-3.15/bnx2x-fix-crash-during-tso-tunneling.patch queue-3.15/bbc-i2c-fix-bbc-i2c-envctrl-on-sunblade-2000.patch queue-3.15/sunsab-fix-detection-of-break-on-sunsab-serial-console.patch queue-3.15/ip_tunnel-ipv4-fix-tunnels-with-local-any-remote-remote_ip.patch queue-3.15/net-sctp-inherit-auth_capable-on-init-collisions.patch queue-3.15/macvlan-initialize-vlan_features-to-turn-on-offload-support.patch queue-3.15/tcp-fix-integer-overflow-in-tcp-vegas.patch queue-3.15/inetpeer-get-rid-of-ip_id_count.patch queue-3.15/bna-fix-performance-regression.patch queue-3.15/sparc64-guard-against-flushing-openfirmware-mappings.patch queue-3.15/tcp-fix-integer-overflows-in-tcp-veno.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html