Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2810218rwb; Mon, 15 Aug 2022 11:48:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR4+lbfBgFYMJA9wnxBfbC0zpik+4yNRU1vZh871fOQlTf4NVajb0DbEnYSG40Ca0a/JGxVx X-Received: by 2002:a05:6402:22bc:b0:43d:73a7:370a with SMTP id cx28-20020a05640222bc00b0043d73a7370amr15528300edb.120.1660589287779; Mon, 15 Aug 2022 11:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589287; cv=none; d=google.com; s=arc-20160816; b=e1lbMA5i+1J3mftCpINQTBmtEpWYGPdzjKssdNW1b5+6eOzoka7KI3cv8aMo5hAMCw fXT6lZrJH3ViVj9AETGNDHmgieDIT5TS6sXueXQJOBtcTWS3x/EIgiFDwn46suYYpsys vWptiTqeihhaB/QxTNlsV753k7/Uqdiv4yhsQC3X/8EobfSTDcDiuCgHHVObG5DuYhrv ceq+QZrMHPazUKfU7Py0wjV1EO6A1m0jHXIqsnqhV5mOHNOUOa9AK4P18YfEMBo0D04b hL1l0NN5/jEjF9Lqw+jjjb9TwhWCf0eSZsoaNPb4PCLGC1+93MMDgdy7Ev0loPJ1V43E BcTA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ahyv85aJLsKTegjw8TLecCzXi8MLvmPF6NqHPZk5mKU=; b=GJc9atQSdAq/ClulStKzFI9F234+3uXaclgLddsLy4cRp03wquv+RM8Ia+7dSIYVac WpNrY9zD1Ak6Fxls2iYrI0jvOAc4iA8eC15+x4zdFTGmB2OE+H8ksUhAJ+hjyYai1tTF mFfjHy0lpWRR/OSPszEALAczzaBcIWe64XKUTfleBI2o7cN1Q0pZ2VWC7KEiMY39gPyZ RSe4QEB3zhtRhRK0ffhp6FQEcXkzVu2B0ni27OHHuj2D8gYhXuFtk9wqmbXdqp22IiBM SqL6Thvocn8b/SJMfoyRqXkaPZMb90JmQMQWXZfRfGolYcoflHbVTQRdR8Jqwyx96Ol/ 08LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="kUPF/xoz"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z95-20020a509e68000000b0043c94d7ddb8si8257173ede.204.2022.08.15.11.47.41; Mon, 15 Aug 2022 11:48:07 -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=@linuxfoundation.org header.s=korg header.b="kUPF/xoz"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236058AbiHOSQ0 (ORCPT + 99 others); Mon, 15 Aug 2022 14:16:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233205AbiHOSPQ (ORCPT ); Mon, 15 Aug 2022 14:15:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 297202A27C; Mon, 15 Aug 2022 11:14:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A031161255; Mon, 15 Aug 2022 18:14:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A422BC433D6; Mon, 15 Aug 2022 18:14:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587267; bh=PPyDFzwUQncLPM39nqqMR/bRyAMH5NCLTbkIJHoDLaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kUPF/xoz8OVVOmy7c2W4WI2rGDo3ssb5QkVbb3BQ7TbnQ/NmUhWXwkeTI8IpRptI1 MeWgMQ+rQ5fCjn4mL+z4S+BqI8wmYp41kaQTuDFs2mResf/rNMiCcv1SPIsWAz4Orb tgnfQYz7AN4ofFY35H9XkQvHEoCiLGf5mYR4Vqtc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai Huang , Michael Roth , Sean Christopherson , Paolo Bonzini Subject: [PATCH 5.15 031/779] KVM: x86: Tag kvm_mmu_x86_module_init() with __init Date: Mon, 15 Aug 2022 19:54:35 +0200 Message-Id: <20220815180338.564460037@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Sean Christopherson commit 982bae43f11c37b51d2f1961bb25ef7cac3746fa upstream. Mark kvm_mmu_x86_module_init() with __init, the entire reason it exists is to initialize variables when kvm.ko is loaded, i.e. it must never be called after module initialization. Fixes: 1d0e84806047 ("KVM: x86/mmu: Resolve nx_huge_pages when kvm.ko is loaded") Cc: stable@vger.kernel.org Reviewed-by: Kai Huang Tested-by: Michael Roth Signed-off-by: Sean Christopherson Message-Id: <20220803224957.1285926-2-seanjc@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/mmu/mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1562,7 +1562,7 @@ static inline int kvm_arch_flush_remote_ return -ENOTSUPP; } -void kvm_mmu_x86_module_init(void); +void __init kvm_mmu_x86_module_init(void); int kvm_mmu_vendor_module_init(void); void kvm_mmu_vendor_module_exit(void); --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -6115,7 +6115,7 @@ static int set_nx_huge_pages(const char * nx_huge_pages needs to be resolved to true/false when kvm.ko is loaded, as * its default value of -1 is technically undefined behavior for a boolean. */ -void kvm_mmu_x86_module_init(void) +void __init kvm_mmu_x86_module_init(void) { if (nx_huge_pages == -1) __set_nx_huge_pages(get_nx_auto_mode());