[Qemu-devel] [PATCH v1 09/11] target/s390x: tcg_s390_program_interrupt() will never return

David Hildenbrand posted 11 patches 8 years, 2 months ago
[Qemu-devel] [PATCH v1 09/11] target/s390x: tcg_s390_program_interrupt() will never return
Posted by David Hildenbrand 8 years, 2 months ago
The assert should hold in both scenarios.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/interrupt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c
index 058e219fe5..79bab5e2f3 100644
--- a/target/s390x/interrupt.c
+++ b/target/s390x/interrupt.c
@@ -32,9 +32,8 @@ static void tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code,
 #ifdef CONFIG_TCG
     trigger_pgm_exception(env, code, ilen);
     cpu_loop_exit(CPU(s390_env_get_cpu(env)));
-#else
-    g_assert_not_reached();
 #endif
+    g_assert_not_reached();
 }
 
 void program_interrupt(CPUS390XState *env, uint32_t code, int ilen)
-- 
2.13.5


Re: [Qemu-devel] [PATCH v1 09/11] target/s390x: tcg_s390_program_interrupt() will never return
Posted by Thomas Huth 8 years, 2 months ago
On 30.08.2017 19:05, David Hildenbrand wrote:
> The assert should hold in both scenarios.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/interrupt.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c
> index 058e219fe5..79bab5e2f3 100644
> --- a/target/s390x/interrupt.c
> +++ b/target/s390x/interrupt.c
> @@ -32,9 +32,8 @@ static void tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code,
>  #ifdef CONFIG_TCG
>      trigger_pgm_exception(env, code, ilen);
>      cpu_loop_exit(CPU(s390_env_get_cpu(env)));
> -#else
> -    g_assert_not_reached();
>  #endif
> +    g_assert_not_reached();
>  }

Not sure if this really makes sense ... cpu_loop_exit() is already
marked with QEMU_NORETURN, so a know-it-all new version of GCC might
complain one day if there's other code after this call. I'd better keep
it the way it is.

 Thomas

Re: [Qemu-devel] [PATCH v1 09/11] target/s390x: tcg_s390_program_interrupt() will never return
Posted by David Hildenbrand 8 years, 2 months ago
On 30.08.2017 22:45, Thomas Huth wrote:
> On 30.08.2017 19:05, David Hildenbrand wrote:
>> The assert should hold in both scenarios.
>>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>> ---
>>  target/s390x/interrupt.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c
>> index 058e219fe5..79bab5e2f3 100644
>> --- a/target/s390x/interrupt.c
>> +++ b/target/s390x/interrupt.c
>> @@ -32,9 +32,8 @@ static void tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code,
>>  #ifdef CONFIG_TCG
>>      trigger_pgm_exception(env, code, ilen);
>>      cpu_loop_exit(CPU(s390_env_get_cpu(env)));
>> -#else
>> -    g_assert_not_reached();
>>  #endif
>> +    g_assert_not_reached();
>>  }
> 
> Not sure if this really makes sense ... cpu_loop_exit() is already
> marked with QEMU_NORETURN, so a know-it-all new version of GCC might
> complain one day if there's other code after this call. I'd better keep
> it the way it is.

Good point, I'll drop this patch. Thanks!

> 
>  Thomas
> 


-- 

Thanks,

David