kvm: Rework VCPU reset
Use standard callback with highest order to synchronize VCPU on reset after all device callbacks were execute. This allows to remove the special kvm hook in qemu_system_reset. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
		
							parent
							
								
									8217606e6e
								
							
						
					
					
						commit
						d33a1810d7
					
				|  | @ -22,6 +22,7 @@ | ||||||
| 
 | 
 | ||||||
| #include "qemu-common.h" | #include "qemu-common.h" | ||||||
| #include "sysemu.h" | #include "sysemu.h" | ||||||
|  | #include "hw/hw.h" | ||||||
| #include "gdbstub.h" | #include "gdbstub.h" | ||||||
| #include "kvm.h" | #include "kvm.h" | ||||||
| 
 | 
 | ||||||
|  | @ -376,6 +377,11 @@ int kvm_check_extension(KVMState *s, unsigned int extension) | ||||||
|     return ret; |     return ret; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static void kvm_reset_vcpus(void *opaque) | ||||||
|  | { | ||||||
|  |     kvm_sync_vcpus(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| int kvm_init(int smp_cpus) | int kvm_init(int smp_cpus) | ||||||
| { | { | ||||||
|     KVMState *s; |     KVMState *s; | ||||||
|  | @ -462,6 +468,8 @@ int kvm_init(int smp_cpus) | ||||||
|     if (ret < 0) |     if (ret < 0) | ||||||
|         goto err; |         goto err; | ||||||
| 
 | 
 | ||||||
|  |     qemu_register_reset(kvm_reset_vcpus, INT_MAX, NULL); | ||||||
|  | 
 | ||||||
|     kvm_state = s; |     kvm_state = s; | ||||||
| 
 | 
 | ||||||
|     return 0; |     return 0; | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								vl.c
								
								
								
								
							
							
						
						
									
										2
									
								
								vl.c
								
								
								
								
							|  | @ -3659,8 +3659,6 @@ void qemu_system_reset(void) | ||||||
|     for(re = first_reset_entry; re != NULL; re = re->next) { |     for(re = first_reset_entry; re != NULL; re = re->next) { | ||||||
|         re->func(re->opaque); |         re->func(re->opaque); | ||||||
|     } |     } | ||||||
|     if (kvm_enabled()) |  | ||||||
|         kvm_sync_vcpus(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void qemu_system_reset_request(void) | void qemu_system_reset_request(void) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Jan Kiszka
						Jan Kiszka