Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4469752pxj; Wed, 12 May 2021 06:24:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzt8/3Z98BrjRdQuSF1TjIrnmiZJ88NDD/HwlQolAd4/fi5m1iUHDSk1U+4QXrJE70leKy X-Received: by 2002:a17:906:251a:: with SMTP id i26mr37996708ejb.367.1620825858487; Wed, 12 May 2021 06:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620825858; cv=none; d=google.com; s=arc-20160816; b=uO42Y95Zpu2lOp8qAXvs5w1cQ9R4C0gnEKQHH2cEKfk6CPbH5sWr5gpf4tRW2HyE3d +dVWGbI9JGHgwVQazXpMhSlpC47Mw7KsUE1puWOLHVokIDITp7CBslPET6KXVl9iQ+Ww 4kkJitWYL04a1tSAgsp1udIhM5edIqGiiQHnv8DpVzp2XCY5MiDm4pKny1RWKWEq/hC7 ioV92FThccSqlfgj1Z96loi8eypnc+ei3KkHk9bW1UxOsCTdatacW9UdZLuE50HclIZ7 FW4wGeU9OfF1ChHRJYaFWrtFYqTYJU/OwZ7q0QSTpoDbUyqdc6ycklXR2gP5CfHljLsu l4ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Acq0UiJu58fd3XBYYmXKUmlAZxKkkJxpU8hN1cbC8o4=; b=WvDByKvmWcAPQuAEp/s9axq5/5ZupakO7L6Dt/r5/Vs4FfVApM1LCC3bcLCCfuArV0 6YbIX6tJQOcDxPruxQjqCcXW69jjTSxuLdt513oygLCabuDh3zlnSGNCZCo02v80FNJI Rsx1BRPFrfLirxH/Efio3vcj6/+U8Y3/Y9l4TpaOxKKkckmu8wNN+/p7IQji4Smd/w6k g7Pera87ya1OFNzxIxcndU99MeAu5eafQJY0QNGlGQMDOqu7xMt7wLyhJ5wY0CCxE/7L YR+rs1NOEvDIVoAb2z2pG9+mVEbOqf2sq+yOn3d9TTVy3obeq0ScWBQGjrqle73g8JZe O/8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=r4n8tK44; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id br1si152439ejb.367.2021.05.12.06.23.54; Wed, 12 May 2021 06:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=r4n8tK44; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231998AbhELNVQ (ORCPT + 99 others); Wed, 12 May 2021 09:21:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbhELNU7 (ORCPT ); Wed, 12 May 2021 09:20:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C891DC06174A; Wed, 12 May 2021 06:19:51 -0700 (PDT) Date: Wed, 12 May 2021 13:19:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1620825590; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Acq0UiJu58fd3XBYYmXKUmlAZxKkkJxpU8hN1cbC8o4=; b=r4n8tK44m/3lLHM0nkdi/EhfDGwzH0AAlJgupTcARQU5dCVQ7Fyw+6GxbD9zFnRI5MSl6K DJw3IM7ttlc3M1V1DbA24xYxgahT7N3XlcAV2PLK4TjKrjeTJI3T/o5cqTWcLhW6jH74yv 2zHtJu9V15EjAql6P/pHj5oVB31dilTYw47gAuZgSSlPswoHDAYB4HjvGZCge/fQ8hTg11 fGpx3jIB0CZFq5cW/12RwvgbyqQBP3t7zmKKvUS2nunYdl13aVs0KRSFXot1TBkFKMr+UA L4cliDveGDVfqtBOyevANoBSnSQJw2bwNwral0g1lIPVtBzSmxNhM3Pu2jWoOQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1620825590; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Acq0UiJu58fd3XBYYmXKUmlAZxKkkJxpU8hN1cbC8o4=; b=CN43NJ5p9IxxwCspl/S91345QDpJGct8DLYrL0aapRfsGuXNporyWoX/iTaWTW9Wm/Po+f e97+8Ix4VtmiEDCw== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] jump_label: Free jump_entry::key bit1 for build use Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210506194157.906893264@infradead.org> References: <20210506194157.906893264@infradead.org> MIME-Version: 1.0 Message-ID: <162082558969.29796.11337800382444633961.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the objtool/core branch of tip: Commit-ID: 5af0ea293d78c8b8f0b87ae2b13f7ac584057bc3 Gitweb: https://git.kernel.org/tip/5af0ea293d78c8b8f0b87ae2b13f7ac584057bc3 Author: Peter Zijlstra AuthorDate: Thu, 06 May 2021 21:34:00 +02:00 Committer: Ingo Molnar CommitterDate: Wed, 12 May 2021 14:54:55 +02:00 jump_label: Free jump_entry::key bit1 for build use Have jump_label_init() set jump_entry::key bit1 to either 0 ot 1 unconditionally. This makes it available for build-time games. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210506194157.906893264@infradead.org --- include/linux/jump_label.h | 7 +++++-- kernel/jump_label.c | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 8c45f58..48b9b2a 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h @@ -171,9 +171,12 @@ static inline bool jump_entry_is_init(const struct jump_entry *entry) return (unsigned long)entry->key & 2UL; } -static inline void jump_entry_set_init(struct jump_entry *entry) +static inline void jump_entry_set_init(struct jump_entry *entry, bool set) { - entry->key |= 2; + if (set) + entry->key |= 2; + else + entry->key &= ~2; } static inline int jump_entry_size(struct jump_entry *entry) diff --git a/kernel/jump_label.c b/kernel/jump_label.c index 521cafc..bdb0681 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c @@ -483,13 +483,14 @@ void __init jump_label_init(void) for (iter = iter_start; iter < iter_stop; iter++) { struct static_key *iterk; + bool in_init; /* rewrite NOPs */ if (jump_label_type(iter) == JUMP_LABEL_NOP) arch_jump_label_transform_static(iter, JUMP_LABEL_NOP); - if (init_section_contains((void *)jump_entry_code(iter), 1)) - jump_entry_set_init(iter); + in_init = init_section_contains((void *)jump_entry_code(iter), 1); + jump_entry_set_init(iter, in_init); iterk = jump_entry_key(iter); if (iterk == key) @@ -634,9 +635,10 @@ static int jump_label_add_module(struct module *mod) for (iter = iter_start; iter < iter_stop; iter++) { struct static_key *iterk; + bool in_init; - if (within_module_init(jump_entry_code(iter), mod)) - jump_entry_set_init(iter); + in_init = within_module_init(jump_entry_code(iter), mod); + jump_entry_set_init(iter, in_init); iterk = jump_entry_key(iter); if (iterk == key)