qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Roman Bolshakov <r.bolshakov@yadro.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	"patches@linaro.org" <patches@linaro.org>,
	John Arbuckle <programmingkidx@gmail.com>,
	Berkus Decker <berkus@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Ben Hekster <ben.hekster@foghorn.io>,
	BALATON Zoltan <balaton@eik.bme.hu>
Subject: Re: [Qemu-devel] [PATCH v2 1/7] ui/cocoa: Ensure we have the iothread lock when calling into QEMU
Date: Sat, 23 Feb 2019 13:11:29 +0000	[thread overview]
Message-ID: <CAFEAcA_bG6up1hqJunyyOgQreEX5GWGGcS4W7n1SKQMvSO1NaA@mail.gmail.com> (raw)
In-Reply-To: <20190222214806.km4yjotea6cstkhy@SPB-NB-133.local>

On Fri, 22 Feb 2019 at 21:48, Roman Bolshakov <r.bolshakov@yadro.com> wrote:
>
> On Fri, Feb 22, 2019 at 03:41:05PM +0000, Peter Maydell wrote:
> > On Fri, 22 Feb 2019 at 15:19, Roman Bolshakov <r.bolshakov@yadro.com> wrote:
> > >
> > > On Thu, Feb 14, 2019 at 10:28:10AM +0000, Peter Maydell wrote:
> > > > The Cocoa UI should run on the main thread; this is enforced
> > > > in OSX Mojave. In order to be able to run on the main thread,
> > > > we need to make sure we hold the iothread lock whenever we
> > > > call into various QEMU UI midlayer functions.
> > > >
> > >
> > > I also think it's better to clarify that the reason of the commit is not
> > > Mojave enforcing usage of event loop in main thread but an improvement
> > > of event processing in Cocoa UI, because Cocoa UI works on Mojave.
> >
> > Hmm? The point of this patchset is exactly that Mojave enforces
> > that things go on the main thread, where previous OSX versions
> > did not, and so in some situations QEMU will crash on Mojave
> > where it did not on older versions. So I'm not sure what you're
> > suggesting should be clarified here.
> >
>
> I'm not exactly sure there's an issue with QEMU on Mojave. But I lean
> towards the opinion because I haven't seen it :)

It only happens for some guest workloads. The "usual" case
is that the cocoa_refresh callback is called from the QEMU
main loop, which happens to be on the OSX main thread, which
means OSX is still happy. But in some cases cocoa_refresh can
be called from a guest vCPU thread -- I think we've seen this
when a guest initiates a screen resolution change: the call
from the guest vCPU thread goes into the model of the graphics
device, which makes a call into the UI midlayer to say
"resolution changed", which immediately triggers a
refresh callback to the UI frontend layer from that thread.
In Mojave this causes OSX to terminate QEMU. I think in
older OSX versions it would probably be a race condition,
so it's technically a bug but not one that usually has
any visible bad effects; it's only surfaced as a problem
now that Mojave actively checks for this condition and
kills the process.

thanks
-- PMM

  reply	other threads:[~2019-02-23 13:13 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 10:28 [Qemu-devel] [PATCH v2 0/7] ui/cocoa: Use OSX's main loop Peter Maydell
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 1/7] ui/cocoa: Ensure we have the iothread lock when calling into QEMU Peter Maydell
2019-02-22 15:19   ` Roman Bolshakov
2019-02-22 15:41     ` Peter Maydell
2019-02-22 21:48       ` Roman Bolshakov
2019-02-23 13:11         ` Peter Maydell [this message]
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 2/7] ui/cocoa: Use the pixman image directly in switchSurface Peter Maydell
2019-02-14 17:19   ` BALATON Zoltan
2019-02-22 17:27   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 3/7] ui/cocoa: Factor out initial menu creation Peter Maydell
2019-02-14 17:11   ` BALATON Zoltan
2019-02-22 17:47   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 4/7] ui/cocoa: Move console/device menu creation code up in file Peter Maydell
2019-02-15  0:34   ` BALATON Zoltan
2019-02-22 18:10   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 5/7] ui/cocoa: Don't call NSApp sendEvent directly from handleEvent Peter Maydell
2019-02-14 17:04   ` BALATON Zoltan
2019-02-14 17:41     ` Peter Maydell
2019-02-15  0:42       ` BALATON Zoltan
2019-02-22 19:20   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 6/7] ui/cocoa: Subclass NSApplication so we can implement sendEvent Peter Maydell
2019-02-14 17:21   ` BALATON Zoltan
2019-02-22 20:18   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 7/7] ui/cocoa: Perform UI operations only on the main thread Peter Maydell
2019-02-15  0:55   ` BALATON Zoltan
2019-02-15  1:28   ` BALATON Zoltan
2019-02-15 10:04     ` Peter Maydell
2019-02-16  1:15       ` BALATON Zoltan
2019-02-22 21:35   ` Roman Bolshakov
2019-02-14 11:07 ` [Qemu-devel] [PATCH v2 0/7] ui/cocoa: Use OSX's main loop no-reply
2019-02-14 11:11 ` no-reply
2019-02-14 17:44 ` no-reply
2019-02-14 17:48 ` no-reply
2019-02-14 17:52 ` no-reply
2019-02-15  1:01 ` no-reply
2019-02-27 15:24 ` no-reply
2019-02-27 15:29 ` no-reply
2019-02-27 17:41 ` no-reply

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=CAFEAcA_bG6up1hqJunyyOgQreEX5GWGGcS4W7n1SKQMvSO1NaA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=ben.hekster@foghorn.io \
    --cc=berkus@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=patches@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).