From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Taimoor Mirza <taimoor.mrza@gmail.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Problems with QEMU sdcard while using glib 2.33.8
Date: Thu, 19 Sep 2013 15:38:39 +0200 [thread overview]
Message-ID: <523AFE5F.9080808@redhat.com> (raw)
In-Reply-To: <CAJSP0QWLt4a-Etvp1Lae3QEX1YpWs+t6V3TCtnDjMCjX87RisA@mail.gmail.com>
Il 19/09/2013 10:11, Stefan Hajnoczi ha scritto:
> On Thu, Sep 19, 2013 at 8:36 AM, Taimoor Mirza <taimoor.mrza@gmail.com> wrote:
>
> Please use Reply-All to keep the CC list on your reply email. This
> way others on the mailing list can follow the discussion and
> participate.
>
>> O1 disassembly is at http://pastebin.com/yxWAmmmf
>>
>> O2 disassembly is at http://pastebin.com/v0uqHuYY
>
> I diffed them. The differences look reasonable, nothing obviously broken:
> * The broken -O2 version inlines qemu_coroutine_switch() into
> coroutine_trampoline().
> * The broken -O2 version changes the ordering of basic blocks and
> switches a few instructions for shorter/cheaper equivalents.
>
> Taimoor: Can you try "make check" with the -O2 version? In
> particular, the test-coroutine tests may fail and that could help us
> figure out which operation is broken.
>
> Paolo: CCed you in case you want to diff the working -O1 against the
> broken -O2 disassembly. Perhaps Taimoor's gcc 4.6.2 -O2 subtly breaks
> around the Windows Fiber API calls.
Taimoor, can you please try compiling coroutine-win32.c at
-O2 but without the -fstack-protector-all compiler option? If it works,
please try with -fstack-protector instead of -fstack-protector-all.
Also (separately from the above experiment), can you try this patch and
see if it breaks/works at -O1 and -O2? Then, independent of the result,
please post -O1 and -O2 assembly outputs with the patch.
diff --git a/coroutine-win32.c b/coroutine-win32.c
index edc1f72..3b10189 100644
--- a/coroutine-win32.c
+++ b/coroutine-win32.c
@@ -55,7 +55,13 @@ static void CALLBACK coroutine_trampoline(void *co_)
while (true) {
co->entry(co->entry_arg);
- qemu_coroutine_switch(co, co->caller, COROUTINE_TERMINATE);
+ Coroutine *to_ = co->caller;
+ CoroutineWin32 *from = DO_UPCAST(CoroutineWin32, base, co);
+ CoroutineWin32 *to = DO_UPCAST(CoroutineWin32, base, to_);
+
+ current = to_;
+ to->action = COROUTINE_TERMINATE;
+ SwitchToFiber(to->fiber);
}
}
Thanks,
Paolo
prev parent reply other threads:[~2013-09-19 13:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 5:14 [Qemu-devel] Problems with QEMU sdcard while using glib 2.33.8 Taimoor Mirza
2013-08-28 8:11 ` Stefan Hajnoczi
2013-08-28 11:17 ` Taimoor Mirza
2013-08-28 13:38 ` Stefan Hajnoczi
2013-08-28 19:10 ` Taimoor Mirza
2013-08-29 6:31 ` Taimoor Mirza
2013-08-29 6:59 ` Taimoor Mirza
2013-08-29 8:28 ` Stefan Hajnoczi
2013-09-05 11:02 ` Taimoor Mirza
2013-09-18 14:10 ` Stefan Hajnoczi
[not found] ` <CAO6-N=YYXGWE==E_jFB+onOCZQs=LQ5WxwUgiPSBH0vscgkPFw@mail.gmail.com>
2013-09-19 8:11 ` Stefan Hajnoczi
2013-09-19 13:38 ` Paolo Bonzini [this message]
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=523AFE5F.9080808@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=taimoor.mrza@gmail.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.