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: 13320798 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 843DDC0015E for ; Thu, 20 Jul 2023 16:34:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F03828013C; Thu, 20 Jul 2023 12:34:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 07A2B28004C; Thu, 20 Jul 2023 12:34:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E35C028013C; Thu, 20 Jul 2023 12:34:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D2C1728004C for ; Thu, 20 Jul 2023 12:34:01 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7EC37160215 for ; Thu, 20 Jul 2023 16:34:01 +0000 (UTC) X-FDA: 81032537082.08.996D2BB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 727A68001C for ; Thu, 20 Jul 2023 16:33:59 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d7r+keQY; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of vschneid@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=vschneid@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689870839; 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=MCBIOAsO0zgEXaHIl4M1tKD754UYtxT1ofaJGsASrs15yoanL7V+NGR71gPbVpOn0hKeXn jRLigA1tUWLjc4Q1gVDCJuBWnsd/zZcFPT3iiQvD2Wagsc4bbFxRn8LyRfhaXVtvVUl1vu Ym1+vtmJxWFg3Z1Yxk6Q8WspqrxOJ48= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d7r+keQY; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of vschneid@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=vschneid@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689870839; a=rsa-sha256; cv=none; b=c93rndAl1fpKck6ThTEJR7LEgU8Ks00jO/sBDWMQBXh8YrM4m8Ylic0wYPKQpeE7eg2OwY Tqh8kRB3aJ1toiugHqq+pLRRr2Ffttv5ZAoySLmOeMKw+atdLi0L8nawTSVrCuPjsHe9Ex aGS7FIHNCu3/cHfw6TBbJHogIUeg6yw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689870838; 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=d7r+keQYKAY+C5D+bh+Jw3luE7skptr1cANVf2PwkM/S7W3B0lTHmM1kKkSuGYbBp/IY7q hQoWY+UkkAmUad+K+7ewNHa+bJcW42Vostv1OnCOfORo2QcdVy3BgiK9CXZ72Oxbv8aUP0 299PjnKn9NLOd083rD/Rcsphay37w38= 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-Rspamd-Queue-Id: 727A68001C X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: wz1zwb14tmarod84gkf8sw1tx6zo16a9 X-HE-Tag: 1689870839-618310 X-HE-Meta: U2FsdGVkX1+WkJ1HGZ27zG2pvHL0R+fBYDQSlKFvxz24HAk5zcWvXLAa8755ZFiyBXHJhRJNNa1dvpGmSrhoNhzqBLdQxJwo+cG2jFVXwfPdFcSUMTVE1KJ2mRXlS4HGImg+HC9JwmLiFiTisZ36NYMDkvazgDTQAOGXZr7JuoaNviFfFesO1WU9sjZM1t1PbCZjwRTJ39+1YFPGvfF0wFde/c8O5KwVTPQ667/g6kkm4DNi2U10Plrz6camYwHiS3I0wYBQBD6vVMrennm3wvHhVw+44gPnSmfWz122Nd9Ta0cTcIB/mEqjlexeyFeuche7JQghTt6x3McP6IBnXE2xldk0MuausVNNcY0HwS2AFWTxeD1BWoIT5SfsIdkG0Ki1J4aMjl99bwuuBOjAa56CrJizBOAsrrIgWvK5tP40J2wPRBIp3Ioh5PucrViQv2G43wsF0RfpPXdDrjiTocO1z83oa88BQxVP2DYfY6p4g2SVMzyr0o+eDWAgaww1USulvNBmgOgvdzRyjuIgRfoXVamOihGttxcxrJTHb+XORD1BXcaN8CrD3h7Vod30DbZ+D4oU/TrCMwOTSDsKjcCVM/zgYhLUXHLxsQX4aKiQhgZyTPsO9978uumzdAqArfyngnKCod8zVUxwc377Bxuf0RCenQeLVadND+XC6G00TA0vBnuQj+5R0VDJ2mZiRTzUk6H0r9e2IzNUA+eEME9scFnjCmpKNEs6WIY6aBGEwhSYbc2G+V+6GS/mY58Zd3rAW0f2zMTzJd3VvZVmVhir9KJAcCoa5jvUPNcKN+EptZR0Y2r/kvtwLNw6d5krxAaQzVhEoe5NEnZsZm5LZD3kv+46lkGkLZtQQ4uvvFiAKnZilU3GIA1m5vELJDhDHk+/yEbubUeHofskZxdAtWoyj8Wg/ZbKPSIWLJ3h+tlDtEuyAa9jfjo+YHgZ6DofS4ugm5c+9wsTgL01HCP vQHe0bfC R7iGchGvoAAaHaZGt+KKPNn5Hhzs3m1KLYsxGu0GciLGYPMeCLWMX+lUtF2CcBjr8Zt4EKGwQwhjhqjxwPHKwx6qi6mDvvnDTuVI/A9pfQC7d4Ek21peJTfSjpG1Pi7DJBpVIykEXmj/RQYj7Cj5KKX9nFqa6oHTqYzT6LESkE6fehryx7KkD7hEQe7U3W+9bkS5t2lpArLubhiwN2RAFRORdrqpK43dNbxiMKi9ZJraZRKjkUJzfATrmNZDqkgRmYUMIbZ+jV+7mPI8u6dnkPLocJmecKnJcKRKF 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 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;