Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1459979rwb; Fri, 28 Jul 2023 09:40:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlEmzZt+q8tY3BOK7WkMjGTt1mZZJWOVCn3Y35gXVa54Rmfet3g7zA1vHsSAFCEzhqeqPPYT X-Received: by 2002:a17:902:a50a:b0:1bb:d860:9efd with SMTP id s10-20020a170902a50a00b001bbd8609efdmr2443640plq.15.1690562409042; Fri, 28 Jul 2023 09:40:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690562409; cv=none; d=google.com; s=arc-20160816; b=0G5nhhNJStg1AanUGt4F504tZRdqiQSoqN3mEdJgJFBAij7M+oCEuTnyp5Vm2W4gis aY8JwvkQ+/V9XTDk3VoHmMSkHBvIlrBvsLcI8y1fLi7D6L6h4DYA90SPClOhd4soDfqS KkJbqnbO471a3RVaN1PZD3NXb6cKD+KO7vxsFYuvBMoDefa52rZgv4Qh6JvLfV8KutEA i4dfKdFgXxtIqH4b6SV59b2yXHL4omkELPifYzdCaJTB+XsAG42LdhQg9RDkvEkzRs/i QH/VP2/zjSvIdyWtGo2vXwkdh03TfDGpF1aUdos7jYc8rp6FMweAY919h8IuxnztRuEV U0iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3aGrW0IQyT3La9CRuaC2jUphugYjZI6MlFQJuSuPlJA=; fh=ssCX1sjd5qt88BaR0yRNXggTpiVPA/EDtQ2IicSMeXY=; b=fwjx9uR6slVnmjOAgrXPVQldy0m3VuOnUU/g/iEXQCeq6mg3BgQ+8obPB62szW4acL D8gsicVPeL+4zeFpaNPGt241y+ymuxpX5m9SjOCD6/zknxs3a0YdBHNUidQtAdJxImNy C4zhXFguqm1JSkdgisYJ+czxgNfX9c/70X2t/sIit+rIWwYXhJVOw8Bbt9F0GHxPTiid 81EZT/4OmWpJ7hwgZEElZQTnuVEa2r6Eawmd/qhz/A1SrLjiWevyQL55JDXL6HozqHD6 2mMIKH2ZUFLmgOTsFHoNsP5wwq2sYHOOuedNdOP+NDAIgWYERWG2JhMTXSmywqCOEz2p oXCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Td4BxKeL; 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 le4-20020a170902fb0400b001b8a3894576si3175229plb.64.2023.07.28.09.39.57; Fri, 28 Jul 2023 09:40:09 -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=Td4BxKeL; 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 S236641AbjG1QA3 (ORCPT + 99 others); Fri, 28 Jul 2023 12:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234529AbjG1QA0 (ORCPT ); Fri, 28 Jul 2023 12:00:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5E0D110; Fri, 28 Jul 2023 09:00:25 -0700 (PDT) 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 846536217D; 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-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 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