Wanpeng Li
571ee1b685
kvm: vfio: fix unregister kvm_device_ops of vfio
After commit 80ce163 (KVM: VFIO: register kvm_device_ops dynamically),
kvm_device_ops of vfio can be registered dynamically. Commit 3c3c29fd
(kvm-vfio: do not use module_init) move the dynamic register invoked by
kvm_init in order to fix broke unloading of the kvm module. However,
kvm_device_ops of vfio is unregistered after rmmod kvm-intel module
which lead to device type collision detection warning after kvm-intel
module reinsmod.
WARNING: CPU: 1 PID: 10358 at /root/cathy/kvm/arch/x86/kvm/../../../virt/kvm/kvm_main.c:3289 kvm_init+0x234/0x282 [kvm]()
Modules linked in: kvm_intel(O+) kvm(O) nfsv3 nfs_acl auth_rpcgss oid_registry nfsv4 dns_resolver nfs fscache lockd sunrpc pci_stub bridge stp llc autofs4 8021q cpufreq_ondemand ipv6 joydev microcode pcspkr igb i2c_algo_bit ehci_pci ehci_hcd e1000e i2c_i801 ixgbe ptp pps_core hwmon mdio tpm_tis tpm ipmi_si ipmi_msghandler acpi_cpufreq isci libsas scsi_transport_sas button dm_mirror dm_region_hash dm_log dm_mod [last unloaded: kvm_intel]
CPU: 1 PID: 10358 Comm: insmod Tainted: G W O 3.17.0-rc1 #2
Hardware name: Intel Corporation S2600CP/S2600CP, BIOS RMLSDP.86I.00.29.D696.1311111329 11/11/2013
0000000000000cd9 ffff880ff08cfd18 ffffffff814a61d9 0000000000000cd9
0000000000000000 ffff880ff08cfd58 ffffffff810417b7 ffff880ff08cfd48
ffffffffa045bcac ffffffffa049c420 0000000000000040 00000000000000ff
Call Trace:
[<ffffffff814a61d9>] dump_stack+0x49/0x60
[<ffffffff810417b7>] warn_slowpath_common+0x7c/0x96
[<ffffffffa045bcac>] ? kvm_init+0x234/0x282 [kvm]
[<ffffffff810417e6>] warn_slowpath_null+0x15/0x17
[<ffffffffa045bcac>] kvm_init+0x234/0x282 [kvm]
[<ffffffffa016e995>] vmx_init+0x1bf/0x42a [kvm_intel]
[<ffffffffa016e7d6>] ? vmx_check_processor_compat+0x64/0x64 [kvm_intel]
[<ffffffff810002ab>] do_one_initcall+0xe3/0x170
[<ffffffff811168a9>] ? __vunmap+0xad/0xb8
[<ffffffff8109c58f>] do_init_module+0x2b/0x174
[<ffffffff8109d414>] load_module+0x43e/0x569
[<ffffffff8109c6d8>] ? do_init_module+0x174/0x174
[<ffffffff8109c75a>] ? copy_module_from_user+0x39/0x82
[<ffffffff8109b7dd>] ? module_sect_show+0x20/0x20
[<ffffffff8109d65f>] SyS_init_module+0x54/0x81
[<ffffffff814a9a12>] system_call_fastpath+0x16/0x1b
---[ end trace 0626f4a3ddea56f3 ]---
The bug can be reproduced by:
rmmod kvm_intel.ko
insmod kvm_intel.ko
without rmmod/insmod kvm.ko
This patch fixes the bug by unregistering kvm_device_ops of vfio when the
kvm-intel module is removed.
Reported-by: Liu Rongrong <rongrongx.liu@intel.com>
Fixes: 3c3c29fd0d
Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-24 13:30:47 +02:00
..
2014-09-24 10:25:52 +01:00
2014-09-30 13:17:14 -04:00
2014-08-06 18:01:23 -07:00
2014-10-14 12:57:02 -07:00
2014-10-15 07:05:03 +02:00
2014-08-08 15:57:26 -07:00
2014-10-15 20:31:05 +05:30
2014-09-22 16:48:47 +09:00
2014-10-09 14:58:15 -04:00
2014-08-09 09:15:07 -07:00
2014-08-25 21:47:22 +01:00
2014-08-07 23:37:07 -07:00
2014-10-09 06:42:04 -04:00
2014-09-09 16:01:09 -04:00
2014-10-19 12:50:44 -07:00
2014-10-06 01:04:15 -04:00
2014-10-19 12:29:23 -07:00
2014-10-03 14:18:17 +02:00
2014-09-22 11:29:57 -07:00
2014-09-15 22:20:21 +02:00
2014-07-22 12:46:11 +05:30
2014-09-04 19:21:45 +02:00
2014-10-19 12:50:44 -07:00
2014-09-30 13:50:31 +01:00
2014-09-24 11:53:39 -07:00
2014-10-18 18:11:04 -07:00
2014-07-18 13:45:24 -04:00
2014-10-08 12:51:44 -04:00
2014-09-29 11:54:02 -04:00
2014-08-07 14:40:09 -04:00
2014-09-22 15:57:41 +02:00
2014-09-16 16:28:34 -06:00
2014-08-16 08:35:34 -04:00
2014-07-09 16:02:41 +02:00
2014-07-07 21:34:43 -07:00
2014-08-23 13:05:08 -04:00
2014-09-08 10:54:03 +02:00
2014-09-09 13:58:58 +02:00
2014-06-21 11:37:35 +01:00
2014-08-13 10:31:57 +02:00
2014-09-23 16:37:53 -04:00
2014-09-08 10:00:43 -06:00
2014-10-09 22:26:01 -04:00
2014-10-03 15:28:18 -06:00
2014-08-06 18:01:27 -07:00
2014-08-13 10:31:57 +02:00
2014-10-14 09:00:44 -06:00
2014-10-18 11:53:51 -07:00
2014-10-18 11:53:51 -07:00
2014-09-26 15:05:15 -04:00
2014-10-01 22:12:48 -04:00
2014-09-04 22:04:42 -04:00
2014-07-24 21:53:47 +10:00
2014-09-24 14:23:34 +08:00
2014-09-19 09:29:32 -04:00
2014-09-27 12:52:33 -07:00
2014-09-27 12:52:33 -07:00
2014-10-15 07:05:03 +02:00
2014-07-23 15:01:52 -07:00
2014-10-14 02:18:12 +02:00
2014-09-29 14:36:26 -04:00
2014-10-09 22:25:54 -04:00
2014-10-14 02:18:12 +02:00
2014-07-03 11:32:43 +01:00
2014-06-25 13:26:47 -07:00
2014-09-18 16:22:27 -07:00
2014-09-09 01:44:40 +02:00
2014-08-28 08:58:57 -04:00
2014-10-10 07:24:40 -04:00
2014-06-25 16:04:00 -07:00
2014-09-27 09:14:59 -06:00
2014-07-17 16:15:35 -04:00
2014-08-01 22:35:55 +08:00
2014-10-12 17:09:06 -04:00
2014-09-23 22:53:15 -07:00
2014-10-15 07:23:49 +02:00
2014-07-08 13:36:52 -07:00
2014-08-06 18:01:16 -07:00
2014-08-26 07:39:13 +02:00
2014-10-18 18:11:04 -07:00
2014-10-02 12:12:25 +02:00
2014-07-10 18:35:01 +02:00
2014-07-10 18:35:01 +02:00
2014-07-10 18:35:23 +02:00
2014-10-03 14:55:48 -07:00
2014-09-29 00:04:55 -04:00
2014-06-26 15:46:55 -03:00
2014-08-08 15:57:33 -07:00
2014-06-22 16:34:11 -06:00
2014-09-05 17:47:02 -07:00
2014-09-05 12:12:20 -07:00
2014-09-23 11:10:20 -07:00
2014-07-01 13:32:32 +03:00
2014-07-08 13:41:08 -07:00
2014-09-26 15:05:15 -04:00
2014-07-08 15:28:16 -07:00
2014-09-08 09:51:30 +09:00
2014-10-09 11:35:48 +03:00
2014-10-08 16:01:41 -04:00
2014-08-07 14:40:08 -04:00
2014-10-18 11:53:51 -07:00
2014-09-03 18:02:55 -05:00
2014-10-15 21:31:27 +05:30
2014-08-06 18:01:12 -07:00
2014-08-09 17:33:44 -07:00
2014-09-10 10:48:45 -04:00
2014-10-09 22:25:52 -04:00
2014-10-14 17:03:53 -04:00
2014-10-09 22:25:55 -04:00
2014-08-06 18:01:24 -07:00
2014-09-13 11:24:03 -07:00
2014-10-06 23:34:40 +02:00
2014-08-06 18:01:22 -07:00
2014-08-04 10:07:36 +02:00
2014-07-23 10:17:54 -07:00
2014-10-09 22:25:57 -04:00
2014-08-06 18:01:19 -07:00
2014-07-15 04:49:40 -04:00
2014-09-25 16:07:15 +02:00
2014-09-11 12:21:18 +02:00
2014-07-08 16:12:53 -07:00
2014-09-29 15:37:01 -04:00
2014-08-11 12:16:51 -07:00
2014-09-04 22:26:14 -07:00
2014-09-09 10:28:43 -04:00
2014-09-07 16:27:34 -07:00
2014-07-04 12:35:59 +02:00
2014-09-01 13:48:59 +02:00
2014-07-23 12:02:30 +02:00
2014-10-15 07:23:49 +02:00
2014-09-04 14:41:43 -06:00
2014-07-23 16:04:47 +02:00
2014-09-23 23:13:13 -07:00
2014-07-07 21:14:21 -07:00
2014-09-13 18:38:15 +02:00
2014-09-01 13:48:51 +02:00
2014-10-09 16:07:43 -04:00
2014-06-21 23:03:36 +02:00
2014-08-02 15:03:58 -07:00
2014-09-18 00:58:12 -04:00
2014-09-12 13:59:03 -07:00
2014-08-10 09:00:16 +02:00
2014-08-26 13:45:45 -04:00
2014-10-14 02:18:26 +02:00
2014-10-14 15:05:34 -04:00
2014-07-10 11:38:23 -07:00
2014-10-14 02:18:21 +02:00
2014-09-16 17:36:08 +01:00
2014-07-22 21:55:45 +01:00
2014-09-09 10:34:56 +02:00
2014-08-06 18:01:24 -07:00
2014-07-28 14:16:30 -04:00
2014-07-23 10:17:54 -07:00
2014-10-24 13:30:47 +02:00
2014-08-29 16:35:53 +02:00
2014-09-12 14:01:54 -07:00
2014-09-23 10:02:31 -04:00
2014-10-14 02:18:13 +02:00
2014-10-13 15:51:40 +02:00
2014-10-08 10:39:41 +05:30
2014-10-08 10:39:41 +05:30
2014-09-29 11:56:02 -04:00
2014-08-06 18:01:15 -07:00
2014-10-09 22:25:59 -04:00
2014-10-09 22:25:52 -04:00
2014-10-09 22:25:56 -04:00
2014-07-11 18:27:56 -07:00
2014-10-10 15:35:13 -04:00
2014-10-09 22:26:01 -04:00
2014-08-08 15:57:23 -07:00
2014-10-20 09:50:11 -07:00
2014-10-09 22:25:58 -04:00
2014-09-24 14:07:58 +02:00
2014-10-09 22:25:57 -04:00
2014-07-27 20:52:44 +09:30
2014-07-27 20:52:42 +09:30
2014-10-14 02:18:28 +02:00
2014-08-11 11:44:11 -07:00
2014-10-01 12:21:23 -06:00
2014-08-13 10:32:03 +02:00
2014-07-16 12:58:36 +00:00
2014-07-24 01:15:04 -07:00
2014-10-15 12:11:00 -04:00
2014-09-26 18:42:31 +02:00
2014-08-25 10:45:28 +02:00
2014-09-30 16:24:56 -04:00
2014-09-30 16:24:56 -04:00
2014-10-18 11:53:51 -07:00
2014-08-22 18:04:43 -04:00
2014-09-30 17:22:02 -04:00
2014-10-14 02:18:27 +02:00
2014-08-06 18:01:21 -07:00
2014-07-29 18:08:50 -07:00
2014-09-30 17:08:40 -06:00
2014-07-26 00:21:41 +05:30
2014-07-29 21:26:45 -06:00
2014-07-02 00:24:14 -07:00
2014-09-30 17:08:57 -06:00
2014-07-07 13:33:46 +01:00
2014-08-01 12:22:21 -06:00
2014-10-04 21:24:26 +01:00
2014-07-09 14:58:37 +01:00
2014-09-18 09:53:25 -07:00
2014-07-29 12:38:07 +02:00
2014-08-06 18:01:21 -07:00
2014-07-16 13:28:05 +02:00
2014-08-08 15:57:18 -07:00
2014-08-06 18:01:17 -07:00
2014-10-09 22:26:01 -04:00
2014-09-12 20:09:52 -06:00
2014-10-15 06:58:16 +02:00
2014-07-23 01:00:45 +02:00
2014-10-09 15:03:49 -04:00
2014-07-09 14:58:37 +01:00
2014-09-08 09:51:29 +09:00
2014-08-26 13:45:56 -04:00
2014-10-10 07:26:02 -04:00
2014-09-02 14:46:05 -04:00
2014-08-24 08:11:09 -03:00
2014-10-07 13:06:45 -04:00
2014-08-23 11:39:09 -07:00
2014-08-04 10:07:11 -07:00
2014-10-08 10:39:33 +05:30
2014-07-08 15:31:26 -07:00
2014-10-03 15:43:14 +02:00
2014-07-23 01:00:36 +02:00
2014-10-07 01:18:12 +02:00
2014-10-19 20:22:32 +03:00
2014-09-16 11:01:28 +02:00
2014-08-13 15:13:44 +10:00
2014-09-17 16:33:11 -04:00
2014-09-08 09:51:30 +09:00
2014-07-07 16:57:18 -07:00
2014-07-03 17:27:23 -07:00
2014-07-15 22:40:22 +02:00
2014-08-24 18:36:01 -07:00
2014-06-25 11:22:03 -07:00
2014-10-14 02:18:21 +02:00
2014-08-06 18:01:24 -07:00
2014-09-16 13:41:44 -07:00
2014-09-07 16:27:35 -07:00
2014-09-26 00:00:06 -07:00
2014-07-25 19:01:53 +01:00
2014-07-08 13:41:08 -07:00
2014-09-03 20:56:32 -07:00
2014-08-08 15:57:24 -07:00
2014-10-09 22:25:57 -04:00
2014-06-19 21:17:37 -07:00
2014-06-21 22:05:30 +02:00
2014-09-13 12:30:26 -04:00
2014-07-16 14:56:55 +02:00
2014-08-13 10:32:03 +02:00
2014-08-08 15:57:26 -07:00
2014-10-13 16:23:15 +02:00
2014-10-09 22:26:04 -04:00
2014-09-03 14:58:17 -07:00
2014-10-12 10:13:55 -04:00
2014-09-19 12:35:16 +02:00
2014-08-28 11:59:38 +05:30
2014-09-29 18:20:38 -07:00
2014-09-26 18:01:56 +02:00
2014-07-23 01:10:45 +02:00
2014-07-09 10:55:57 +02:00
2014-07-02 16:01:51 +02:00
2014-08-08 15:57:26 -07:00
2014-08-08 15:57:31 -07:00
2014-10-14 02:18:20 +02:00
2014-10-14 13:10:31 -04:00
2014-10-09 22:25:51 -04:00
2014-10-09 22:25:50 -04:00
2014-09-19 12:35:15 +02:00
2014-06-27 11:47:58 -07:00
2014-08-13 10:32:38 +02:00
2014-07-31 14:13:29 -07:00
2014-10-14 02:18:26 +02:00
2014-10-14 02:18:23 +02:00
2014-09-30 21:06:07 +02:00
2014-10-09 22:25:59 -04:00
2014-09-26 15:05:14 -04:00
2014-08-08 15:57:24 -07:00
2014-09-27 09:14:59 -06:00
2014-10-08 21:40:54 -04:00
2014-07-22 10:12:05 +08:00
2014-09-26 08:15:29 +01:00
2014-10-14 03:47:00 +02:00
2014-07-23 10:17:53 -07:00
2014-07-23 10:17:54 -07:00
2014-07-30 09:26:25 +02:00
2014-07-23 15:01:55 -07:00
2014-07-18 11:49:57 +02:00
2014-10-09 22:25:51 -04:00
2014-09-16 13:41:06 -07:00
2014-07-29 23:10:56 +02:00
2014-07-01 07:13:39 -04:00
2014-08-06 13:03:43 +02:00
2014-09-10 10:48:46 -04:00
2014-09-23 21:19:35 -07:00
2014-09-25 12:17:25 +02:00
2014-09-01 21:36:28 -07:00
2014-10-02 21:35:54 -07:00
2014-10-09 02:39:03 -04:00
2014-09-23 21:40:48 -07:00
2014-09-25 17:05:12 +02:00
2014-08-08 15:57:22 -07:00
2014-07-09 14:58:37 +01:00
2014-08-08 10:39:16 -06:00
2014-09-18 19:21:20 -04:00
2014-09-16 15:02:55 -06:00
2014-10-15 10:25:01 +10:30
2014-10-15 10:24:56 +10:30
2014-10-09 22:26:01 -04:00
2014-08-06 18:01:19 -07:00
2014-10-13 16:23:15 +02:00
2014-10-20 20:46:25 +02:00
2014-09-13 05:13:08 +09:00
2014-07-16 15:10:39 +02:00
2014-08-06 18:01:23 -07:00
2014-08-08 15:57:26 -07:00
2014-08-06 18:01:23 -07:00
2014-10-09 22:26:02 -04:00