diff mbox

[v1,09/11] target/s390x: tcg_s390_program_interrupt() will never return

Message ID 20170830170601.15855-10-david@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Hildenbrand Aug. 30, 2017, 5:05 p.m. UTC
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(-)

Comments

Thomas Huth Aug. 30, 2017, 8:45 p.m. UTC | #1
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
David Hildenbrand Aug. 31, 2017, 12:14 p.m. UTC | #2
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
>
diff mbox

Patch

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)