Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1003760yba; Thu, 4 Apr 2019 02:11:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxa6YjC2ESCtlr4e+tSQAIZYZ2TczOGRebXZDyrvZSRmYLvygcw2SGE+/p9jIOiSceFx0sc X-Received: by 2002:a62:6086:: with SMTP id u128mr4746970pfb.148.1554369100123; Thu, 04 Apr 2019 02:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554369100; cv=none; d=google.com; s=arc-20160816; b=cZnSnafB+8EoSUIi9dcFYO+4kxxgSMpBPe8ZFJjXHH62stbeo96teErPmTVzYDVRXM UxaR74htG3lHuk7WaoE5Lq0kdyvDj7G6srOSgZ7wg4W6xf7KIPbvZzBnuwrtgqh4jz0H 5nU6VJG1YuxWx+Vvl5Zq9n4EDkghpn5NlxBqPuCCQkWIpKh6USdTGDk7xrIVhr6pZ8jt rwx6O4yrqrIg5wpgqZgOLcZ84Nmw53Ykk8Motn/R4XbV2e9NcOqeBXbmu0LDdPK1kdF1 +hoEL0pXeej/NopefvrNdh3SB4f2JVCBYnNbeo6KYDCFkPMB1CWdf/EaSPH7V5BMNWH1 42kg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=INo5OSj0vrP4H5bbBz/sZsjoEO+FZVfRhRssiuzoQGM=; b=b1bLERwUieKqICksYQfcCXAm7LGaJd45YwEQs/KzUjVDUYzO5uzN2oEWDckpIDHJpu BwwN6Db52fN6kcpClWc+Lw0gXUAzZKyWFIuCZBMjvwkZKxl2ixgp6Awj6pvSZqepsS5L cDAWydOKZb87u4H0X5F7VzAFmv5Ho/jD+Us5qNuNW2jnwnOmGEzWmB1Zg6mcYIEte9S9 o9fWV9LvLDgDYF6qdADua1RYlotB26qju739MTrMJsIAxSCyj/6YP5s76+6PV1hiGRmO SgZBAeyph6WNyJi9bSjRqS0fTW4aEX21E3lAaAwadJg78FnJCYUbMjzTyo4aKhD9FzTd L9Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DaIbw9QJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si16384025plg.187.2019.04.04.02.11.25; Thu, 04 Apr 2019 02:11:40 -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=DaIbw9QJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733068AbfDDJKt (ORCPT + 99 others); Thu, 4 Apr 2019 05:10:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:50508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733050AbfDDJKq (ORCPT ); Thu, 4 Apr 2019 05:10:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C25720855; Thu, 4 Apr 2019 09:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369044; bh=OuzFGTJeJIhRcW0mPeAJD9fEShjlpYFy6n8FmiHYUZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DaIbw9QJ9aA9XOVadTs4Gwj7yWXSW1hqzBPmWepBf2AuPAjCOZEOSrvrTcJAK9aar jOOS0U7+uaLUe+GpmATP4Qylo/kMTXMXM701h5A1MhmgPXICI6k0g2wVhdfrbB6Im3 BylDMZzlpWW3gqYNeKczrQ8tlF+mAC7xekpjrcFI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Andrzej Siewior , Russell King , Sasha Levin Subject: [PATCH 5.0 077/246] ARM: 8840/1: use a raw_spinlock_t in unwind Date: Thu, 4 Apr 2019 10:46:17 +0200 Message-Id: <20190404084621.832276832@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084619.236418459@linuxfoundation.org> References: <20190404084619.236418459@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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