Skip to contentSkip to conversation

linux-user: Mark cpu_loop() with noreturn attribute

PATCH Applied Philippe Mathieu-Daudé 3 participants 6 messages Nov 6, 2021 – Dec 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 linux-user: Mark cpu_loop() with noreturn attribute

cpu_loop() never exits, so mark it with QEMU_NORETURN.

---
v2:
- rebased
- restricted to linux-user

Supersedes: <[email protected]>

---
 linux-user/user-internals.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/user-internals.h +1 -1
index 661612a088b..c7ad00268af 100644
@@ -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);
Signature · 1 line
2.31.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Philippe Mathieu-Daudé

cpu_loop() never exits, so mark it with QEMU_NORETURN.

Quoted 7 lines

---
v2:
- rebased
- restricted to linux-user

Supersedes: <[email protected]>

bsd-user likely needs similar treatment, no?

---

Quoted 21 lines
 linux-user/user-internals.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/user-internals.h +1 -1
index 661612a088b..c7ad00268af 100644
@@ -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

#2 lore raw
Quoted 18 lines · Warner Losh

On Sat, Nov 6, 2021, 5:39 AM Philippe Mathieu-Daudé <[email protected] <mailto:[email protected]>> wrote:

cpu_loop() never exits, so mark it with QEMU_NORETURN.

<mailto:[email protected]>>

Reviewed-by Warner Losh <[email protected] <mailto:[email protected]>>
Reviewed-by Bin Meng <[email protected] <mailto:[email protected]>>

<mailto:[email protected]>>
---
v2:
- rebased
- restricted to linux-user

Quoted 7 lines

Supersedes: <[email protected] <mailto:[email protected]>>

Reviewed-by Warner Losh <[email protected] <mailto:[email protected]>>

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/

#3 lore raw
Quoted 24 lines · Philippe Mathieu-Daudé
Quoted 23 lines · Warner Losh

On Sat, Nov 6, 2021, 5:39 AM Philippe Mathieu-Daudé <[email protected] <mailto:[email protected]>> wrote:

cpu_loop() never exits, so mark it with QEMU_NORETURN.

<mailto:[email protected]>>

Quoted 1 line
    Signed-off-by: Philippe Mathieu-Daudé <[email protected]
    <mailto:[email protected]>>
    ---
    v2:
    - rebased
    - restricted to linux-user

    Supersedes: <[email protected]
    <mailto:[email protected]>>
Quoted 7 lines
Quoted 3 lines
Reviewed-by Warner Losh <[email protected] <mailto:[email protected]>>

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

#4 lore raw
In reply to Philippe Mathieu-Daudé

Ping? (patch reviewed)

Quoted 30 lines · Philippe Mathieu-Daudé

cpu_loop() never exits, so mark it with QEMU_NORETURN.

---
v2:
- rebased
- restricted to linux-user

Supersedes: <[email protected]>

---
 linux-user/user-internals.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/user-internals.h +1 -1
index 661612a088b..c7ad00268af 100644
@@ -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);
#5 lore raw

Le 15/12/2021 à 11:55, Philippe Mathieu-Daudé a écrit :

Quoted 19 lines

Ping? (patch reviewed)

Quoted 16 lines · Philippe Mathieu-Daudé

cpu_loop() never exits, so mark it with QEMU_NORETURN.

---
v2:
- rebased
- restricted to linux-user

Supersedes: <[email protected]>

---
  linux-user/user-internals.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
Quoted 6 lines
linux-user/user-internals.h +0 -0
index 661612a088b..c7ad00268af 100644

linux-user/user-internals.h abi_long do_syscall(void *cpu_env, int num, abi_long arg1, · line 71

Quoted 8 lines
linux-user/user-internals.h +1 -1
@@ -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