From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Aaron Elkins <threcius@yahoo.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] Qemu: Guest Linux hangs on Mac OS X 10.11
Date: Mon, 9 Nov 2015 14:40:06 +0100 [thread overview]
Message-ID: <5640A236.4010501@redhat.com> (raw)
In-Reply-To: <CAFEAcA_eK1np4MmyAfPAEyNh1gFQC9bpNuvbNmninbhgbY-6hg@mail.gmail.com>
On 09/11/2015 14:30, Peter Maydell wrote:
> After a bunch of "try building specific object files with optimization
> off to see where the problem goes away" tests, I've narrowed the
> problem down further: if you tell clang to disable optimization by
> adding __attribute__ ((optnone)) to the two functions
> hpet_time_after() and hpet_time_after64() in hw/timer/hpet.c then
> the problem goes away.
>
> My current theory is that we're doing something here that's not
> valid C and the compiler ends up optimizing it into something
> that results in the timer setting the next-timeout to a very
> short interval and that's what's hogging the main-loop time.
> I'll look in more detail after lunch.
The obvious way to write those functions would be
static uint32_t hpet_time_after(uint64_t a, uint64_t b)
{
return ((int32_t)(b - a)) < 0;
}
static uint32_t hpet_time_after64(uint64_t a, uint64_t b)
{
return ((int64_t)(b - a)) < 0;
}
Paolo
next prev parent reply other threads:[~2015-11-09 13:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 7:32 [Qemu-devel] Qemu: Guest Linux hangs on Mac OS X 10.11 Aaron Elkins
2015-10-18 19:46 ` Peter Maydell
2015-10-18 20:37 ` Peter Maydell
2015-10-19 5:09 ` Aaron Elkins
2015-10-19 5:50 ` Aaron Elkins
2015-11-08 22:55 ` Peter Maydell
2015-11-09 9:10 ` Paolo Bonzini
2015-11-09 10:02 ` Peter Maydell
2015-11-09 10:21 ` Paolo Bonzini
2015-11-09 11:06 ` Peter Maydell
2015-11-09 11:46 ` Peter Maydell
2015-11-09 13:30 ` Peter Maydell
2015-11-09 13:40 ` Paolo Bonzini [this message]
2015-11-09 14:26 ` Peter Maydell
2015-11-09 16:59 ` Peter Maydell
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=5640A236.4010501@redhat.com \
--to=pbonzini@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=threcius@yahoo.com \
/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.