* [PATCH 11/73] powerpc: book3s KVM can be modular so it should use module.h
[not found] <1390339396-3479-1-git-send-email-paul.gortmaker@windriver.com>
@ 2014-01-21 21:22 ` Paul Gortmaker
2014-01-21 21:22 ` [PATCH 12/73] powerpc: kvm e500/44x is not modular, so don't use module_init Paul Gortmaker
1 sibling, 0 replies; 3+ messages in thread
From: Paul Gortmaker @ 2014-01-21 21:22 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, Paul Gortmaker, Gleb Natapov, Paolo Bonzini,
Alexander Graf, Benjamin Herrenschmidt, Paul Mackerras, kvm,
kvm-ppc, linuxppc-dev
Even though KVM is bool, KVM_BOOK3S_32 and KVM_BOOK3S_64 are declared
as Kconfig tristate, so this file really should be including
module.h instead of export.h -- it only works currently because
module_init is currently (mis)placed in init.h -- but we are
intending to clean that up and relocate it to module.h
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: kvm@vger.kernel.org
Cc: kvm-ppc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/powerpc/kvm/book3s.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 8912608..279459e 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -16,7 +16,7 @@
#include <linux/kvm_host.h>
#include <linux/err.h>
-#include <linux/export.h>
+#include <linux/module.h>
#include <linux/slab.h>
#include <asm/reg.h>
--
1.8.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 12/73] powerpc: kvm e500/44x is not modular, so don't use module_init
[not found] <1390339396-3479-1-git-send-email-paul.gortmaker@windriver.com>
2014-01-21 21:22 ` [PATCH 11/73] powerpc: book3s KVM can be modular so it should use module.h Paul Gortmaker
@ 2014-01-21 21:22 ` Paul Gortmaker
2014-01-21 22:23 ` Paul Gortmaker
1 sibling, 1 reply; 3+ messages in thread
From: Paul Gortmaker @ 2014-01-21 21:22 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, Paul Gortmaker, Gleb Natapov, Paolo Bonzini,
Alexander Graf, Benjamin Herrenschmidt, Paul Mackerras, kvm,
kvm-ppc, linuxppc-dev
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 <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: kvm@vger.kernel.org
Cc: kvm-ppc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
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);
--
1.8.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 12/73] powerpc: kvm e500/44x is not modular, so don't use module_init
2014-01-21 21:22 ` [PATCH 12/73] powerpc: kvm e500/44x is not modular, so don't use module_init Paul Gortmaker
@ 2014-01-21 22:23 ` Paul Gortmaker
0 siblings, 0 replies; 3+ messages in thread
From: Paul Gortmaker @ 2014-01-21 22:23 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, Paul Gortmaker, Gleb Natapov, Paolo Bonzini,
Alexander Graf, Benjamin Herrenschmidt, Paul Mackerras, kvm,
kvm-ppc, linuxppc-dev
On 14-01-21 04:22 PM, Paul Gortmaker wrote:
> 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
I've fixed the above -- s/netfilter/PPC KVM/
The risks of recycling commit logs...
Paul.
--
> 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 <gleb@kernel.org>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: kvm@vger.kernel.org
> Cc: kvm-ppc@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> 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);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-21 22:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1390339396-3479-1-git-send-email-paul.gortmaker@windriver.com>
2014-01-21 21:22 ` [PATCH 11/73] powerpc: book3s KVM can be modular so it should use module.h Paul Gortmaker
2014-01-21 21:22 ` [PATCH 12/73] powerpc: kvm e500/44x is not modular, so don't use module_init Paul Gortmaker
2014-01-21 22:23 ` Paul Gortmaker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox