From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 51501C3A5A2 for ; Sun, 22 Sep 2019 18:47:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2126C214AF for ; Sun, 22 Sep 2019 18:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569178078; bh=n0YP2zWRVCxk4rF17AJs7NMY8AhDufGUs2cq5yP0HdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=f5MNCktziHXJRvBqsU0ccm5Jc2L4yj/qc8G75+HwGIgx5oDP4vEjm2Cth10ZTHV1V NGbQJzAl3V7/efsDQt32oxBSn84TTc02Hx3HCJt+DB0jeWnP2FSuYuvuiczxcKO+lf 7kXf9YktulResb1dz/LohyeQrcIUfqRpRjvzvWko= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391270AbfIVSr5 (ORCPT ); Sun, 22 Sep 2019 14:47:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:44352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391165AbfIVSrs (ORCPT ); Sun, 22 Sep 2019 14:47:48 -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 7F15C2186A; Sun, 22 Sep 2019 18:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569178068; bh=n0YP2zWRVCxk4rF17AJs7NMY8AhDufGUs2cq5yP0HdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MSX8+Oh+JsILnGqh8pFgizAoBKEUohZSur/eMkgrjf0/QwIqqBqB6+YOwow4fYsDu u6OEUdEXbBUiHZx4g5Hf7BKZcT8+loM+ooEsYedaIS8klpiOvBMf6JP/ZNVAaR5/iA 6gQgCp5znYU4mf9OLzEY4CYHUs8T1sbpsQP1rygA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrew Murray , Peter Zijlstra , Mark Rutland , Will Deacon , Sasha Levin Subject: [PATCH AUTOSEL 5.3 141/203] jump_label: Don't warn on __exit jump entries Date: Sun, 22 Sep 2019 14:42:47 -0400 Message-Id: <20190922184350.30563-141-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190922184350.30563-1-sashal@kernel.org> References: <20190922184350.30563-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: Andrew Murray [ Upstream commit 8f35eaa5f2de020073a48ad51112237c5932cfcc ] On architectures that discard .exit.* sections at runtime, a warning is printed for each jump label that is used within an in-kernel __exit annotated function: can't patch jump_label at ehci_hcd_cleanup+0x8/0x3c WARNING: CPU: 0 PID: 1 at kernel/jump_label.c:410 __jump_label_update+0x12c/0x138 As these functions will never get executed (they are free'd along with the rest of initmem) - we do not need to patch them and should not display any warnings. The warning is displayed because the test required to satisfy jump_entry_is_init is based on init_section_contains (__init_begin to __init_end) whereas the test in __jump_label_update is based on init_kernel_text (_sinittext to _einittext) via kernel_text_address). Fixes: 19483677684b ("jump_label: Annotate entries that operate on __init code earlier") Signed-off-by: Andrew Murray Acked-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- kernel/jump_label.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/jump_label.c b/kernel/jump_label.c index df3008419a1d0..cdb3ffab128b6 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c @@ -407,7 +407,9 @@ static bool jump_label_can_update(struct jump_entry *entry, bool init) return false; if (!kernel_text_address(jump_entry_code(entry))) { - WARN_ONCE(1, "can't patch jump_label at %pS", (void *)jump_entry_code(entry)); + WARN_ONCE(!jump_entry_is_init(entry), + "can't patch jump_label at %pS", + (void *)jump_entry_code(entry)); return false; } -- 2.20.1