Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5615853img; Wed, 27 Mar 2019 11:46:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsENm72WZfol1ePP2h+sdzQwRzLoCXGsaIuoAZkWcIARGAI92de3N5avYxiZutYRAaRue2 X-Received: by 2002:a17:902:6942:: with SMTP id k2mr38903393plt.136.1553712397961; Wed, 27 Mar 2019 11:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712397; cv=none; d=google.com; s=arc-20160816; b=0nOAl1Sxc626165hg63jp/nXTwHKmV9uUBYlvMLpPyQZ3yW3tVBMhORZ+1vEF0xZoH bxNriQ2Pgu3M35TIRKm5NONzcsCiFucqlKF5BrOZOtBTAsSivMsb0X7SpjVHl4FWyU+s L4w42fEovlyt0KKvlKmVX1A66QoCxD//Qcprq3wf8XSK2EPNmbS5erMZ2522Nu+jW5r7 Ds8aDfH7yXjXAbOaNCvCWnRc/R3EKfb2NToEnBL0zgmYEWkqpqv4A5z3fS2l70zelmzY HJa5Grx1BWIPDcQ3xW1ikGO0HDGwxnB7RZcfq7gFf8vwA+xPQ7ZJ2Qxxl74XHQRkaULB 5KnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zjlS+UxTGeDUJFqv10OzIojrR9S10RYqSe4UWnTJICg=; b=XZMth31qXd9lPWahiuPPvnrXjRL6AZzy2vqRMZlUFFKDXEy91GwJSQRBvbUE2fNKuW hvFjHdMLa60S4tGIT/nVNBdsOVWNNq9NlkeOTwkuNT52hqhxDLF4qctALL5rlnK7BcwA 5vPo2EMiotndvxVGT+PKdO548ySD04C7gsi7y19HstMGJbNQkkjUIdBXc8G2Uv1Z5yrC KbryBTegU5y7wSHFbAQmhvNpsIpwk+0w6hLAGX2mzXmevdTLENbTPhgPjvUSOXivkFdX sBB/PPjNW423fPaaGk9pov86+BgiStymZycHXsJaIbqtPK+qnbd4HzNg8j8IJ8Ylwot6 lYmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="XWXU/t7f"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j8si18447439pgq.542.2019.03.27.11.46.21; Wed, 27 Mar 2019 11:46:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="XWXU/t7f"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392028AbfC0Snq (ORCPT + 99 others); Wed, 27 Mar 2019 14:43:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:39390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391180AbfC0SVa (ORCPT ); Wed, 27 Mar 2019 14:21:30 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E28932063F; Wed, 27 Mar 2019 18:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710889; bh=XX8Hn9a9Oah4IHGno6eDUs0zRW/pen3d/J+I3YWdfkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XWXU/t7fUzIIVEOmQqN5Bojquw+03wRnkXmSe1hCwTU5LeDs4eRJaadfhv9NGWr7a bG8vhTjbl/XKByIn8CX8e6dBYsyvwN6WcFsC9gSGsveJH3YYuZHGGviO6VNDTew9O+ 2ipBsUfm46fZh1C945Cs7IKdIPplswQiRz5eMCpE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sebastian Andrzej Siewior , Russell King , Sasha Levin Subject: [PATCH AUTOSEL 4.9 29/87] ARM: 8840/1: use a raw_spinlock_t in unwind Date: Wed, 27 Mar 2019 14:19:42 -0400 Message-Id: <20190327182040.17444-29-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Andrzej Siewior [ Upstream commit 74ffe79ae538283bbf7c155e62339f1e5c87b55a ] Mostly unwind is done with irqs enabled however SLUB may call it with irqs disabled while creating a new SLUB cache. I had system freeze while loading a module which called kmem_cache_create() on init. That means SLUB's __slab_alloc() disabled interrupts and then ->new_slab_objects() ->new_slab() ->setup_object() ->setup_object_debug() ->init_tracking() ->set_track() ->save_stack_trace() ->save_stack_trace_tsk() ->walk_stackframe() ->unwind_frame() ->unwind_find_idx() =>spin_lock_irqsave(&unwind_lock); Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/kernel/unwind.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index 0bee233fef9a..314cfb232a63 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -93,7 +93,7 @@ extern const struct unwind_idx __start_unwind_idx[]; static const struct unwind_idx *__origin_unwind_idx; extern const struct unwind_idx __stop_unwind_idx[]; -static DEFINE_SPINLOCK(unwind_lock); +static DEFINE_RAW_SPINLOCK(unwind_lock); static LIST_HEAD(unwind_tables); /* Convert a prel31 symbol to an absolute address */ @@ -201,7 +201,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr) /* module unwind tables */ struct unwind_table *table; - spin_lock_irqsave(&unwind_lock, flags); + raw_spin_lock_irqsave(&unwind_lock, flags); list_for_each_entry(table, &unwind_tables, list) { if (addr >= table->begin_addr && addr < table->end_addr) { @@ -213,7 +213,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr) break; } } - spin_unlock_irqrestore(&unwind_lock, flags); + raw_spin_unlock_irqrestore(&unwind_lock, flags); } pr_debug("%s: idx = %p\n", __func__, idx); @@ -529,9 +529,9 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size, tab->begin_addr = text_addr; tab->end_addr = text_addr + text_size; - spin_lock_irqsave(&unwind_lock, flags); + raw_spin_lock_irqsave(&unwind_lock, flags); list_add_tail(&tab->list, &unwind_tables); - spin_unlock_irqrestore(&unwind_lock, flags); + raw_spin_unlock_irqrestore(&unwind_lock, flags); return tab; } @@ -543,9 +543,9 @@ void unwind_table_del(struct unwind_table *tab) if (!tab) return; - spin_lock_irqsave(&unwind_lock, flags); + raw_spin_lock_irqsave(&unwind_lock, flags); list_del(&tab->list); - spin_unlock_irqrestore(&unwind_lock, flags); + raw_spin_unlock_irqrestore(&unwind_lock, flags); kfree(tab); } -- 2.19.1