Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2925040rwb; Mon, 15 Aug 2022 14:10:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR43BK1rZLElEG84EjZ7VHP6eRoZ/BJrrXe5aT0/OvSRvfGMSYvQogoEnQSjEF3h0baXAcZo X-Received: by 2002:a17:90b:3b8d:b0:1f7:2b01:b97a with SMTP id pc13-20020a17090b3b8d00b001f72b01b97amr29140813pjb.209.1660597801738; Mon, 15 Aug 2022 14:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597801; cv=none; d=google.com; s=arc-20160816; b=iLq9XA4eb0en3KqmFUnONNNgDyq7N591k9JX2gQ7B7a9+Xa7sOQTAzCHZuXr61GbK/ egyadUfcLLZ8+j6IOUHVc0M4yKBxLVdFja9wt8o5Q3I0XpMHrArRKXRRq/JMLytBS+Rk yw+X3xIbVCa39GcAo40Q7ZzFdOjZfnUyYBUkzhg2EVJ9fz64jUMw+7Q+Xz8J3DMrWSPb UEQKQceh2zcKjBCX9altV4BsE1oIJEa7H4TelK568Odkd0+rTsNaOdmaXFxwwWKW4GCA BEHqhZ5AeQmnzSbYy8+n+oBFVasG/Ia9+HsOUlD7T33IUWTn/7EAZ+xza5LaGXoFC11P 4qWA== 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=gYQylpIMAU0zOmwMnFbtYmuTnWqa7LYs/5vP+ZDYEsg=; b=VrLqBtSp/Cv3wNe7S0jVfWdg2UOuBPKfI/GoN6YeY2ayc5+G2+Dv4rSHGnOLNcNmRs C6v8wjQ7eEbvmKMo9WilCHZDOaRtPdKBmnrA6JO9a4G2FANBALFwkCyXaBpnCLrMhVf3 35MHYYKbqXaTxjAL8ZfJLZUZyJ+JKFMM3tMtuXev52wF6YvyK/GbU6f/Yj03p7PE6lSJ h0/1ioWCP0ylnS0Xnotm7Yy6CAD0p8rf00Cgxl9wQhdU//PGqGYQRcSqFA4JpcDbN6XX yoWdzr2GU5Iea+bZMHSUmLz2exIgqxhlUwL/heEwiytzTUXCcoCveZD51zL2osnnnHNe WW9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1D8fU87J; 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 n8-20020a63a508000000b0041bf4bfc9f7si864426pgf.74.2022.08.15.14.09.50; Mon, 15 Aug 2022 14:10:01 -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=1D8fU87J; 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 S233394AbiHOTyV (ORCPT + 99 others); Mon, 15 Aug 2022 15:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344612AbiHOTxW (ORCPT ); Mon, 15 Aug 2022 15:53:22 -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 3FDAF75381; Mon, 15 Aug 2022 11:51:02 -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 D0BE860C0B; Mon, 15 Aug 2022 18:51:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF283C433C1; Mon, 15 Aug 2022 18:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589461; bh=LR3N5+oQRgb7cEg49ztNE+Ds4xKavOMtfP3KjrzlCi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1D8fU87JzlKk94yuryPXtPZNXsLKsxdZP3eMn2/V0lU9aqRZ8YAqU3Y5hZvsen5va qQeteEo5FkISC4KCdOcYkpN9F9tyRn9GSAvNGs1fcQJnUDIFdeYXASNcCySkAvm53V w9KvPtBOpdNGCDIKGoOg5R+l35fYV82UKTlG84AU= 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.15 724/779] locking/csd_lock: Change csdlock_debug from early_param to __setup Date: Mon, 15 Aug 2022 20:06:08 +0200 Message-Id: <20220815180408.415618303@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 b68d63e965db..82825345432c 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