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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFEF9C41513 for ; Mon, 31 Jul 2023 11:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232198AbjGaLRt (ORCPT ); Mon, 31 Jul 2023 07:17:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231942AbjGaLRm (ORCPT ); Mon, 31 Jul 2023 07:17:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48753E6C for ; Mon, 31 Jul 2023 04:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690802216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+0D5IDco97vTYvh6fNm/B5oplVBZcV0X3CdU07UZHvk=; b=MTfLqBeNmzydu8o7PYl0NQaBneTqj+4IYUDyelf2pEZgYuMdKIfophppcTfVyhG4v5OhnL CD1go5dS+YDlw3NRPl+GeCJv9gIS3akE2qL+49twL+jw5SWIaEdKjzId8W7grcJBEeJnFU Pj0A5Y2U4daoE8TkSpRgV37c5xPNEE0= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-436-qPO7PffpNiaJWT_-Edq0JQ-1; Mon, 31 Jul 2023 07:16:55 -0400 X-MC-Unique: qPO7PffpNiaJWT_-Edq0JQ-1 Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-447669e08bcso675554137.2 for ; Mon, 31 Jul 2023 04:16:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690802215; x=1691407015; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+0D5IDco97vTYvh6fNm/B5oplVBZcV0X3CdU07UZHvk=; b=I4Fg7UPSHtBFFnghUrAW9+E2fROY3k86fQOap0QmRBZL6fTYyVc4WAWYgjHIDzStA0 hTEcfJ3M50INgWi/d4OfyJwHIR8KLRdOWnsPiDRar4PVFf0f30hYhcoRZ09LmC6yRapD g211o+OM/kL3TlU60hXvWVhPV5N8cM8ANyNCthJFDq7gH1FvKUAHJEeuH2idPtd2z9Yr d7+AOp/+wJAFLPBYL7sbcds1rCOan/Cu0CxMTGQp59KYtM8hPZwBspvcUhLZOR9qShri h0Ak0gXeI4hjommZMLLqp2gd1ZzJxwdITOcfdmUoh7N9JNsyDGzN1Wh3xshTHR1606Vz SrrA== X-Gm-Message-State: ABy/qLYA+TSBnelL5kuoCBGp+ES3GYIGgnNPfWf73aLiqVPHfYyApRjQ 8BW4Lsu5NHjQhFA3eWxhPZgqhC0omm2atwHEAh3Fo/APO+paW5NcZDAlFYiCfGadAIRTjqKJTp/ PSa9Ai6hjPvyVJHJACe6n X-Received: by 2002:a67:cfc7:0:b0:443:92a5:f454 with SMTP id h7-20020a67cfc7000000b0044392a5f454mr4890273vsm.26.1690802214765; Mon, 31 Jul 2023 04:16:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlGotwePfsXKLeBlKhf8sO13ly4OfXrqZZNVUmXDsF4Tb1xqGBmiDGw9g/K6bGBIoBOR4Hianw== X-Received: by 2002:a67:cfc7:0:b0:443:92a5:f454 with SMTP id h7-20020a67cfc7000000b0044392a5f454mr4890212vsm.26.1690802214510; Mon, 31 Jul 2023 04:16:54 -0700 (PDT) Received: from vschneid.remote.csb ([149.12.7.81]) by smtp.gmail.com with ESMTPSA id r7-20020a0c8d07000000b0063d119034a9sm3601878qvb.140.2023.07.31.04.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 04:16:53 -0700 (PDT) From: Valentin Schneider To: Josh Poimboeuf 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 In-Reply-To: <20230728160014.vjxikkoo4rieng55@treble> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-14-vschneid@redhat.com> <20230728160014.vjxikkoo4rieng55@treble> Date: Mon, 31 Jul 2023 12:16:43 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 28/07/23 11:00, Josh Poimboeuf wrote: > 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. > Ack, I'll reverse the order of these. > 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. > Looks better indeed, thanks! > -- > Josh