Skip to contentSkip to conversation

linux-user: Two minor patches

PATCH Applied Warner Losh 4 participants 7 messages Jan 16, 2022 – Jan 18, 2022

lore
Share & tools
lore
#0 lore raw

cover linux-user: Two minor patches

There's two, almost trivial patches that arose out of the review of bsd-user. There's a chance that one or both of these were submitted already...

Warner Losh (2):
linx-user: Remove MAX_SIGQUEUE_SIZE
linxu-user: Change return type of queue_signal to void

 linux-user/qemu.h          | 2 --
 linux-user/signal-common.h | 4 ++--
 linux-user/signal.c        | 5 ++---
 3 files changed, 4 insertions(+), 7 deletions(-)
Signature · 1 line
2.33.1
#1 lore raw

PATCH 1/2 linx-user: Remove MAX_SIGQUEUE_SIZE

It's been unused for 7 years since 907f5fddaa67 when linux-user stopped queueing any signals.

---
 linux-user/qemu.h | 2 --
 1 file changed, 2 deletions(-)
linux-user/qemu.h +0 -2
index 5c713fa8ab2..7910ce59cc8 100644
@@ -89,8 +89,6 @@ struct vm86_saved_state {
 #include "nwfpe/fpa11.h"
 #endif
 
-#define MAX_SIGQUEUE_SIZE 1024
-
 struct emulated_sigtable {
     int pending; /* true if signal is pending */
     target_siginfo_t info;
Signature · 1 line
2.33.1
#4 lore raw

Re: [PATCH 1/2] linx-user: Remove MAX_SIGQUEUE_SIZE

In reply to Warner Losh

Le 16/01/2022 à 21:44, Warner Losh a écrit :

Quoted 13 lines

It's been unused for 7 years since 907f5fddaa67 when linux-user stopped queueing any signals.

---
  linux-user/qemu.h | 2 --
  1 file changed, 2 deletions(-)
linux-user/qemu.h +0 -0
index 5c713fa8ab2..7910ce59cc8 100644

linux-user/qemu.h struct vm86_saved_state { · line 94

Quoted 8 lines
linux-user/qemu.h +0 -2
@@ -89,8 +89,6 @@ struct vm86_saved_state {
  #include "nwfpe/fpa11.h"
  #endif
 
-#define MAX_SIGQUEUE_SIZE 1024
-
  struct emulated_sigtable {
      int pending; /* true if signal is pending */
      target_siginfo_t info;

Applied to my trivial-patches branch.
(typo fixed)

Thanks,
Laurent

#5 lore raw

PATCH 2/2 linxu-user: Change return type of queue_signal to void

In reply to Warner Losh

queue_signal always returns 1, and nobody checks it. This is better expressed as a void function return type.

---
 linux-user/signal-common.h | 4 ++--
 linux-user/signal.c        | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)
linux-user/signal-common.h +2 -2
index 42aa479080b..2113165a758 100644
@@ -59,8 +59,8 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,
 
 void process_pending_signals(CPUArchState *cpu_env);
 void signal_init(void);
-int queue_signal(CPUArchState *env, int sig, int si_type,
-                 target_siginfo_t *info);
+void queue_signal(CPUArchState *env, int sig, int si_type,
+                  target_siginfo_t *info);
 void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info);
 void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo);
 int target_to_host_signal(int sig);
linux-user/signal.c +2 -3
index f813b4f18e4..eddc95e87df 100644
@@ -780,8 +780,8 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig)
 
 /* queue a signal so that it will be send to the virtual CPU as soon
    as possible */
-int queue_signal(CPUArchState *env, int sig, int si_type,
-                 target_siginfo_t *info)
+void queue_signal(CPUArchState *env, int sig, int si_type,
+                  target_siginfo_t *info)
 {
     CPUState *cpu = env_cpu(env);
     TaskState *ts = cpu->opaque;
@@ -794,7 +794,6 @@ int queue_signal(CPUArchState *env, int sig, int si_type,
     ts->sync_signal.pending = sig;
     /* signal that a new signal is pending */
     qatomic_set(&ts->signal_pending, 1);
-    return 1; /* indicates that the signal was queued */
 }
 
 
Signature · 1 line
2.33.1
#6 lore raw

Re: [PATCH 2/2] linxu-user: Change return type of queue_signal to void

Quoted 9 lines · Warner Losh

queue_signal always returns 1, and nobody checks it. This is better expressed as a void function return type.

---
 linux-user/signal-common.h | 4 ++--
 linux-user/signal.c        | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-

This one's a dup of patch 3 from my series from Friday:
https://patchew.org/QEMU/[email protected]/[email protected]/

-- PMM