diff mbox

[1/6] env->kvm_cpu_state.init is always zero here.

Message ID 1244976742-22926-1-git-send-email-gleb@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gleb Natapov June 14, 2009, 10:52 a.m. UTC
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 qemu-kvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Avi Kivity June 15, 2009, 9:55 a.m. UTC | #1
On 06/14/2009 01:52 PM, Gleb Natapov wrote:
> Signed-off-by: Gleb Natapov<gleb@redhat.com>
> ---
>   qemu-kvm.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-kvm.c b/qemu-kvm.c
> index 2aeb17c..ec911ef 100644
> --- a/qemu-kvm.c
> +++ b/qemu-kvm.c
> @@ -412,7 +412,7 @@ static int kvm_main_loop_cpu(CPUState *env)
>   	    if (env->kvm_cpu_state.sipi_needed)
>   	        update_regs_for_sipi(env);
>       }
> -	if (!env->halted&&  !env->kvm_cpu_state.init)
> +	if (!env->halted)
>   	    kvm_cpu_exec(env);
>   	env->exit_request = 0;
>           env->exception_index = EXCP_INTERRUPT;
>    

Are you sure?  Can't a reset reenable it?
Gleb Natapov June 15, 2009, 9:58 a.m. UTC | #2
On Mon, Jun 15, 2009 at 12:55:27PM +0300, Avi Kivity wrote:
> On 06/14/2009 01:52 PM, Gleb Natapov wrote:
>> Signed-off-by: Gleb Natapov<gleb@redhat.com>
>> ---
>>   qemu-kvm.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/qemu-kvm.c b/qemu-kvm.c
>> index 2aeb17c..ec911ef 100644
>> --- a/qemu-kvm.c
>> +++ b/qemu-kvm.c
>> @@ -412,7 +412,7 @@ static int kvm_main_loop_cpu(CPUState *env)
>>   	    if (env->kvm_cpu_state.sipi_needed)
>>   	        update_regs_for_sipi(env);
>>       }
>> -	if (!env->halted&&  !env->kvm_cpu_state.init)
>> +	if (!env->halted)
>>   	    kvm_cpu_exec(env);
>>   	env->exit_request = 0;
>>           env->exception_index = EXCP_INTERRUPT;
>>    
>
> Are you sure?  Can't a reset reenable it?
>
The thing is used only with userspace irq chip. If
env->kvm_cpu_state.init == 1 update_regs_for_init() is called
three line above and it will set kvm_cpu_state.init to zero.

--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Avi Kivity June 15, 2009, 10:05 a.m. UTC | #3
On 06/15/2009 12:58 PM, Gleb Natapov wrote:
> On Mon, Jun 15, 2009 at 12:55:27PM +0300, Avi Kivity wrote:
>    
>> On 06/14/2009 01:52 PM, Gleb Natapov wrote:
>>      
>>> Signed-off-by: Gleb Natapov<gleb@redhat.com>
>>> ---
>>>    qemu-kvm.c |    2 +-
>>>    1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/qemu-kvm.c b/qemu-kvm.c
>>> index 2aeb17c..ec911ef 100644
>>> --- a/qemu-kvm.c
>>> +++ b/qemu-kvm.c
>>> @@ -412,7 +412,7 @@ static int kvm_main_loop_cpu(CPUState *env)
>>>    	    if (env->kvm_cpu_state.sipi_needed)
>>>    	        update_regs_for_sipi(env);
>>>        }
>>> -	if (!env->halted&&   !env->kvm_cpu_state.init)
>>> +	if (!env->halted)
>>>    	    kvm_cpu_exec(env);
>>>    	env->exit_request = 0;
>>>            env->exception_index = EXCP_INTERRUPT;
>>>
>>>        
>> Are you sure?  Can't a reset reenable it?
>>
>>      
> The thing is used only with userspace irq chip. If
> env->kvm_cpu_state.init == 1 update_regs_for_init() is called
> three line above and it will set kvm_cpu_state.init to zero.
>    

Right, and nothing can sleep in between.
diff mbox

Patch

diff --git a/qemu-kvm.c b/qemu-kvm.c
index 2aeb17c..ec911ef 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -412,7 +412,7 @@  static int kvm_main_loop_cpu(CPUState *env)
 	    if (env->kvm_cpu_state.sipi_needed)
 	        update_regs_for_sipi(env);
     }
-	if (!env->halted && !env->kvm_cpu_state.init)
+	if (!env->halted)
 	    kvm_cpu_exec(env);
 	env->exit_request = 0;
         env->exception_index = EXCP_INTERRUPT;