From patchwork Wed Jul 5 18:12:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 13302575 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05DA9EB64DA for ; Wed, 5 Jul 2023 18:17:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A029E8E0005; Wed, 5 Jul 2023 14:17:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98B5B8E0003; Wed, 5 Jul 2023 14:17:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8056D8E0005; Wed, 5 Jul 2023 14:17:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 71E798E0003 for ; Wed, 5 Jul 2023 14:17:02 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2251BA0520 for ; Wed, 5 Jul 2023 18:17:02 +0000 (UTC) X-FDA: 80978364684.24.C00F1B3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 2048BC0018 for ; Wed, 5 Jul 2023 18:16:59 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cveqENca; spf=pass (imf28.hostedemail.com: domain of vschneid@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=vschneid@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688581020; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=izi9UHkrSeZ4AHa49u6aA8W9HneeYs8L2V/Y70LmMpM=; b=xzzB33iUSQdSCr6XjgBeagapxy9MWwk4Cng+TPS8KSV+QqBVHSksqSE6/q/XfCpqvs9sV3 rp2ey6dd8Ikg8r6LRtx4Uq5irq0SRaa4tJTd2lFCRS53V9pfoDbApX6UbirXNxwiHZOEj0 5SXUxEjyfAuMmSvYGkDEe7ccIMwExt4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cveqENca; spf=pass (imf28.hostedemail.com: domain of vschneid@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=vschneid@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688581020; a=rsa-sha256; cv=none; b=6uto3xGJK0zZrfLTCj9DpfkCibxbVyg64Cp9yVgOepxvfoGAklO5uDQrm+Yrm4wPF3Tvs5 L4mdFZnhkSoCv9+2iy/DNvw65faDnCgXhnxNMc9K5h8akSicodlUhA6+DLd6tcZ2mMvXu3 /YtFVxT12aomLmV5TIv0upnXFWNYDNc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688581019; 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=cveqENcan7/mRCa93/j7OZWYP54hdYHR0mM7Ex/13CPk7nq0DrgLTrT2L6id1KTghXtcS7 YHzGuAznL1jfXzpqikhkZo5kHX4UyJl7NPU6ZFe9tAiTgaqDvRD660haONRIV3keJ73WaN 5IhvWGrCjf91YC4E/EyZnSWskVERy+w= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-197-m-BHSRQXMT2rSYl1-eA5hQ-1; Wed, 05 Jul 2023 14:16:54 -0400 X-MC-Unique: m-BHSRQXMT2rSYl1-eA5hQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B7B9F3815EF2; Wed, 5 Jul 2023 18:16:52 +0000 (UTC) Received: from vschneid.remote.csb (unknown [10.42.28.164]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1D60F5CFA; Wed, 5 Jul 2023 18:16:46 +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 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" , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Josh Poimboeuf , 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 09/14] x86/kvm: Make kvm_async_pf_enabled __ro_after_init Date: Wed, 5 Jul 2023 19:12:51 +0100 Message-Id: <20230705181256.3539027-10-vschneid@redhat.com> In-Reply-To: <20230705181256.3539027-1-vschneid@redhat.com> References: <20230705181256.3539027-1-vschneid@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Rspamd-Queue-Id: 2048BC0018 X-Rspam-User: X-Stat-Signature: shkpfzhg8ctjo7epjhsen9h6cuyt3md7 X-Rspamd-Server: rspam01 X-HE-Tag: 1688581019-493306 X-HE-Meta: U2FsdGVkX18j40sALBLVs/4LN69w6d0Jo6hUhC3vDkeQYP7RZpBGVg1R0b92KFU0Eoyj007BDrel/sBF0QxnEC/va54ScHpkReE67PuLRnP7P82uMVJ6YYJHVvgK/d8CMam38fwE/+XISoA13cFPEKvqwR7t3N1TDPQuttN/7+gPyTxVJDQeeFkC8kbNbYXjKVqvyAdWHfolliO+iZ8EBIXevw7PoBczhfmW8n6aetQRSsoCzZbGGbvph+Yw5Lq/kHbO7iugDCA6hqgsXVmFMKGOvsfR6ZshLDJnyXlclY7cCAavzdsU1sCaOZkmO5svuWlSCZRClIpLzsXg31aYGspYNQiMuU8J1pjDHi3sUF55HRiIhYA6tuRg24BStlY2EfzMzDQ0AoqRU+HJTPVIF6kx53dGYqfvGY6FNCl5ZcHyE/EULelTmgUYIBRXNL3PKyhvC4T0frALO0fGUsotlhHyJ4hfyyV4EYtNWZAtt/hNBYTyTKO9QCYA1b0bHifXxT7b8UwC30vCvMLW2aMJbpqtJPQCihd/hE2KQByrQKf27IxXyFT7LHLTW7yXSreBHxpCKfIfJ7ubiPdq6dnvqhAT+ekyCNcsKGOup7znQ18iGL0rb3kjcm2LC4s26F0CEyy4FfDlWJgCuEX5j4hl2kaTi2JzCk0EQwmpDSIIxU/GdktKf9uolipdT57C6QgH1gAmexZ1KWipKZMjgxZLol7fb9OIvFGS0Xsk3ue7/KodmmRPw/ZS4uI37WhbKMKP9irIlTB8kZ6qKda9YkZGQgg3qixCn3IdbqRj++rf6ujogq/I/x+VxwgRSLh5Rjq2QAj+3aXGTxn/G9OH0N9aCq/VanqTpBO7KDUsNEZhjvZ2xARAg7DzNbpk4VLCfOZ8Rco1wW1I80VfFVZS651uDMXE+HFc/tK8+hCCyWNwz9k/aQpMFAaw+VvjUtI8uwuwZkMfR25lRs+q4J+CQaY 7tfD8HQe FnKs7VpWzAaJhRFzw1TY/zxyi2B9urNQYBmHXTrlqV6Km3dnWZ0666WYk+nbatpo1XYK0Fqcvokre3nfUkX4B2kZ0OQbm/4QiddEJ4DegeGNipOvmYWS1/gQfBaFAI+GhzrUi2Wha1n1YzoRP7lcP9/5w5ayTkKO4J1R1nVGex8F/7hKnYsqOFhamXqCPCa9DAL2QaKzmuun5+cW3TJeELYl6FRPHNTDvhEE0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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;