From e78a11174de9e84e2f685618432754b83bd9f4ec Mon Sep 17 00:00:00 2001 From: XiakaiPan <13212017962@163.com> Date: Wed, 7 Dec 2022 09:16:02 +0530 Subject: [PATCH] RISC-V: KVM: Add exit logic to main.c Several lines of code are inserted to remove KVM module normally using rmmod command just like others. Signed-off-by: XiakaiPan <13212017962@163.com> Reviewed-by: Andrew Jones Tested-by: Andrew Jones Signed-off-by: Anup Patel --- arch/riscv/kvm/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/riscv/kvm/main.c b/arch/riscv/kvm/main.c index df2d8716851f..58c5489d3031 100644 --- a/arch/riscv/kvm/main.c +++ b/arch/riscv/kvm/main.c @@ -127,3 +127,9 @@ static int __init riscv_kvm_init(void) return kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); } module_init(riscv_kvm_init); + +static void __exit riscv_kvm_exit(void) +{ + kvm_exit(); +} +module_exit(riscv_kvm_exit);