kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle
With in-kernel irqchip support enabled, the vcpu threads sleep in kernel space while halted. Account for this difference in cpu_thread_is_idle. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
		
							parent
							
								
									fd28aa1323
								
							
						
					
					
						commit
						f2c1cc81c8
					
				
							
								
								
									
										3
									
								
								cpus.c
								
								
								
								
							
							
						
						
									
										3
									
								
								cpus.c
								
								
								
								
							| 
						 | 
				
			
			@ -148,7 +148,8 @@ static bool cpu_thread_is_idle(CPUState *env)
 | 
			
		|||
    if (env->stopped || !vm_running) {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    if (!env->halted || qemu_cpu_has_work(env)) {
 | 
			
		||||
    if (!env->halted || qemu_cpu_has_work(env) ||
 | 
			
		||||
        (kvm_enabled() && kvm_irqchip_in_kernel())) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue