From patchwork Mon Nov 20 10:55:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 167054 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp2115350vqn; Mon, 20 Nov 2023 02:59:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwzgTxmGD0RDjAR3OugDzQ8AUvAMe9RGdtmdfUzSFs7XlT5moc3fBfbbN005qujl8HZRC0 X-Received: by 2002:a05:6870:44d0:b0:1e9:cdad:4903 with SMTP id t16-20020a05687044d000b001e9cdad4903mr9186909oai.50.1700477994193; Mon, 20 Nov 2023 02:59:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700477994; cv=none; d=google.com; s=arc-20160816; b=uFsr893HC11sY02QAY/WNxKS0LzKdWYDS72q2T+8fCXBG/yXsf5B4p7Hp+S6vyASPj /V4WKUY1pece/U91q/IcrcngfWLw3mJptJk+EbSpmv2j9zzmtgAjPhdm+c8IEza8/qc3 bE8TIY4i3NX8h/0TTq6WgjfwPr327nPiSXyqYDlzHpYcwiDuvJreLSZwfe2SbBmNboTt DYJmfu9YRAdVSM2Lx5XWCGw1yp0KCgBjXmRsDOGzzND/ooyh+Tm7epgkkzqAJkJE9oMR Y/dGuW/9iw5ND4yO2JIss70KBoGGwSS0gG1nhsDLUdOptmI8dh1ZERDpww7GPB/urAnU G2nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Fh5nWCS7m0i97fxRSND8fdK+nCY+MD6Me1hw+2UF/3c=; fh=bEaXtmS8lzRItYrE/RfaVyKNdc9i8y6GHBEJVBz/DUE=; b=GiARDmR3BkaHHnvTWVL2zOnOBwmo/WNKw2gEO27G0YKKgbSlsOG0LV/jC0OYbl+0wJ 8+pwHaTBx2CoX5Kf53aluOl77Mhil95wDtVdx/rvsGHSEcwHeSnCTKloGO1ooiNbWPPR QoqauaRRU6Gv417njmVULq45SOOhIKZuLJTrgNY0qVA4AB5P7bFInaZcucFmJ3rKY2l/ hELCh9lcucy10FBalKqh8J+K93nVmyg8V/d7utEq+PaZvpZp9Z8an4T69isNXqd2UmPF 964OHudIm2zuNncjFtwqqvF5N6zZ3RiablsMH1eBEpYF9QqWcJiwmQaBKX2bTz8rEye9 KwIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aL2R4fer; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id r18-20020aa79892000000b006cb901a9883si2197262pfl.326.2023.11.20.02.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 02:59:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aL2R4fer; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 39F0B806CC36; Mon, 20 Nov 2023 02:56:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233365AbjKTK4q (ORCPT + 27 others); Mon, 20 Nov 2023 05:56:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233115AbjKTK43 (ORCPT ); Mon, 20 Nov 2023 05:56:29 -0500 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 3680BD4C for ; Mon, 20 Nov 2023 02:56:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700477776; 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=Fh5nWCS7m0i97fxRSND8fdK+nCY+MD6Me1hw+2UF/3c=; b=aL2R4ferCNTSW0/DM4wCLENT5BUyJ7WVaXa3M6x0ATKoxDUAXKkstGMplnZxLz1uyYE/FR xCCUnWiZdKVQqHQ8YL+9E/4f/M0K8jLsrYPQNiOrcOUKRJkFJvb99eKNc6xdMnhWmhePS1 58GVkehSPcacpMI+EvsbA2Qj0ZvHtfw= 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-88-Q63KOD7EPAGRzHG2NpasBw-1; Mon, 20 Nov 2023 05:56:12 -0500 X-MC-Unique: Q63KOD7EPAGRzHG2NpasBw-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 7DB26811003; Mon, 20 Nov 2023 10:56:11 +0000 (UTC) Received: from vschneid-thinkpadt14sgen2i.remote.csb (unknown [10.39.195.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAC3C2026D4C; Mon, 20 Nov 2023 10:56:06 +0000 (UTC) From: Valentin Schneider To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-arch@vger.kernel.org, x86@kernel.org Cc: Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Josh Poimboeuf , 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 5/5] x86/tsc: Make __use_tsc __ro_after_init Date: Mon, 20 Nov 2023 11:55:28 +0100 Message-ID: <20231120105528.760306-6-vschneid@redhat.com> In-Reply-To: <20231120105528.760306-1-vschneid@redhat.com> References: <20231120105528.760306-1-vschneid@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 20 Nov 2023 02:56:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783080413135331773 X-GMAIL-MSGID: 1783080413135331773 __use_tsc is only ever enabled in __init tsc_enable_sched_clock(), so mark it as __ro_after_init. Signed-off-by: Valentin Schneider --- arch/x86/kernel/tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 15f97c0abc9d0..f19b42ea40573 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -44,7 +44,7 @@ EXPORT_SYMBOL(tsc_khz); static int __read_mostly tsc_unstable; static unsigned int __initdata tsc_early_khz; -static DEFINE_STATIC_KEY_FALSE(__use_tsc); +static DEFINE_STATIC_KEY_FALSE_RO(__use_tsc); int tsc_clocksource_reliable;