From: Stefan Weil <sw@weilnetz.de>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Liviu Ionescu <ilg@livius.net>,
QEMU Developer <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] QEMU 2.4 for Windows - current status
Date: Thu, 06 Aug 2015 12:12:21 +0200 [thread overview]
Message-ID: <55C33305.4040502@weilnetz.de> (raw)
In-Reply-To: <20150806084432.GB4701@noname.str.redhat.com>
Am 06.08.2015 um 10:44 schrieb Kevin Wolf:
> Am 05.08.2015 um 22:30 hat Stefan Weil geschrieben:
>> Am 05.08.2015 um 20:39 schrieb Liviu Ionescu:
>>>> On 05 Aug 2015, at 19:56, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>>
>>>> ... I am not sure why things break for Stefan...
>>> I confirm Stefan's conclusion, neither in my configuration adding
>>>
>>> #include "qemu-common.h"
>>>
>>> ... in cpu-exec.c makes any difference.
>>>
>>> however adding:
>>>
>>> #if defined(_WIN64)
>>> #ifdef sigsetjmp
>>> #undef sigsetjmp
>>> #endif
>>> #define sigsetjmp(env, savesigs) _setjmp(env, NULL)
>>> #endif
>>>
>>> ... fixes the problem, my custom QEMU happily blinks the LEDs on Win 8.1 64-bits (see below).
>>>
>>> perhaps a headers check would be helpful, such mysterious behaviours usually back fire at a certain point.
>>>
>>>
>>> regards,
>>>
>>> Liviu
>> http://qemu.weilnetz.de/test/cpu-exec.i shows the result of
>> the C preprocessor:
>>
>> cpu-exec.c gets QEMU's os-win32.h with our definition of setjmp
>> early, but the system header file setjmp.h is included later, and
>> that file re-defines our definitions. Including setjmp.h from
>> os-win32.h would solve the problem, but I think there is a
>> better solution.
>>
>> I am planning to remove the special definitions for _WIN64 from
>> os-win32.h and add them to cpu-exec.c, similar to the code
>> above (which can be shortened a little)
>> but with some comment lines added.
> What happens with the callers outside of cpu-exec.c then? Fixing the
> problem inside os-win32.h seems more robust to me.
>
> Kevin
(sig)setjmp/(sig)longjmp without TCG generated code on the stack
does not need special handling because stack unwinding works
for compiled normal C code.
We only have a problem on 64 bit Windows with code generated
at run time by TCG because stack unwinding does not work there,
so a siglongjmp which tries to exit from that code will crash QEMU
when trying to unwind the call stack.
As far as I see, the only siglongjmp exits from TCG generated code
are in cpu-exec.c (functions cpu_loop_exit and
cpu_resume_from_signal). The matching sigsetjmp is also in
cpu-exec.c, and here we have to disable stack unwinding
by calling _setjmp(cpu->jmp_env, NULL).
Stefan
next prev parent reply other threads:[~2015-08-06 10:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-31 10:17 [Qemu-devel] [PATCH for-2.4] oslib-win32: only provide localtime_r/gmtime_r if missing Daniel P. Berrange
2015-07-31 12:49 ` Paolo Bonzini
2015-07-31 13:33 ` Daniel P. Berrange
2015-07-31 17:58 ` Stefan Weil
2015-08-05 9:52 ` Daniel P. Berrange
2015-08-05 11:03 ` [Qemu-devel] QEMU 2.4 for Windows - current status Stefan Weil
2015-08-05 12:49 ` Paolo Bonzini
2015-08-05 15:38 ` Stefan Weil
2015-09-10 20:38 ` Stefan Weil
2015-08-05 16:51 ` Liviu Ionescu
2015-08-05 16:56 ` Paolo Bonzini
2015-08-05 18:39 ` Liviu Ionescu
2015-08-05 20:30 ` Stefan Weil
2015-08-05 21:42 ` Liviu Ionescu
2015-08-06 8:44 ` Kevin Wolf
2015-08-06 10:12 ` Stefan Weil [this message]
2015-08-06 17:12 ` Richard Henderson
2015-08-10 10:25 ` Peter Maydell
2015-08-10 11:39 ` Stefan Weil
2015-08-10 14:00 ` Paolo Bonzini
2015-08-10 20:22 ` Stefan Weil
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=55C33305.4040502@weilnetz.de \
--to=sw@weilnetz.de \
--cc=ilg@livius.net \
--cc=kwolf@redhat.com \
--cc=pbonzini@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.