Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3014371rwb; Mon, 15 Aug 2022 16:10:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR6w/WktVK4y/MQ9mZwO/GvxeWrDrxRZSB8cAa1o7FTzmzG8RuqmqFHUC2cZMIkxaqPqZWOB X-Received: by 2002:a05:6402:550c:b0:443:7d15:d57f with SMTP id fi12-20020a056402550c00b004437d15d57fmr10483985edb.147.1660605021275; Mon, 15 Aug 2022 16:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605021; cv=none; d=google.com; s=arc-20160816; b=hXxk8exe5X3G45D7hmqPRLIZ1eBcJx6M0mby5X9nhompsTQu8+BfcqDFRobF0kDb+2 GNz/df0u82k/t8ASk6Kg6aP76GgSKq9O5c4G5R8lkGrj9XsKAJ8LLxYGOn2dE7a3QhR+ WSHDlm9JqMw1/d+i5PrrOKJc4blc1tRmol7Uc6c3o6HpfmwxgfzzH3ugtLdlNehLNgX5 +lDjy7DrQtThGPXS+/4o6H1zrZ8YIaUOGfOFcl2kzan8un9awbLnq6zOJ2/ZPh8cslXX 3DpZA7YNY/NjDdC3juS6dXJXuBZoyXdJhD7lzUB0ONS5XDDY25XXEULZjTXQPidScis7 4niw== 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=9yWwOX75knRq/oEEZoUPp+KIqCKHEUzMbKeujeE5gjo=; b=i2+23C2u4/y9yLiG5maII5D20QxoxVZlX4FB+xNQMEkvquHNiJlpf0tQXDqtHIbrRI 1T4evXcr7qFNy65LKoL9D/aKKMWbJX6V5iuH+3CqlBDjh1vR82kzW08OJGhAw4JW3n4l +SpaqNkvGDs5ROlFDYu209SUrVp6aF+9gJe/njoeYJE2vW19nEbHUQ/uXXfSkQJ89hHH V1rKopm4MqAxvaBB/c/EtMWYfYsYK7cFGasOTtPYcfgfCasdEvnhp/bXFpfJBe9CSViB a7n7wOydDHBOnSP77udemNclVKjmvGlqdM13Ovpp6vbHEX3glYhIiIgNILF0seWJ5uJr 1QyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0mwq2KFQ; 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 ne23-20020a1709077b9700b00726c53b9203si10569485ejc.860.2022.08.15.16.09.55; Mon, 15 Aug 2022 16:10:21 -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=0mwq2KFQ; 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 S243658AbiHOUSH (ORCPT + 99 others); Mon, 15 Aug 2022 16:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231645AbiHOUJ1 (ORCPT ); Mon, 15 Aug 2022 16:09:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E745E83F13; Mon, 15 Aug 2022 11:56:00 -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 ams.source.kernel.org (Postfix) with ESMTPS id 35A35B8105C; Mon, 15 Aug 2022 18:55:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D315C433B5; Mon, 15 Aug 2022 18:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589756; bh=ykdKXs4qXCQoLzzTkpAnTym0LPHlNozcDOaKd/4WEhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0mwq2KFQEUUdbj+L1/uXCiALmqZYwKc/vQbqI9ITomoAPMjuZgaiXvfImSbG2dvSD rlLT4Nmk14QHFBwPdeYMOcRypy0qbsB8m5Jxb2EhveeeCTjSwnW+Bh9RdCNH+kHIF6 GK/sHsOKdpQKjFHNUGzDvr5PG3MCb5UBOLjw3AaU= 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.18 0039/1095] KVM: x86: Tag kvm_mmu_x86_module_init() with __init Date: Mon, 15 Aug 2022 19:50:38 +0200 Message-Id: <20220815180431.026391216@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 @@ -1588,7 +1588,7 @@ static inline int kvm_arch_flush_remote_ #define kvm_arch_pmi_in_guest(vcpu) \ ((vcpu) && (vcpu)->arch.handling_intr_from_guest) -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 @@ -6264,7 +6264,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());