diff mbox series

[v2] linux-user: Mark cpu_loop() with noreturn attribute

Message ID 20211106113916.544587-1-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series [v2] linux-user: Mark cpu_loop() with noreturn attribute | expand

Commit Message

Philippe Mathieu-Daudé Nov. 6, 2021, 11:39 a.m. UTC
cpu_loop() never exits, so mark it with QEMU_NORETURN.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-By: Warner Losh <imp@bsdimp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2:
- rebased
- restricted to linux-user

Supersedes: <20210905000429.1097336-1-f4bug@amsat.org>
---
 linux-user/user-internals.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Warner Losh Nov. 7, 2021, 12:39 a.m. UTC | #1
On Sat, Nov 6, 2021, 5:39 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:

> cpu_loop() never exits, so mark it with QEMU_NORETURN.
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-By: Warner Losh <imp@bsdimp.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> - rebased
> - restricted to linux-user
>
> Supersedes: <20210905000429.1097336-1-f4bug@amsat.org>
>

Reviewed-by: Warner Losh <imp@bsdimp.com>

bsd-user likely needs similar treatment, no?

---
>  linux-user/user-internals.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h
> index 661612a088b..c7ad00268af 100644
> --- a/linux-user/user-internals.h
> +++ b/linux-user/user-internals.h
> @@ -65,7 +65,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
> arg1,
>                      abi_long arg5, abi_long arg6, abi_long arg7,
>                      abi_long arg8);
>  extern __thread CPUState *thread_cpu;
> -void cpu_loop(CPUArchState *env);
> +void QEMU_NORETURN cpu_loop(CPUArchState *env);
>  const char *target_strerror(int err);
>  int get_osversion(void);
>  void init_qemu_uname_release(void);
> --
> 2.31.1
>
>
Philippe Mathieu-Daudé Nov. 8, 2021, 7:37 a.m. UTC | #2
On 11/7/21 01:39, Warner Losh wrote:
> 
> 
> On Sat, Nov 6, 2021, 5:39 AM Philippe Mathieu-Daudé <f4bug@amsat.org
> <mailto:f4bug@amsat.org>> wrote:
> 
>     cpu_loop() never exits, so mark it with QEMU_NORETURN.
> 
>     Reviewed-by: Richard Henderson <richard.henderson@linaro.org
>     <mailto:richard.henderson@linaro.org>>
>     Reviewed-By: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
>     Reviewed-by: Bin Meng <bmeng.cn@gmail.com <mailto:bmeng.cn@gmail.com>>
>     Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org
>     <mailto:f4bug@amsat.org>>
>     ---
>     v2:
>     - rebased
>     - restricted to linux-user
> 
>     Supersedes: <20210905000429.1097336-1-f4bug@amsat.org
>     <mailto:20210905000429.1097336-1-f4bug@amsat.org>>
> 
> 
> Reviewed-by: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
> 
> bsd-user likely needs similar treatment, no?

IIUC this thread, not yet (I didn't want to get into your refactor):
https://lore.kernel.org/qemu-devel/CAFEAcA-f=n6XHp5Cj7=tH8NWO1GLA50i34=5GyaHrZELyr0bjw@mail.gmail.com/
Warner Losh Nov. 8, 2021, 4:25 p.m. UTC | #3
On Mon, Nov 8, 2021 at 12:37 AM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:

> On 11/7/21 01:39, Warner Losh wrote:
> >
> >
> > On Sat, Nov 6, 2021, 5:39 AM Philippe Mathieu-Daudé <f4bug@amsat.org
> > <mailto:f4bug@amsat.org>> wrote:
> >
> >     cpu_loop() never exits, so mark it with QEMU_NORETURN.
> >
> >     Reviewed-by: Richard Henderson <richard.henderson@linaro.org
> >     <mailto:richard.henderson@linaro.org>>
> >     Reviewed-By: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
> >     Reviewed-by: Bin Meng <bmeng.cn@gmail.com <mailto:bmeng.cn@gmail.com
> >>
> >     Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org
> >     <mailto:f4bug@amsat.org>>
> >     ---
> >     v2:
> >     - rebased
> >     - restricted to linux-user
> >
> >     Supersedes: <20210905000429.1097336-1-f4bug@amsat.org
> >     <mailto:20210905000429.1097336-1-f4bug@amsat.org>>
> >
> >
> > Reviewed-by: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
> >
> > bsd-user likely needs similar treatment, no?
>
> IIUC this thread, not yet (I didn't want to get into your refactor):
>
> https://lore.kernel.org/qemu-devel/CAFEAcA-f=n6XHp5Cj7=tH8NWO1GLA50i34=5GyaHrZELyr0bjw@mail.gmail.com/


I'll add it to my TODO items. I hope to get a small collection of those in
this month before the release after I land the arm bits.

Warner
Philippe Mathieu-Daudé Dec. 15, 2021, 10:55 a.m. UTC | #4
Ping? (patch reviewed)

On 11/6/21 12:39, Philippe Mathieu-Daudé wrote:
> cpu_loop() never exits, so mark it with QEMU_NORETURN.
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-By: Warner Losh <imp@bsdimp.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> - rebased
> - restricted to linux-user
> 
> Supersedes: <20210905000429.1097336-1-f4bug@amsat.org>
> ---
>  linux-user/user-internals.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h
> index 661612a088b..c7ad00268af 100644
> --- a/linux-user/user-internals.h
> +++ b/linux-user/user-internals.h
> @@ -65,7 +65,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
>                      abi_long arg5, abi_long arg6, abi_long arg7,
>                      abi_long arg8);
>  extern __thread CPUState *thread_cpu;
> -void cpu_loop(CPUArchState *env);
> +void QEMU_NORETURN cpu_loop(CPUArchState *env);
>  const char *target_strerror(int err);
>  int get_osversion(void);
>  void init_qemu_uname_release(void);
>
Laurent Vivier Dec. 19, 2021, 4:07 p.m. UTC | #5
Le 15/12/2021 à 11:55, Philippe Mathieu-Daudé a écrit :
> Ping? (patch reviewed)
> 
> On 11/6/21 12:39, Philippe Mathieu-Daudé wrote:
>> cpu_loop() never exits, so mark it with QEMU_NORETURN.
>>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Reviewed-By: Warner Losh <imp@bsdimp.com>
>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> v2:
>> - rebased
>> - restricted to linux-user
>>
>> Supersedes: <20210905000429.1097336-1-f4bug@amsat.org>
>> ---
>>   linux-user/user-internals.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h
>> index 661612a088b..c7ad00268af 100644
>> --- a/linux-user/user-internals.h
>> +++ b/linux-user/user-internals.h
>> @@ -65,7 +65,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
>>                       abi_long arg5, abi_long arg6, abi_long arg7,
>>                       abi_long arg8);
>>   extern __thread CPUState *thread_cpu;
>> -void cpu_loop(CPUArchState *env);
>> +void QEMU_NORETURN cpu_loop(CPUArchState *env);
>>   const char *target_strerror(int err);
>>   int get_osversion(void);
>>   void init_qemu_uname_release(void);
>>
> 

Applied to my linux-user-for-7.0 branch.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h
index 661612a088b..c7ad00268af 100644
--- a/linux-user/user-internals.h
+++ b/linux-user/user-internals.h
@@ -65,7 +65,7 @@  abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
                     abi_long arg5, abi_long arg6, abi_long arg7,
                     abi_long arg8);
 extern __thread CPUState *thread_cpu;
-void cpu_loop(CPUArchState *env);
+void QEMU_NORETURN cpu_loop(CPUArchState *env);
 const char *target_strerror(int err);
 int get_osversion(void);
 void init_qemu_uname_release(void);