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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 837D1C0015E for ; Fri, 28 Jul 2023 16:00:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFF356B0071; Fri, 28 Jul 2023 12:00:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EAF786B0074; Fri, 28 Jul 2023 12:00:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D28E38D0001; Fri, 28 Jul 2023 12:00:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id BFEAB6B0071 for ; Fri, 28 Jul 2023 12:00:34 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7082E4076C for ; Fri, 28 Jul 2023 16:00:34 +0000 (UTC) X-FDA: 81061483188.09.30A3555 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 206F9C0008 for ; Fri, 28 Jul 2023 16:00:26 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Td4BxKeL; spf=pass (imf22.hostedemail.com: domain of jpoimboe@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jpoimboe@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690560027; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3aGrW0IQyT3La9CRuaC2jUphugYjZI6MlFQJuSuPlJA=; b=fHhgeygt7bHJm01N78UB7BmJ6qWnBfFwU5WW0r0Tp7IAZf822LeyvA9rfsxn0ayXmTMYex Rle1SiK5q9LTQLDShn68/rbmaK6FyDHYAlRZuWoJMSf/xZ9RDS1yGtPCsBSJif/TCVlpf/ LDUVeCsir7NVKsBFyY2H+wdyt+eNYWM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Td4BxKeL; spf=pass (imf22.hostedemail.com: domain of jpoimboe@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jpoimboe@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690560027; a=rsa-sha256; cv=none; b=cQwEqLWkzzEo3PdYWrp4yoeZru4Fu+DpuCSdC6c8T996UnjKef63+PgXGZjlaa/Aid5n+Z VO+1UgfO6fyaVz8L77eGJplzVLAQGqLnynqNUD+6rPv3Q80Y9joo5bbI9spUz/s+LARcqL RMbCi3Jmvke7jugkQhDQT5xB5gKH2pw= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 85DB762196; Fri, 28 Jul 2023 16:00:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95828C433C8; Fri, 28 Jul 2023 16:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690560024; bh=hYf2rKT66EA0CLZn0dh5++ZEnZG97g1m9o59RcdzOUI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Td4BxKeLp8QaPwWqHQy6Fx8W2LrPCrYUlu1FHCBUsHZ8/LXjVoR3VvSXxZEnMOk+8 i337flH1gYWa/tB98k96VkLHwDSJ+1PwC98Kzs1DyywIpuw5G7NXMPM3FLfSrU1/tC cBI6M2GLk95RDUgycJ7+eBXJGEKJyIkwRBbAKoJNmRJunmbvtQI5nDCnoXjP/MQf1D 3yLjOHYu0p2S53UnrI14nFrYm+1xXZxoO7U7N+5vLDMvCBs59Sf7pwbG6y4K8qb+UV 73axdh7/A0S74p9M6VVrD8rFpNpgPlupr2+Ne5VA9RxvXeOoCAEAAxKv1+S9w1/tRQ v+JeeohU1wfFw== Date: Fri, 28 Jul 2023 11:00:14 -0500 From: Josh Poimboeuf To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, x86@kernel.org, rcu@vger.kernel.org, linux-kselftest@vger.kernel.org, Steven Rostedt , Masami Hiramatsu , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Andy Lutomirski , Peter Zijlstra , Frederic Weisbecker , "Paul E. McKenney" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Jason Baron , Kees Cook , Sami Tolvanen , Ard Biesheuvel , Nicholas Piggin , Juerg Haefliger , Nicolas Saenz Julienne , "Kirill A. Shutemov" , Nadav Amit , Dan Carpenter , Chuang Wang , Yang Jihong , Petr Mladek , "Jason A. Donenfeld" , Song Liu , Julian Pidancet , Tom Lendacky , Dionna Glaze , Thomas =?utf-8?Q?Wei=C3=9Fschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 13/20] context_tracking: Make context_tracking_key __ro_after_init Message-ID: <20230728160014.vjxikkoo4rieng55@treble> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-14-vschneid@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230720163056.2564824-14-vschneid@redhat.com> X-Rspamd-Queue-Id: 206F9C0008 X-Rspam-User: X-Stat-Signature: 8qdicd6xfxgkgyaijj5udn76ojdb4rni X-Rspamd-Server: rspam01 X-HE-Tag: 1690560026-62632 X-HE-Meta: U2FsdGVkX1+F/VzSeJWoC6cvMg7ks5WQQJxtZKyRiSNOC7pfgEMw3eZcKyXWtb/UFvcW4WTrO+3BqivK88Uidd3WkV5yRjB1lu4HPr2SGdpX96fSt0kJuvrA1195z22u5E9qequY7KYRF42Vmy+Ab+oJb0rB5MAWWMIZ1DD/cpbbCsSuRB+K8oVEnQiiM9jA7WHet1X2frIRnJamLSrTh38iYYGJpsR6Yb+VX3SPZRfKJSiLonDkZwvGtf8ePnJtUll146a+B3ThGwuNkne2wDmJTxgH++DTwZYU9DMNFwXGrHpQXwzpXxSFHdoAR+vqV93TweVA3GaQxBsC+tYJ9UFYFyyP07Uh5DxZGMI+BZq3kQQwlEvwNV6ykzY7h6IdtX3CebtT7BCQfVKxdSzO9nXQujcwrjW1AIiP+gJwcBMNzEJ09IV3KdrN001I/oaSBC0Vz93kP1NxeT8F7vaHLNFWg8MDJCtwA0jwX0mOKkFmX7QdGw9ThWIvX3IFdDDYyUMe+pmKcXsPNNa8bMWI8Wl2A/Wa9uv7/SB63YY9LuJ2at5/Buw+sU1YhlEr6KOE1OzDMCUxs9DsqJaClAL1RBMDJSYOJK70Sm90xnJ5ODrIwrONVvvMVo5Yt3ZbRLywYJRjOKughuqcTacjDpmp3rdpFowpaCWoUmbZZAWOTvWRadwRjVtTpWUp/ly4oq5yZdAwbaxgbXHMsdJSlQqkDQKsi18NIHLkautU0pW40m0kuQ3LnGtx0jLOzdN+aWwepsP2ww4dVZNG+nAV98yv6DSEZQa72KTA7C+n4Ku3a4WmM8bDLZFQGRSLmDMG/lktlE2K0FgmmI8fx/RddMpcJ9K7/4pvD4YQcZ8y8ZmaKO51wQE0RHLju+Gsj7QHA8XZiXe73xrefZzTB4pVXX+sFKaYYWTTJnAAVpVmD0BdRideyek/HVJpilUv+uUShxiG3CIGuHeo6Qje8hJJyIP 8izPciTd oJfbr+OruBc9wU6pEoUr17PZnJ45OBuWiO8/teVMg6K8IxODRhNnAq3vYljzCMeJQ4t7OiTuAogCES4uFlnDv7xaEnhbQReypDrMRvB9QKZfoidqyXEBDCaGNvjbAT4Fotdh9NlY4LcN8tJRUhEKlaPJWGSV20m404TbmAEsWJX3Hohma1xrJ85xaYwsXi/DQGM26etFfjmGhSFLVTaryjh8+vZCqQgTwN6r0VFWLLKy5ZQc68LAh4ZFW41qJNonxT/lD0jweLxyPZblts5WElC6PRwddDCEjIa39Wq0hB+qZFWmUF911jbN4bL7MVhHRsHFGDs8Yv01vh/tTRnlKPaIf/q5nEVTjUfpp576fT53F/3/0J0ys+PNx5IC6EWo6w0m8TdDSSoAv5CPjpwGtiekdatIclzTB6tykX4XvbJzAhW4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jul 20, 2023 at 05:30:49PM +0100, Valentin Schneider wrote: > objtool now warns about it: > > vmlinux.o: warning: objtool: enter_from_user_mode+0x4e: Non __ro_after_init static key "context_tracking_key" in .noinstr section > vmlinux.o: warning: objtool: enter_from_user_mode+0x50: Non __ro_after_init static key "context_tracking_key" in .noinstr section > vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x60: Non __ro_after_init static key "context_tracking_key" in .noinstr section > vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x62: Non __ro_after_init static key "context_tracking_key" in .noinstr section > [...] > > The key can only be enabled (and not disabled) in the __init function > ct_cpu_tracker_user(), so mark it as __ro_after_init. > > Signed-off-by: Valentin Schneider It's best to avoid temporarily introducing warnings. Bots will rightfully complain about that. This patch and the next one should come before the objtool patches. Also it would be helpful for the commit log to have a brief justification for the patch beyond "fix the objtool warning". Something roughly like: Soon, runtime-mutable text won't be allowed in .noinstr sections, so that a code patching IPI to a userspace-bound CPU can be safely deferred to the next kernel entry. 'context_tracking_key' is only enabled in __init ct_cpu_tracker_user(). Mark it as __ro_after_init. -- Josh