diff options
author | Sean Christopherson <seanjc@google.com> | 2022-12-01 02:09:08 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-12-29 23:41:16 +0300 |
commit | 20deee32f553c5229ae3ca38ad0d3c1a43578c65 (patch) | |
tree | c3a4ecbf4c3627733cedd15145bc61ebfc320ed7 /arch/riscv/kvm/main.c | |
parent | eed9fcdf57616b2f3029542142b3139a820c9316 (diff) | |
download | linux-20deee32f553c5229ae3ca38ad0d3c1a43578c65.tar.xz |
KVM: RISC-V: Do arch init directly in riscv_kvm_init()
Fold the guts of kvm_arch_init() into riscv_kvm_init() instead of
bouncing through kvm_init()=>kvm_arch_init(). Functionally, this is a
glorified nop as invoking kvm_arch_init() is the very first action
performed by kvm_init().
Moving setup to riscv_kvm_init(), which is tagged __init, will allow
tagging more functions and data with __init and __ro_after_init. And
emptying kvm_arch_init() will allow dropping the hook entirely once all
architecture implementations are nops.
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Anup Patel <anup@brainfault.org>
Message-Id: <20221130230934.1014142-25-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/riscv/kvm/main.c')
-rw-r--r-- | arch/riscv/kvm/main.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c index afd6400a9e80..1cd220e96c26 100644 --- a/arch/riscv/kvm/main.c +++ b/arch/riscv/kvm/main.c @@ -67,6 +67,15 @@ void kvm_arch_hardware_disable(void) int kvm_arch_init(void *opaque) { + return 0; +} + +void kvm_arch_exit(void) +{ +} + +static int __init riscv_kvm_init(void) +{ const char *str; if (!riscv_isa_extension_available(NULL, h)) { @@ -110,15 +119,6 @@ int kvm_arch_init(void *opaque) kvm_info("VMID %ld bits available\n", kvm_riscv_gstage_vmid_bits()); - return 0; -} - -void kvm_arch_exit(void) -{ -} - -static int __init riscv_kvm_init(void) -{ return kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); } module_init(riscv_kvm_init); |