From patchwork Tue Feb 6 17:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 197573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1706142dyb; Tue, 6 Feb 2024 09:43:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaHQ1ZEWOyjO5QNJiCz6tLN+Xbvy9OCxy9L7uITtim6yIUirOf6OcsefGmKh6yKsABOR+c X-Received: by 2002:a17:90b:1096:b0:296:d466:71a1 with SMTP id gj22-20020a17090b109600b00296d46671a1mr226103pjb.41.1707241396700; Tue, 06 Feb 2024 09:43:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707241396; cv=pass; d=google.com; s=arc-20160816; b=FFmwIAczR1lsKoC1MqmMjFw2Rvjsl8lvAxdAB7p/TnV0WTJdZqUXX4Kd1zMPvTTOLi bDr320tI4whZQp2UY6Xm+bL1a+o3Xqab660V19E3hzVVzlzuSy28hH256dGrt0i9oluD eRrzDcLRvHn9PTJvC5i3SXyOmQlD3I6/cAcM8/gGSenSPvTGMlUYsawdBwyR3naC+7XL 71cYFun+iXwPPXQYSEp4sQpznuTX2QnsYRoYJSQ9whzU3cITKJqslM0BG+IHGkUAjgjb tXDoa3qLGQ0WqtXYoyGia9ZvMBeBvCLSz0b7cidSfC3cZ9MvmJXyenPzAsVIubcVJiEF pIOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wAVeOMisjibwqonq5yPJYQ58Exx1w9fjDotka9U+BN4=; fh=SmvfVPr48tctl7s+0f+gZ7pGHqncCPVKbLhlxef2o9E=; b=Ox5fqd7yQkv7JSdVBX9643Q4iWctxJNEaF2FI6SNuA6SFak9lYwpY9T7wEX+Mli0/M sVJPNgjJ76pqd3HCehlccivdOY6B1FzYZ9Bkeog8NIVs6nF/23QUw1qAhtYDBhsUJvcQ RM5DQXoK6y7GudO7uTN6znLP04VutGnVW1g1JAXb4BM/L4/niQpR0bCAYVr+Tk6YOIXX tLAnOfwqeqKd8V8uMf8jYIvA7UiFBxOnjhQjPQRRM+xCoopswFsqhVIlDEjAwJJ/aOqt iMtY+vvyCbMOpXNJkC8aTGfoNvpS1lPlAx0fjCTfyerAlLvd13qYSEb9JDwgW03iRe5y 5zyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DV5sd2AR; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55413-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55413-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXVIn/orVTqMIxVMum+k/DbuUUyELQ1aR97A+DLwzSjcq9lrdufk2Fjy9Kbu4s9kXB1FSXKb4wPcRfMeRMRakiYj36iaA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v21-20020a17090a899500b002962fe3cd22si1470595pjn.142.2024.02.06.09.43.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 09:43:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55413-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DV5sd2AR; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55413-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55413-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0F14628B377 for ; Tue, 6 Feb 2024 17:42:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 875071B811; Tue, 6 Feb 2024 17:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DV5sd2AR" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E2DC17997 for ; Tue, 6 Feb 2024 17:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707241206; cv=none; b=Cx22cv3tjJeXhJdGtMMEuH/LEke9U2UqQ+EgSiMzI/mzug1wZpkzGStSzHDayxq5EfDM1wXT1LAE0kNdBnJXrwXpbm0Tfb1Z5jQ4kmd+JETeyntvTSUSYscLusEkPhFcf0CfF81ipuuZH7HmJ6m8x20oqJtixpGxtt+JRWhJmK0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707241206; c=relaxed/simple; bh=DFZQ/EilDH1t8WOKFPKN8p7KM/uu/NEDA8dWflqpPdo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ajLeOhAiEtyQHE0LxLljBrOGK3zaXBzIJJUTZYtiV90JCiwV4z6b4Vq0pKV+/T9jy+Gr/EPIzEfPirQsoDK1f2QIv2UeLUS32QGgf8ZJkct5maRFQA7RkZlW0gXY3LAbONWGpyJ+3aezj86NjW3RfF73cYBTAf9tszseyt+NpKU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DV5sd2AR; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707241203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wAVeOMisjibwqonq5yPJYQ58Exx1w9fjDotka9U+BN4=; b=DV5sd2AREkV5t5Omvvp14xpIt2ecI2cA1tRmmhOFwrfxHWbaRyGC0LNWgvEqzd+iwL+s8o N4xcOLld8xm0MHUAPPeUlN0B15KjtXIY6F6LwyBz4rPKUt1QdNGym3crdGyWhsMpoTp6im 2AW9tHASi1UdfgY0sIvnE22wBG2EpOM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-X4XQR69UNdyvfJZ65mDaVw-1; Tue, 06 Feb 2024 12:39:57 -0500 X-MC-Unique: X4XQR69UNdyvfJZ65mDaVw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2041E101FA2C; Tue, 6 Feb 2024 17:39:56 +0000 (UTC) Received: from vschneid-thinkpadt14sgen2i.remote.csb (unknown [10.39.193.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A881D2026D06; Tue, 6 Feb 2024 17:39:51 +0000 (UTC) From: Valentin Schneider To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-arch@vger.kernel.org, x86@kernel.org Cc: Josh Poimboeuf , Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Pawan Gupta , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Arnd Bergmann , Jason Baron , Steven Rostedt , Ard Biesheuvel , Frederic Weisbecker , "Paul E. McKenney" , Feng Tang , Andrew Morton , "Mike Rapoport (IBM)" , Vlastimil Babka , David Hildenbrand , "ndesaulniers@google.com" , Michael Kelley , "Masami Hiramatsu (Google)" Subject: [PATCH v2 2/5] context_tracking: Make context_tracking_key __ro_after_init Date: Tue, 6 Feb 2024 18:39:08 +0100 Message-ID: <20240206173911.4131670-3-vschneid@redhat.com> In-Reply-To: <20240206173911.4131670-1-vschneid@redhat.com> References: <20240206173911.4131670-1-vschneid@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790172354385629174 X-GMAIL-MSGID: 1790172354385629174 context_tracking_key is only ever enabled in __init ct_cpu_tracker_user(), so mark it as __ro_after_init. Signed-off-by: Valentin Schneider Acked-by: Josh Poimboeuf --- kernel/context_tracking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 6ef0b35fc28c5..cc4f3a57f848c 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -432,7 +432,7 @@ static __always_inline void ct_kernel_enter(bool user, int offset) { } #define CREATE_TRACE_POINTS #include -DEFINE_STATIC_KEY_FALSE(context_tracking_key); +DEFINE_STATIC_KEY_FALSE_RO(context_tracking_key); EXPORT_SYMBOL_GPL(context_tracking_key); static noinstr bool context_tracking_recursion_enter(void)