Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1052293pxk; Mon, 31 Aug 2020 08:32:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGRfI5pImIZ1WwYuWJrbF4itL7xHL0PDpAAPAHeOTU98HAcWPfCvCERwDg6CSKZtFdMEUq X-Received: by 2002:a17:906:a40d:: with SMTP id l13mr1688622ejz.283.1598887923448; Mon, 31 Aug 2020 08:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598887923; cv=none; d=google.com; s=arc-20160816; b=W/+NSe56N0dJ9TbMZtRsZ2anu7fWczLSdT7MKPQvtzNFmz6r2cEDhxRLc22G5AzPe3 GZ7m9CGO9vTA7AYmcoCh3+lmrIKzfkYFh+0PkyUiRLjFhVs0x07U0tEKgzrMwwcHly50 VnaxN7bZzRiTC1cmdmMvufsWupSQFRBpU1Fby8dMMI60DO2K4cGYpprAwHrCSF09yHWS TfYbtYP8ZSJEa6ED0yQayHnW/CniGJESH4Qgt6l2UcYv+MvB74lyz2UOAo7p4vJ4VwNH 8OR1A5QpRWsUm1QHpsGel0iGvBp6Jwy2wM0IEIltYcOgFfifWGHBB1W+IWJBXSxpag4d f5eQ== 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=uKvqsWBktIVGtRuXOYJU6OLKRFPDoFOh60LAioIfzhQ=; b=PjrmlFRSSmN56cCXpAHGtr0VtQyhYoR9wa9J9DnYIMpk7mz9H1tRXU0lk7vqkkGBYF 3ZV4mALRCw34qqetS3QxZepDJvO2Ww8/onZqg0KfEOQxZoF8pH/fYI437QO/TG2oKgQq DaxZ6D2vjEt5RgcY3w9IvvRxLpYzZfqV45mnhMFwHbcUvoih1sWhEVgZ5l4l83Rn2YYF wWqD5ny49J77OKWn2pVhui7V0mEiCQBb4ymt4oYOM10VyPUuDxLyEdqSuO6S3kA4jVWE SGZkUMw87ujrFUWLS+9uoKjPXeOQa+EEjcfNlX5nNiYuYRHP8ilYMlJsOnWX0WJBxMoP 8ecA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YjSHxr61; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id e3si5664584ejq.508.2020.08.31.08.31.39; Mon, 31 Aug 2020 08:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YjSHxr61; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728679AbgHaPag (ORCPT + 99 others); Mon, 31 Aug 2020 11:30:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:39672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728596AbgHaPaW (ORCPT ); Mon, 31 Aug 2020 11:30:22 -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 6D81D20E65; Mon, 31 Aug 2020 15:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598887822; bh=9xF3pCnhJDst3nnSSl/WT0nA5l0CMHpfotCF6C81O0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YjSHxr61VUT3UPbWJL73q/Ct2C3IyWkF+2I/pY0BYETGutVpk6eQ1bYGXpm0k+VAr gcZP712Bo64+jrXjeh2G9cdo09UcAuX2sOwWJNoyG036Sm1M0EwQ71ZpMq1s72aMhn /u4kdPc7WnuCcCeA2c50+lF6tUILPvSRK7IP8FXc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sven Schnelle , Vasily Gorbik , Sasha Levin , linux-s390@vger.kernel.org Subject: [PATCH AUTOSEL 5.8 32/42] s390: don't trace preemption in percpu macros Date: Mon, 31 Aug 2020 11:29:24 -0400 Message-Id: <20200831152934.1023912-32-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831152934.1023912-1-sashal@kernel.org> References: <20200831152934.1023912-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review 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: Sven Schnelle [ Upstream commit 1196f12a2c960951d02262af25af0bb1775ebcc2 ] Since commit a21ee6055c30 ("lockdep: Change hardirq{s_enabled,_context} to per-cpu variables") the lockdep code itself uses percpu variables. This leads to recursions because the percpu macros are calling preempt_enable() which might call trace_preempt_on(). Signed-off-by: Sven Schnelle Reviewed-by: Vasily Gorbik Signed-off-by: Vasily Gorbik Signed-off-by: Sasha Levin --- arch/s390/include/asm/percpu.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h index 50b4ce8cddfdc..918f0ba4f4d20 100644 --- a/arch/s390/include/asm/percpu.h +++ b/arch/s390/include/asm/percpu.h @@ -29,7 +29,7 @@ typedef typeof(pcp) pcp_op_T__; \ pcp_op_T__ old__, new__, prev__; \ pcp_op_T__ *ptr__; \ - preempt_disable(); \ + preempt_disable_notrace(); \ ptr__ = raw_cpu_ptr(&(pcp)); \ prev__ = *ptr__; \ do { \ @@ -37,7 +37,7 @@ new__ = old__ op (val); \ prev__ = cmpxchg(ptr__, old__, new__); \ } while (prev__ != old__); \ - preempt_enable(); \ + preempt_enable_notrace(); \ new__; \ }) @@ -68,7 +68,7 @@ typedef typeof(pcp) pcp_op_T__; \ pcp_op_T__ val__ = (val); \ pcp_op_T__ old__, *ptr__; \ - preempt_disable(); \ + preempt_disable_notrace(); \ ptr__ = raw_cpu_ptr(&(pcp)); \ if (__builtin_constant_p(val__) && \ ((szcast)val__ > -129) && ((szcast)val__ < 128)) { \ @@ -84,7 +84,7 @@ : [val__] "d" (val__) \ : "cc"); \ } \ - preempt_enable(); \ + preempt_enable_notrace(); \ } #define this_cpu_add_4(pcp, val) arch_this_cpu_add(pcp, val, "laa", "asi", int) @@ -95,14 +95,14 @@ typedef typeof(pcp) pcp_op_T__; \ pcp_op_T__ val__ = (val); \ pcp_op_T__ old__, *ptr__; \ - preempt_disable(); \ + preempt_disable_notrace(); \ ptr__ = raw_cpu_ptr(&(pcp)); \ asm volatile( \ op " %[old__],%[val__],%[ptr__]\n" \ : [old__] "=d" (old__), [ptr__] "+Q" (*ptr__) \ : [val__] "d" (val__) \ : "cc"); \ - preempt_enable(); \ + preempt_enable_notrace(); \ old__ + val__; \ }) @@ -114,14 +114,14 @@ typedef typeof(pcp) pcp_op_T__; \ pcp_op_T__ val__ = (val); \ pcp_op_T__ old__, *ptr__; \ - preempt_disable(); \ + preempt_disable_notrace(); \ ptr__ = raw_cpu_ptr(&(pcp)); \ asm volatile( \ op " %[old__],%[val__],%[ptr__]\n" \ : [old__] "=d" (old__), [ptr__] "+Q" (*ptr__) \ : [val__] "d" (val__) \ : "cc"); \ - preempt_enable(); \ + preempt_enable_notrace(); \ } #define this_cpu_and_4(pcp, val) arch_this_cpu_to_op(pcp, val, "lan") @@ -136,10 +136,10 @@ typedef typeof(pcp) pcp_op_T__; \ pcp_op_T__ ret__; \ pcp_op_T__ *ptr__; \ - preempt_disable(); \ + preempt_disable_notrace(); \ ptr__ = raw_cpu_ptr(&(pcp)); \ ret__ = cmpxchg(ptr__, oval, nval); \ - preempt_enable(); \ + preempt_enable_notrace(); \ ret__; \ }) @@ -152,10 +152,10 @@ ({ \ typeof(pcp) *ptr__; \ typeof(pcp) ret__; \ - preempt_disable(); \ + preempt_disable_notrace(); \ ptr__ = raw_cpu_ptr(&(pcp)); \ ret__ = xchg(ptr__, nval); \ - preempt_enable(); \ + preempt_enable_notrace(); \ ret__; \ }) @@ -171,11 +171,11 @@ typeof(pcp1) *p1__; \ typeof(pcp2) *p2__; \ int ret__; \ - preempt_disable(); \ + preempt_disable_notrace(); \ p1__ = raw_cpu_ptr(&(pcp1)); \ p2__ = raw_cpu_ptr(&(pcp2)); \ ret__ = __cmpxchg_double(p1__, p2__, o1__, o2__, n1__, n2__); \ - preempt_enable(); \ + preempt_enable_notrace(); \ ret__; \ }) -- 2.25.1