From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKuJW-0008G5-EX for qemu-devel@nongnu.org; Mon, 09 Feb 2015 14:48:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKuJR-0004IJ-DP for qemu-devel@nongnu.org; Mon, 09 Feb 2015 14:48:10 -0500 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=47746 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKuJR-0004Hs-7X for qemu-devel@nongnu.org; Mon, 09 Feb 2015 14:48:05 -0500 Message-ID: <54D90EE6.50402@weilnetz.de> Date: Mon, 09 Feb 2015 20:47:50 +0100 From: Stefan Weil MIME-Version: 1.0 References: <20150209075530.4252.76551.stgit@PASHA-ISP> <54D86A13.4070506@weilnetz.de> <001b01d0443f$798174e0$6c845ea0$@Dovgaluk@ispras.ru> In-Reply-To: <001b01d0443f$798174e0$6c845ea0$@Dovgaluk@ispras.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] win64: perform correct setjmp calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgaluk , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, zealot351@gmail.com, maria.klimushenkova@ispras.ru Am 09.02.2015 um 09:07 schrieb Pavel Dovgaluk: >> From: Stefan Weil [mailto:sw@weilnetz.de] >> Am 09.02.2015 um 08:55 schrieb Pavel Dovgalyuk: >>> On w64, setjmp is implemented by _setjmp which needs a second parameter. >>> This parameter should be NULL to allow using longjump from generated code. >>> This patch replaces all usages of setjmp.h with new header files which >>> replaces setjmp with _setjmp function on win64 platform. >>> >>> Signed-off-by: Pavel Dovgalyuk >> Please have a look at include/sysemu/os-win32.h. I think that your patch >> is not needed because the current code already uses _setjmp. > Right, but some of the files (e.g. include/qom/cpu.h) include setjmp.h directly. > Then we have the following for compiling cpu-exec.c: > > cpu-exec.c: > ... > os-win32.h > ... > setjmp.h > ... > > In this situation cpu-exec will call incorrect setjmp function. > > Pavel Dovgalyuk It won't call the wrong setjmp function, at least not in my tests. cpu-exec.c gets the setjmp declaration from os-win32.h. Without it, QEMU would be unusable because it would crash very soon during the emulation. Do you see problems caused by a wrong setjmp with latest QEMU? If yes: which build environment do you use (host, compiler, version of MinGW*)?