Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp245216pxb; Thu, 31 Mar 2022 04:35:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxa3jzUK/xYNJPtQE1f8DuA+bdarvXuMLlZqjmBy/tuEeWMMOaqhLDdFRcMx/SrqaIm9a1e X-Received: by 2002:a17:907:1b1f:b0:6e4:b202:db68 with SMTP id mp31-20020a1709071b1f00b006e4b202db68mr1666564ejc.294.1648726541842; Thu, 31 Mar 2022 04:35:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648726541; cv=none; d=google.com; s=arc-20160816; b=ia1IyuPgK0eMNsxfJNd1XU+9Oa0ykxjDLGQIB67yxTaoe6WFFSetAh4LQD98NvNwC0 TBXths7zj8Yp02yUOjjUdjTclauVnjYB4Pwbbr7WLCgyxXT97Ff7WKoykBugpcrutYON SSpLlmsmgcF02YgeCp/rMfTzDO8xbmT6t5V3nc3zUDcOCamR0M6vs8ZA6oztnjF1by3A rXyz1ti7I4FjdauQYa9gwEQAcYjCtScYxFU/VP0U9Lv5XiN0aLMI7mguQA41XH8iqdT3 ZLO+82pjNyVISxyL/LE4HQlCqEdPdS5tw1M0Mif+KDgUwfpf8/IPtvHU0reGYNw39xYT GRcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=RT2WVAdGmt5yB7lGgMACQN/kNUA9xzS38SNMaKOXH2Y=; b=NX35sRH3QVdcJdz1w5yMBlKYU3LR+CdWsUcuR+h1oTatPSpnvCWldxwjTKGgXA0Ada gYQGpZtkbmIBNenjiZu0WeRCHZ73FxyO7BdJKIVYeL/ue4X6Ey0U5nbtpAIw3KucB9r1 K/MkT9DkXFPdHWPgImmZNLL5y0YjLnIuUOPns6R7SUy47YaWQmN13J6Pk8U9M4zB8xnB gMWz04aKIK8suMy+I4ZZVOJq0mhoeg/Fmo/PYE9j1JcxV/H6QvKa/nHeuTKp4TraP5DG RF+t6R/WMxs6yvqeWyLya4ol5x0oZPRLeJZphxfjKjj4Ul7+C5eXAb9LRrWYXSOnClbb 6s8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n5ZEKmp+; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a170906b18200b006df76385c9bsi20197819ejy.315.2022.03.31.04.35.16; Thu, 31 Mar 2022 04:35:41 -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=@kernel.org header.s=k20201202 header.b=n5ZEKmp+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbiCaIwG (ORCPT + 99 others); Thu, 31 Mar 2022 04:52:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233317AbiCaIvq (ORCPT ); Thu, 31 Mar 2022 04:51:46 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEEBD496BB for ; Thu, 31 Mar 2022 01:49:59 -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 sin.source.kernel.org (Postfix) with ESMTPS id EDC54CE20D7 for ; Thu, 31 Mar 2022 08:49:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04D44C340EE; Thu, 31 Mar 2022 08:49:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648716596; bh=6vdyoQjwpV7r2hRyShWcXBmnOHhJS2KSz+S81lCGn9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n5ZEKmp+Kl6F25RLj7q/Qjv0H9abT1GhXMlE3HCH6mF2K1fgavpYhFRaBmeWbtbQT 58s+As1jBgTvUv1F1dIel+wRQiN/cwhNuwIbPzZP/8FV1m6KnCcAuY+zCfrEFZCNIj 8tQGMoO/zICfzRp8/jFblej2GFz1xemAZQfUy774GydEIiWfvIx+2JyJlJTUJk0iCj KiymVkyBbZcb9IkLeKU+ReBCOp1tL9raMJGtOcMQWlJSv/EQZmYBBoDsMNK7XQLfte BgXQwoyhVTiKFPxNGBBVBt69QtVxYy3jMv1sKniOLJ6OzRvUSWUKG1xwe14ClrxTaj pqss+DFFy3IUg== From: SeongJae Park To: akpm@linux-foundation.org Cc: andreyknvl@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH for-mm 3/3] arch/arm64: Set HAVE_SHADOW_STACKTRACE depends on SHADOW_CALL_STACK Date: Thu, 31 Mar 2022 08:49:39 +0000 Message-Id: <20220331084939.26749-4-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220331084939.26749-1-sj@kernel.org> References: <20220331084939.26749-1-sj@kernel.org> 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 The arm64 implementation of arch_stack_walk_shadow(), which is introduced by commit 8cdc580c5ca2 ("arm64: implement stack_trace_save_shadow") of -mm, uses task_scs(), which depends on SHADOW_CALL_STACK, but arm64 Kconfig unconditionally sets HAVE_SHADOW_STACKTRACE. As a result, below build error happens when SHADOW_CALL_STACK is unset. /linux/arch/arm64/kernel/stacktrace.c: In function 'arch_stack_walk_shadow': /linux/arch/arm64/kernel/stacktrace.c:289:13: error: implicit declaration of function 'task_scs'; did you mean 'task_lock'? [-Werror=implicit-function-declaration] 289 | scs_base = task_scs(current); | ^~~~~~~~ | task_lock This commit fixes the error by making HAVE_SHADOW_STACKTRACE depends on SHADOW_CALL_STACK and impelmentation of arch_stack_walk_shadow() depends on HAVE_SHADOW_STACKTRACE. Fixes: 8cdc580c5ca2 ("arm64: implement stack_trace_save_shadow") of -mm Signed-off-by: SeongJae Park --- arch/arm64/Kconfig | 2 +- arch/arm64/kernel/stacktrace.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index d9325dd95eba..67358860d51e 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -201,7 +201,7 @@ config ARM64 select HAVE_FUNCTION_ARG_ACCESS_API select MMU_GATHER_RCU_TABLE_FREE select HAVE_RSEQ - select HAVE_SHADOW_STACKTRACE + select HAVE_SHADOW_STACKTRACE if CONFIG_SHADOW_CALL_STACK select HAVE_STACKPROTECTOR select HAVE_SYSCALL_TRACEPOINTS select HAVE_KPROBES diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index 89daa710d91b..7e824aeb06f9 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c @@ -213,6 +213,8 @@ noinline notrace void arch_stack_walk(stack_trace_consume_fn consume_entry, walk_stackframe(task, &frame, consume_entry, cookie); } +#ifdef CONFIG_HAVE_SHADOW_STACKTRACE + static const struct { unsigned long ** __percpu saved; unsigned long ** __percpu base; @@ -293,3 +295,5 @@ noinline notrace int arch_stack_walk_shadow(unsigned long *store, preempt_enable(); return len; } + +#endif /* CONFIG_HAVE_SHADOW_STACKTRACE */ -- 2.17.1