Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3120492rwb; Mon, 15 Aug 2022 18:37:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR4UAccOPIYa1Uk1HNDNZUkqLqJOw4jAXl1QREqhU+7KmUHHPS5Mn1PIp0M0rcW9f4x5pGSE X-Received: by 2002:a17:902:e804:b0:16f:4a25:b5be with SMTP id u4-20020a170902e80400b0016f4a25b5bemr20273597plg.171.1660613835947; Mon, 15 Aug 2022 18:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613835; cv=none; d=google.com; s=arc-20160816; b=dBVvmzRaqQBPvvN+x9T8Wpynv8GIz/8Rx/d7eU9YlxSbWMmrVrjLf2F5l0yoXsuh44 UT4vTSlqCRfBaCnhWHE3JYXJc5PMgQSgLBNWTjfpO7vD74Qh+wpjxFsMDuxDE+uQzI4F wzTwGX1VaqolUXI//PKx8mIkdF/clfB7WXB/ZVtV27rlHTzMbNTodLYVn+wJS4RFFRuN Vyn5OZD8zrC9/eSNoskbox6sc+w0IthveprZFxea4UZB/nyDmdB8LGkzYrRvmk+kQgfG OjYC01ttWpTr8Ay1NlHGjdPuqWN9rU/2X8GSDUG+jw4XIfr0/MgHyTvzIrDX9j9AUajw XeGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OAT1yR3mkuafNEkmxuyHT8V6PBhcQg7oTBk+8KKhfiY=; b=Ahz6yd+vB49nNM3YrhlUShoZhIlAypuhDzzRkIuNdzq2EeD9aJIUuQZuavrOjq5FjD 9W33MqQO9wIqoZkkGoLtdfD/Y9Wz6iQ0NZCjMRNmBy6YrBCYDam+fAsQ0DwSXzv68m5b LaN5hronBb4/R7IglKGRpp+F/PVvkF8l9+PWwY/rB4nu2zW9HvP3vikkwWa8ZOJMnJ79 5l9gQmxqTZGziYOsL10jpJN5dZUbLnpkFXMfecFqhKgkFIfj9+YmHIUfKmJ19XmGBv8o 0RAfKw7Gc0Y/PH1H2Bvvf5jLHfAgxbZRoGoAeaa4gD5HcDP4Ts8xklatxDmjsVD36wR5 gnbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B532pCkx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020a17090a841700b001f3e1e8f91fsi11359145pjn.22.2022.08.15.18.37.05; Mon, 15 Aug 2022 18:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B532pCkx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243513AbiHPA7c (ORCPT + 99 others); Mon, 15 Aug 2022 20:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348112AbiHPAv7 (ORCPT ); Mon, 15 Aug 2022 20:51:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BD57DA3CD; Mon, 15 Aug 2022 13:47:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B2EB661243; Mon, 15 Aug 2022 20:47:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0880C433C1; Mon, 15 Aug 2022 20:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596434; bh=tsPlihmV5dGw+NFAqtrd4NLGkbFtK11xTNILVrWVyfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B532pCkxtuFhh9N7/yM13N/2NdnaNE3VIWsPwP9wgv/nvd/ISfjmFRrFjNYkD7kFA OGYcQUad4aiNkDVJZyGOPwo62E2B3F3HaHziDcK891LhKYexQ9eEHW7zarrPmdmPBJ bjMfbT/te5cp8OEG98i0F2IRZc/cffv4Pb0iH8YM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen jingwen , Chen Zhongjin , "Paul E. McKenney" , Sasha Levin Subject: [PATCH 5.19 1077/1157] locking/csd_lock: Change csdlock_debug from early_param to __setup Date: Mon, 15 Aug 2022 20:07:13 +0200 Message-Id: <20220815180523.215327068@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen Zhongjin [ Upstream commit 9c9b26b0df270d4f9246e483a44686fca951a29c ] The csdlock_debug kernel-boot parameter is parsed by the early_param() function csdlock_debug(). If set, csdlock_debug() invokes static_branch_enable() to enable csd_lock_wait feature, which triggers a panic on arm64 for kernels built with CONFIG_SPARSEMEM=y and CONFIG_SPARSEMEM_VMEMMAP=n. With CONFIG_SPARSEMEM_VMEMMAP=n, __nr_to_section is called in static_key_enable() and returns NULL, resulting in a NULL dereference because mem_section is initialized only later in sparse_init(). This is also a problem for powerpc because early_param() functions are invoked earlier than jump_label_init(), also resulting in static_key_enable() failures. These failures cause the warning "static key 'xxx' used before call to jump_label_init()". Thus, early_param is too early for csd_lock_wait to run static_branch_enable(), so changes it to __setup to fix these. Fixes: 8d0968cc6b8f ("locking/csd_lock: Add boot parameter for controlling CSD lock debugging") Cc: stable@vger.kernel.org Reported-by: Chen jingwen Signed-off-by: Chen Zhongjin Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin --- kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index dd215f439426..650810a6f29b 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -174,9 +174,9 @@ static int __init csdlock_debug(char *str) if (val) static_branch_enable(&csdlock_debug_enabled); - return 0; + return 1; } -early_param("csdlock_debug", csdlock_debug); +__setup("csdlock_debug=", csdlock_debug); static DEFINE_PER_CPU(call_single_data_t *, cur_csd); static DEFINE_PER_CPU(smp_call_func_t, cur_csd_func); -- 2.35.1