qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Dimitry Andric <dim@freebsd.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Juergen Lock <qemu-l@jelal.kn-bremen.de>,
	Andreas Faerber <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] cpu-exec(): also reload CPUClass *cc after longjmp return
Date: Fri, 04 Oct 2013 09:15:37 +0200	[thread overview]
Message-ID: <524E6B19.9020805@siemens.com> (raw)
In-Reply-To: <CAFEAcA_vr+t0RdKhAywjJ_shAdVBF4j002hiz3oWCH=XkCiwaA@mail.gmail.com>

On 2013-10-03 18:05, Peter Maydell wrote:
> On 3 October 2013 23:09, Juergen Lock <qemu-l@jelal.kn-bremen.de> wrote:
>> Local variable CPUClass *cc needs to be reloaded after return from longjmp
>> too.  (This fixes the mips-softmmu crash observed on FreeBSD when qemu is
>> built with clang.)
>>
>> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
>> Found-by: Dimitry Andric <dim@FreeBSD.org>
>>
>> --- a/cpu-exec.c
>> +++ b/cpu-exec.c
>> @@ -681,6 +681,10 @@ int cpu_exec(CPUArchState *env)
>>               * local variables as longjmp is marked 'noreturn'. */
>>              cpu = current_cpu;
>>              env = cpu->env_ptr;
>> +#if !(defined(CONFIG_USER_ONLY) && \
>> +      (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X)))
>> +            cc = CPU_GET_CLASS(cpu);
>> +#endif
> 
> This is a c compiler or libc bug -- the C standard says that this
> local variable should not be trashed by the longjmp. We were
> actually discussing removing the current workarounds there...

But we didn't decide if we should stop supporting the affected compiler
versions.

Does this issue also exist with the latest clang version available for
your platform?

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2013-10-04  7:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-03 14:09 [Qemu-devel] [PATCH] cpu-exec(): also reload CPUClass *cc after longjmp return Juergen Lock
2013-10-03 16:05 ` Peter Maydell
2013-10-04  7:15   ` Jan Kiszka [this message]
2013-10-05 17:54     ` Juergen Lock
2013-10-05 18:06       ` Stefan Weil
2013-10-05 21:45         ` Juergen Lock
2013-10-07  7:28           ` Andreas Färber

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=524E6B19.9020805@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=afaerber@suse.de \
    --cc=dim@freebsd.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-l@jelal.kn-bremen.de \
    /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).