All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Jan Kiszka <jan.kiszka@web.de>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD (v2)
Date: Thu, 17 Feb 2011 09:27:43 +0100	[thread overview]
Message-ID: <4D5CDBFF.3030808@redhat.com> (raw)
In-Reply-To: <20110217031538.GA22552@amt.cnet>

On 02/17/2011 04:15 AM, Marcelo Tosatti wrote:
> Yes, using qemu_icount_delta directly in tcg_wait_io_event timedwait
> is explicit (partially the reason for confusion with my patch).
>
> So the reasoning for the patch is:
>
> With icount vm_timer timers expire on virtual CPU time. If a CPU halts,
> you cannot expect passage of realtime to trigger vm_timers expiration.

But if a CPU is halted, all_cpu_threads_idle() will still be true even 
if you signal the condition variable, and you'll be looping in the while 
condition.  That's why I say that

    while (x) {
        cond_timedwait (cond, mutex);
    }

(i.e. without checking the return value of cond_timedwait, and without 
polling something else upon return) is a broken idiom that can only work 
around missing signals/broadcasts.

> So instead vm_timer expiration is converted to realtime, and used as
> halt timeout.

But vm_timer timers are only used by "-icount auto", which works in my 
tests [*].  It is "-icount N" which is broken and unfortunately your 
patch does not fix it.  The CRIS image on qemu.org triggers the watchdog 
(and if I eliminate the watchdog I see that the CPU is hung).

     [*] Actually, it works but doesn't calibrate very well.  It shows
         25 bogomips, sometimes 50, compared to 250 without iothread.

Paolo

  reply	other threads:[~2011-02-17  8:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 17:54 [Qemu-devel] [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD Marcelo Tosatti
2011-02-15 18:58 ` [Qemu-devel] " Jan Kiszka
2011-02-15 20:04   ` Marcelo Tosatti
2011-02-15 20:33     ` Jan Kiszka
2011-02-15 20:55       ` Marcelo Tosatti
2011-02-15 20:56         ` [Qemu-devel] [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD (v2) Marcelo Tosatti
2011-02-16  8:27           ` [Qemu-devel] " Jan Kiszka
2011-02-16  9:32           ` Paolo Bonzini
2011-02-16  9:46             ` Jan Kiszka
2011-02-16  9:57               ` Paolo Bonzini
2011-02-16 10:04                 ` Jan Kiszka
2011-02-16 10:27                   ` Paolo Bonzini
2011-02-16 10:34                     ` Jan Kiszka
2011-02-16 11:05                       ` Paolo Bonzini
2011-02-17  3:15             ` Marcelo Tosatti
2011-02-17  8:27               ` Paolo Bonzini [this message]
2011-02-18 17:13                 ` Paolo Bonzini
2011-02-17  8:29               ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D5CDBFF.3030808@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=jan.kiszka@web.de \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.