qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] cpu-exec(): also reload CPUClass *cc after long


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH] cpu-exec(): also reload CPUClass *cc after longjmp return
Date: Fri, 04 Oct 2013 09:15:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2013-10-03 18:05, Peter Maydell wrote:
> On 3 October 2013 23:09, Juergen Lock <address@hidden> 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 <address@hidden>
>> Found-by: Dimitry Andric <address@hidden>
>>
>> --- 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 via email to

[Prev in Thread] Current Thread [Next in Thread]