From patchwork Thu Jul 20 16:30:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 123419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3289653vqt; Thu, 20 Jul 2023 11:00:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlEsj+ip4C27JZ+lTEZYoDVcitCVntr3Q274J4fLQZ46UMCr6xDmAsuf7G128TdGRGoEvB3M X-Received: by 2002:a17:906:118:b0:991:ed4e:1c84 with SMTP id 24-20020a170906011800b00991ed4e1c84mr5269913eje.25.1689876035665; Thu, 20 Jul 2023 11:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689876035; cv=none; d=google.com; s=arc-20160816; b=bGh8w6y8k6naRxHCpiJeNHfaSOCWI3N6drmHy/YOeXfNiEIFPCJhpNcacGd+2p9dT3 GLlgYmgsKF9jIAjhMBfsSBjOfTMUMHS95u1+nzGYNVbHCgKnT6aZ4GEx7eTg9mGe4Msb 2t70mbsNVe2/boRVqgGgs1SCg1mky6SrRV2AuIgex58kqoltN3j1qas+YP1muoEVrpa4 w0BBnIUTP60WAfnQdR78mnSCMnGVc4iantaUzItUTyVEXelTY7c506QmXC96WCqOiaw/ 3hsn8j7M2ngdRkYebXD1ggtG8nh3gor1bYpRVLeHHbOzsu4oliGkp+OayMkrfJeCTDJy qtDw== 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=izi9UHkrSeZ4AHa49u6aA8W9HneeYs8L2V/Y70LmMpM=; fh=PtaPM/evcxdC1AWAoNYkNA7d0RyqsevCG9x/XhoE/I4=; b=WbN+VXNaCR0VVtCLGKRXZpEOddtbqCkBrqfG/nJchc69wZBT++cLjKZm9KzmfejNj9 sRJJ/r52F2WnvAjKgC2ZIbpNoasbjSZYtIZH7JW4L8G9SMJ77bxP7lLL0zDlCtCqPlL4 O+diaw42k57xUfOOliDnLK+nQkrs8+nxPl0DJ9hnR4+2dVTnShGYsJ/38yLWHFil0n21 kNfveJWsWObDvdxvgC4Ppy3ArbnDjLmTRktsDWO5BdM6uo3b5EJCCcXf0UzIdbSW77dY fVC+3DrN99Y2cIFDU1fSZIsqBqQOe7i3CG19lqfnUNJlPvFGoYh1zNM3pLm2tOfrixz5 /zSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Cghh/O4O"; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a1709060e4e00b009828e8bec17si959929eji.531.2023.07.20.11.00.11; Thu, 20 Jul 2023 11:00:35 -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=@redhat.com header.s=mimecast20190719 header.b="Cghh/O4O"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbjGTQgZ (ORCPT + 99 others); Thu, 20 Jul 2023 12:36:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbjGTQfz (ORCPT ); Thu, 20 Jul 2023 12:35:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CA221BDC for ; Thu, 20 Jul 2023 09:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689870837; 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=izi9UHkrSeZ4AHa49u6aA8W9HneeYs8L2V/Y70LmMpM=; b=Cghh/O4OvUZCiqvL6zqbluVyaOfNYNNNpb7jyNYsDo/srfZoF+4H8NZXLYvW4knwRbKMGf 6yZJnIPqWjWUo2oHckGdTea6ElGWzT6aBjFFk14umfvzak2zviT0dOgkSZ0OevisWhBFxc XQZeJYjeLL9xasWwj4Czyzg2ExLDC3Y= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-267-UUYzhPw5OJ2eJI-qriS1tw-1; Thu, 20 Jul 2023 12:33:54 -0400 X-MC-Unique: UUYzhPw5OJ2eJI-qriS1tw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CEF671C05EB9; Thu, 20 Jul 2023 16:33:50 +0000 (UTC) Received: from vschneid.remote.csb (unknown [10.42.28.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCF3340C2070; Thu, 20 Jul 2023 16:33:42 +0000 (UTC) From: Valentin Schneider To: 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 Cc: 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 , Josh Poimboeuf , 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 , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: [RFC PATCH v2 14/20] x86/kvm: Make kvm_async_pf_enabled __ro_after_init Date: Thu, 20 Jul 2023 17:30:50 +0100 Message-Id: <20230720163056.2564824-15-vschneid@redhat.com> In-Reply-To: <20230720163056.2564824-1-vschneid@redhat.com> References: <20230720163056.2564824-1-vschneid@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771963454281458602 X-GMAIL-MSGID: 1771963454281458602 objtool now warns about it: vmlinux.o: warning: objtool: exc_page_fault+0x2a: Non __ro_after_init static key "kvm_async_pf_enabled" in .noinstr section The key can only be enabled (and not disabled) in the __init function kvm_guest_init(), so mark it as __ro_after_init. Signed-off-by: Valentin Schneider Reviewed-by: Maxim Levitsky --- arch/x86/kernel/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 1cceac5984daa..319460090a836 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -44,7 +44,7 @@ #include #include -DEFINE_STATIC_KEY_FALSE(kvm_async_pf_enabled); +DEFINE_STATIC_KEY_FALSE_RO(kvm_async_pf_enabled); static int kvmapf = 1;