From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Bug 1675108 <1675108@bugs.launchpad.net>,
QEMU Developers <qemu-devel@nongnu.org>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [Bug 1675108] [NEW] Cocoa UI always crashes on startup
Date: Thu, 23 Mar 2017 11:13:02 +0000 [thread overview]
Message-ID: <87d1d8xn41.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA8UYsjy6sBTGqk1Crd-0tWpF0WWukA03_GyNRaG95L07Q@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On 22 March 2017 at 17:26, Brendan Shanks <brendan@bslabs.net> wrote:
>> Public bug reported:
>>
>> Commit 8bb93c6f99a42c2e0943bc904b283cd622d302c5 ("ui/console: ensure
>> graphic updates don't race with TCG vCPUs") causes the graphic update to
>> run on a non-main thread, which Cocoa is not happy with. It crashes
>> immediately after startup.
>
> Oops. Alex, we can't just run UI code on random threads like this.
Technically its not a random thread its the vCPU context (which ensures
the vCPU isn't updating while the display is being updated). But I guess
the Cocoa is limited to not being able to update from an arbitrary
thread?
There was a patch posted yesterday to ensure the BQL is held during the
deferred work but this doesn't look like that.
> Any ideas?
Hmm a quick Google seems to imply Cocoa is inflexible in its
requirements. You can try this ugly but untested patch (I don't have any
Macs handy):
modified ui/console.c
@@ -1598,8 +1598,16 @@ static void dpy_refresh(DisplayState *s)
QLIST_FOREACH(dcl, &s->listeners, next) {
if (dcl->ops->dpy_refresh) {
if (tcg_enabled()) {
+#ifdef CONFIG_COCOA
+ qemu_mutex_unlock_iothread();
+ start_exclusive();
+ do_safe_dpy_refresh(first_cpu, RUN_ON_CPU_HOST_PTR(dcl));
+ end_exclusive();
+ qemu_mutex_lock_iothread();
+#else
async_safe_run_on_cpu(first_cpu, do_safe_dpy_refresh,
RUN_ON_CPU_HOST_PTR(dcl));
+#endif
} else {
dcl->ops->dpy_refresh(dcl);
}
Other than that I guess we need to bring forward the plans to "fixed the dirty tracking
races in display adapters"
>
> thanks
> -- PMM
--
Alex Bennée
next prev parent reply other threads:[~2017-03-23 11:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 17:26 [Qemu-devel] [Bug 1675108] [NEW] Cocoa UI always crashes on startup Brendan Shanks
2017-03-23 9:46 ` Peter Maydell
2017-03-23 11:13 ` Alex Bennée [this message]
2017-03-23 11:16 ` Peter Maydell
2017-03-23 11:31 ` Alex Bennée
2017-03-27 13:29 ` Gerd Hoffmann
2017-03-27 15:18 ` Alex Bennée
2017-03-27 15:19 ` Peter Maydell
2017-03-24 6:29 ` [Qemu-devel] [Bug 1675108] " Brendan Shanks
2017-03-24 7:52 ` Alex Bennée
2017-03-24 6:38 ` Brendan Shanks
2017-03-27 18:52 ` Brendan Shanks
2017-03-27 19:25 ` Alex Bennée
2017-03-29 17:50 ` Brendan Shanks
[not found] <mailman.60832.1490268929.22740.qemu-devel@nongnu.org>
2017-03-24 1:53 ` [Qemu-devel] [Bug 1675108] [NEW] " Programmingkid
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=87d1d8xn41.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=1675108@bugs.launchpad.net \
--cc=kraxel@redhat.com \
--cc=peter.maydell@linaro.org \
--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.