From patchwork Mon Jul 12 06:06:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 475804 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA89DC11F69 for ; Mon, 12 Jul 2021 07:10:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF4C7610CD for ; Mon, 12 Jul 2021 07:10:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242756AbhGLHMJ (ORCPT ); Mon, 12 Jul 2021 03:12:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:42548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244254AbhGLHKc (ORCPT ); Mon, 12 Jul 2021 03:10:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A1B6E613D9; Mon, 12 Jul 2021 07:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626073651; bh=khWwxZN4Q9keLfsKl4AnOJt4up4F52KZlZIRb/onXjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YvloNJSV/MQhbsHShNrlpF5p8DXw9DeL2T7ZHwN4Mjm0MRJNFKc3K3tDUwCB2qsdw LSwBXS3TioEyvu1kIULIkYAxYm4TmVVyYl01uN57ZINED99p8dgQZJ7euHLXux181N npP6bWeo1w5xv3cadHF7YJZdsAAzdXNKFW3xZhh0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Joerg Roedel , Sasha Levin Subject: [PATCH 5.12 314/700] lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING Date: Mon, 12 Jul 2021 08:06:37 +0200 Message-Id: <20210712061009.749925429@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Peter Zijlstra [ Upstream commit c0c2c0dad6a06e0c05e9a52d65f932bd54364c97 ] When PROVE_RAW_LOCK_NESTING=y many of the selftests FAILED because HARDIRQ context is out-of-bounds for spinlocks. Instead make the default hardware context the threaded hardirq context, which preserves the old locking rules. The wait-type specific locking selftests will have a non-threaded HARDIRQ variant. Fixes: de8f5e4f2dc1 ("lockdep: Introduce wait-type checks") Signed-off-by: Peter Zijlstra (Intel) Tested-by: Joerg Roedel Link: https://lore.kernel.org/r/20210617190313.322096283@infradead.org Signed-off-by: Sasha Levin --- lib/locking-selftest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c index 2d85abac1744..0f6b262e0964 100644 --- a/lib/locking-selftest.c +++ b/lib/locking-selftest.c @@ -194,6 +194,7 @@ static void init_shared_classes(void) #define HARDIRQ_ENTER() \ local_irq_disable(); \ __irq_enter(); \ + lockdep_hardirq_threaded(); \ WARN_ON(!in_irq()); #define HARDIRQ_EXIT() \