Patch "sparc64: Take ctx_alloc_lock properly in hugetlb_setup()." has been added to the 4.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sparc64: Take ctx_alloc_lock properly in hugetlb_setup().

to the 4.6-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-take-ctx_alloc_lock-properly-in-hugetlb_setup.patch
and it can be found in the queue-4.6 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 Mon Jun 20 10:48:40 PDT 2016
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Wed, 25 May 2016 12:51:20 -0700
Subject: sparc64: Take ctx_alloc_lock properly in hugetlb_setup().

From: "David S. Miller" <davem@xxxxxxxxxxxxx>

[ Upstream commit 9ea46abe22550e3366ff7cee2f8391b35b12f730 ]

On cheetahplus chips we take the ctx_alloc_lock in order to
modify the TLB lookup parameters for the indexed TLBs, which
are stored in the context register.

This is called with interrupts disabled, however ctx_alloc_lock
is an IRQ safe lock, therefore we must take acquire/release it
properly with spin_{lock,unlock}_irq().

Reported-by: Meelis Roos <mroos@xxxxxxxx>
Tested-by: Meelis Roos <mroos@xxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/sparc/mm/init_64.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2824,9 +2824,10 @@ void hugetlb_setup(struct pt_regs *regs)
 	 * the Data-TLB for huge pages.
 	 */
 	if (tlb_type == cheetah_plus) {
+		bool need_context_reload = false;
 		unsigned long ctx;
 
-		spin_lock(&ctx_alloc_lock);
+		spin_lock_irq(&ctx_alloc_lock);
 		ctx = mm->context.sparc64_ctx_val;
 		ctx &= ~CTX_PGSZ_MASK;
 		ctx |= CTX_PGSZ_BASE << CTX_PGSZ0_SHIFT;
@@ -2845,9 +2846,12 @@ void hugetlb_setup(struct pt_regs *regs)
 			 * also executing in this address space.
 			 */
 			mm->context.sparc64_ctx_val = ctx;
-			on_each_cpu(context_reload, mm, 0);
+			need_context_reload = true;
 		}
-		spin_unlock(&ctx_alloc_lock);
+		spin_unlock_irq(&ctx_alloc_lock);
+
+		if (need_context_reload)
+			on_each_cpu(context_reload, mm, 0);
 	}
 }
 #endif


Patches currently in stable-queue which might be from davem@xxxxxxxxxxxxx are

queue-4.6/bpf-inode-disallow-userns-mounts.patch
queue-4.6/vxlan-accept-user-specified-mtu-value-when-create-new-vxlan-link.patch
queue-4.6/sfc-on-mc-reset-clear-pio-buffer-linkage-in-txqs.patch
queue-4.6/ipv6-skip-xfrm-lookup-if-dst_entry-in-socket-cache-is-valid.patch
queue-4.6/l2tp-fix-configuration-passed-to-setup_udp_tunnel_sock.patch
queue-4.6/switchdev-pass-pointer-to-fib_info-instead-of-copy.patch
queue-4.6/tcp-record-tlp-and-er-timer-stats-in-v6-stats.patch
queue-4.6/sparc64-fix-return-from-trap-window-fill-crashes.patch
queue-4.6/macsec-fix-netlink-attribute-for-key-id.patch
queue-4.6/net-nps_enet-disable-interrupts-before-napi-reschedule.patch
queue-4.6/ipv4-fix-non-initialized-ttl-when-config_sysctl-n.patch
queue-4.6/net-mvneta-fix-lacking-spinlock-initialization.patch
queue-4.6/net-stmmac-fix-incorrect-memcpy-source-memory.patch
queue-4.6/bpf-use-mount_nodev-not-mount_ns-to-mount-the-bpf-filesystem.patch
queue-4.6/netlink-fix-dump-skb-leak-double-free.patch
queue-4.6/team-don-t-call-netdev_change_features-under-team-lock.patch
queue-4.6/sparc64-reduce-tlb-flushes-during-hugepte-changes.patch
queue-4.6/net-hwbm-fix-unbalanced-spinlock-in-error-case.patch
queue-4.6/udp-prevent-skbs-lingering-in-tunnel-socket-queues.patch
queue-4.6/bridge-don-t-insert-unnecessary-local-fdb-entry-on-changing-mac-address.patch
queue-4.6/tipc-fix-nametable-publication-field-in-nl-compat.patch
queue-4.6/net-alx-use-custom-skb-allocator.patch
queue-4.6/sparc64-take-ctx_alloc_lock-properly-in-hugetlb_setup.patch
queue-4.6/tipc-check-nl-sock-before-parsing-nested-attributes.patch
queue-4.6/bpf-trace-use-read_once-for-retrieving-file-ptr.patch
queue-4.6/uapi-glibc-compat-fix-compilation-when-__use_misc-in-glibc.patch
queue-4.6/sparc-harden-signal-return-frame-checks.patch
queue-4.6/tuntap-correctly-wake-up-process-during-uninit.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



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]