From patchwork Tue Jan 21 21:22:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 3520661 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F0EC59F2D6 for ; Tue, 21 Jan 2014 21:46:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC22C2015D for ; Tue, 21 Jan 2014 21:46:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F18FD20149 for ; Tue, 21 Jan 2014 21:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932270AbaAUVql (ORCPT ); Tue, 21 Jan 2014 16:46:41 -0500 Received: from mail1.windriver.com ([147.11.146.13]:50628 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752726AbaAUVYb (ORCPT ); Tue, 21 Jan 2014 16:24:31 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.14.5/8.14.5) with ESMTP id s0LLOHJm029007 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 21 Jan 2014 13:24:17 -0800 (PST) Received: from yow-lpgnfs-02.corp.ad.wrs.com (128.224.149.8) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.2.347.0; Tue, 21 Jan 2014 13:24:18 -0800 From: Paul Gortmaker To: CC: , Paul Gortmaker , Gleb Natapov , Paolo Bonzini , Alexander Graf , Benjamin Herrenschmidt , Paul Mackerras , , , Subject: [PATCH 12/73] powerpc: kvm e500/44x is not modular, so don't use module_init Date: Tue, 21 Jan 2014 16:22:15 -0500 Message-ID: <1390339396-3479-13-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1390339396-3479-1-git-send-email-paul.gortmaker@windriver.com> References: <1390339396-3479-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In powerpc, CONFIG_KVM is bool, and so are these three subarch options, for the 44x and e500 variants. This means that any module_exit() calls and functions used by them such as the kvmppc_booke_exit() are dead code. Here we remove them. In addition, rather than use module_init, which is just __initcall for non-modules, we update those as well. Note that direct use of __initcall is discouraged, vs. one of the priority categorized subgroups. As __initcall gets mapped onto device_initcall, our use of subsys_initcall (which seems to make sense for netfilter code) will thus change this registration from level 6-device to level 4-subsys (i.e. slightly earlier). However no impact of that small difference is expected, since the arch independent kvm code doesn't trigger any init; it is the arch initcalls here which actually call kvm_init. Cc: Gleb Natapov Cc: Paolo Bonzini Cc: Alexander Graf Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: kvm@vger.kernel.org Cc: kvm-ppc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Paul Gortmaker --- arch/powerpc/include/asm/kvm_ppc.h | 1 - arch/powerpc/kvm/44x.c | 10 +--------- arch/powerpc/kvm/booke.c | 6 ------ arch/powerpc/kvm/e500.c | 10 +--------- arch/powerpc/kvm/e500mc.c | 10 +--------- 5 files changed, 3 insertions(+), 34 deletions(-) diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index c8317fb..8466df5 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h @@ -109,7 +109,6 @@ extern void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu); extern int kvmppc_core_check_requests(struct kvm_vcpu *vcpu); extern int kvmppc_booke_init(void); -extern void kvmppc_booke_exit(void); extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); extern int kvmppc_kvm_pv(struct kvm_vcpu *vcpu); diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c index 93221e8..2129fc1 100644 --- a/arch/powerpc/kvm/44x.c +++ b/arch/powerpc/kvm/44x.c @@ -222,12 +222,4 @@ static int __init kvmppc_44x_init(void) err_out: return r; } - -static void __exit kvmppc_44x_exit(void) -{ - kvmppc_pr_ops = NULL; - kvmppc_booke_exit(); -} - -module_init(kvmppc_44x_init); -module_exit(kvmppc_44x_exit); +subsys_initcall(kvmppc_44x_init); diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 0591e05..49dffa2 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -1995,9 +1995,3 @@ int __init kvmppc_booke_init(void) #endif /* !BOOKE_HV */ return 0; } - -void __exit kvmppc_booke_exit(void) -{ - free_pages(kvmppc_booke_handlers, VCPU_SIZE_ORDER); - kvm_exit(); -} diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c index 497b142..115ef12 100644 --- a/arch/powerpc/kvm/e500.c +++ b/arch/powerpc/kvm/e500.c @@ -564,12 +564,4 @@ static int __init kvmppc_e500_init(void) err_out: return r; } - -static void __exit kvmppc_e500_exit(void) -{ - kvmppc_pr_ops = NULL; - kvmppc_booke_exit(); -} - -module_init(kvmppc_e500_init); -module_exit(kvmppc_e500_exit); +subsys_initcall(kvmppc_e500_init); diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c index 4132cd2..612c216 100644 --- a/arch/powerpc/kvm/e500mc.c +++ b/arch/powerpc/kvm/e500mc.c @@ -382,12 +382,4 @@ static int __init kvmppc_e500mc_init(void) err_out: return r; } - -static void __exit kvmppc_e500mc_exit(void) -{ - kvmppc_pr_ops = NULL; - kvmppc_booke_exit(); -} - -module_init(kvmppc_e500mc_init); -module_exit(kvmppc_e500mc_exit); +subsys_initcall(kvmppc_e500mc_init);