qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] pause_all_vcpus() TCG bug?


From: Jan Kiszka
Subject: Re: [Qemu-devel] pause_all_vcpus() TCG bug?
Date: Thu, 02 May 2013 10:44:35 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2013-05-01 15:47, Peter Maydell wrote:
> On 1 May 2013 14:33, Andreas Färber <address@hidden> wrote:
>> Hello,
>>
>> This is today's function, with annotations and question inline:
>>
>> void pause_all_vcpus(void)
>> {
>>     CPUArchState *penv = first_cpu;
>>
>>     qemu_clock_enable(vm_clock, false);
>>     while (penv) {
>>         CPUState *pcpu = ENV_GET_CPU(penv);
>>         pcpu->stop = true;
>>         qemu_cpu_kick(pcpu);
>>         penv = penv->next_cpu;
>>     }
>>
>> /* So, at this point penv == NULL. */
>>
>>     if (qemu_in_vcpu_thread()) {
>>         cpu_stop_current();
>>         if (!kvm_enabled()) {
>>             while (penv) {
>>
>> /* Looks like this can never be true then? */
>> /* Is penv = first_cpu; missing? */

Yeah, obviously. It practically didn't matter so far for the use case of
pause/resume_all_vcpus over a vcpu itself (kvmvapic). Feel free to fix.

>>
>>                 CPUState *pcpu = ENV_GET_CPU(penv);
>>                 pcpu->stop = 0;
>>
>> /* 0 instead of false may hint at a mismerge... */

Nope, stop was uint32_t at that time.

Jan

>>
>>                 pcpu->stopped = true;
>>                 penv = penv->next_cpu;
>>             }
>>             return;
>>         }
>>     }
> 
> This certainly looks odd. This bug seems to have
> been present since this patch was first committed
> (d798e9745, January last year, by Jan.)
> 
> -- PMM
> 

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux



reply via email to

[Prev in Thread] Current Thread [Next in Thread]