Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp3189566ybj; Mon, 23 Sep 2019 16:36:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyg706K0YWSDr3Cz9OqcUNHZAHCSlmtsTrXSpzxnx6pSkxFnExTeBH0yUqkbI6Lo5A6oU6Y X-Received: by 2002:a05:6402:1212:: with SMTP id c18mr2073094edw.259.1569281811894; Mon, 23 Sep 2019 16:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569281811; cv=none; d=google.com; s=arc-20160816; b=ccdQTF3MSB5miJorKCMSHW6RwK12NN9HwQ2RULqdtH091krqP1ukfA158TXSVfn/Uo g7grSfWYo30IMgqG6THwZdhf/DvcDw2hyUB05DiUhoXpEbj0S3gfDFxPmTcQPFZYfzDv J5xmc6u9lTDrDImSfX3zU5osamxT4Hx+du7dyWTN3kE0DerHgHUjeaEEbNWn313AvHLX LoLjF3jy/WN+WSf6JqEmfzYlaTtOzd/iDmmi/8U890UH1LHXUUx6y9cKeEsJd7bX2oSl UY9VJSjPVlMivbPUIHHXBlPeyELL2H6lIOwP1t6VtDaXSnxLGhyCnvmg15iETQvC79hr 9WVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SWZgoPVpG44qL2LGNNlcpLH/PBmP5NI89uGXV3bgGNU=; b=fsEv1BYlxmvN/ocxz+tFMTU7ui1aLrfexIG2Recxb7K0N5iZaXbiNheGjpjSeBGSnJ wLErUnww7RdmyyOQG80xHcpD5CrOIHyr+YxtIDrRpxtpeuBf66DOfMVNo8eXJFMR1tZp wuJeMbQoX3qf6UcFlM5KPJPLhJqjXJ8r4UiugkHXAQce/LhUOzZUftLqbLJ8cZm9QXx1 9ShafFofAFmQuN2lHdMsorRMHc1L7OhpmT+kyZSfS7qqoQ6N93r1LfApkn6NoRM9UM5P xeoeN9ixW37t3bUSjgsdfPROuRNBiUFZ7w47PfnPKINt3JI96jjxo8jGoaz8tDO0nJXM dytA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MSX8+Oh+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si5628720ejx.68.2019.09.23.16.36.28; Mon, 23 Sep 2019 16:36:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MSX8+Oh+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2391256AbfIVSr4 (ORCPT + 99 others); Sun, 22 Sep 2019 14:47:56 -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