info->brk was erroneously set to the end of highest addressed
writable segment which could result it in overlapping the executable.
As per load_elf_binary in fs/binfmt_elf.c in Linux, it should be
set to end of highest addressed segment.
Signed-off-by: Timothy E Baldwin
---
linux-u
struct target_ucontext_v2 is not at the begining of the signal frame,
therefore do_sigaltstack was being passed bogus arguments.
As the offset depends on the type of signal frame fixed by passing in the
beginning of the context from do_sigreturn_v2 and do_rt_sigreturn_v2.
Suggested-by: Peter Mayd
struct target_ucontext_v2 is not at the begining of the signal frame,
therefore do_sigaltstack was being passed bogus arguments.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/signal.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
Changes since v1: Fix style.
diff --git a/li
struct target_ucontext_v2 is not at the begining of the signal frame,
therefore do_sigaltstack was being passed bogus arguments.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/signal.c b/linux-user/sign
Some of the signal handling was a mess with a mixture of tabs and 8 space
indents.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/signal.c | 1691 ++-
1 file changed, 867 insertions(+), 824 deletions(-)
diff --git a/linux-user/signal.c b/lin
Now with system call restarting support by all targets remove
uneeded conditionals.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/aarch64/syscall.h| 2 --
linux-user/alpha/syscall.h | 2 --
linux-user/arm/syscall.h| 2 --
linux-user/cris/syscall.h | 2 --
linux-user
Signed-off-by: Timothy Edward Baldwin
---
linux-user/m68k/syscall.h | 2 ++
linux-user/main.c | 24 +++-
linux-user/signal.c | 20
3 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/linux-user/m68k/syscall.h b/linux-user/m68k/s
If a synchronous signal and an asynchronous signal arrive near simultaneously,
and the signal number of the asynchronous signal is lower than that of the
synchronous signal the the handler for the asynchronous would be called first,
and then the handler for the synchronous signal would be called wi
Without this SIGTERM could fail to terminate the process, as the
signal lost in QEMU's queue.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1ce381e..4839154 10
Signed-off-by: Timothy Edward Baldwin
---
Signal handling NOT TESTED
linux-user/alpha/syscall.h | 2 ++
linux-user/main.c | 7 +--
linux-user/signal.c| 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/linux-user/alpha/syscall.h b/linux-user/alpha/sysca
As host signals are now blocked whenever guest signals are blocked, the
queue of realtime signals in now in Linux. The Qemu queue is now
redundant and removed.
Signed-off-by: Timothy Edward Baldwin
Conflicts:
linux-user/qemu.h
---
linux-user/main.c | 7 --
linux-user/qemu.h | 1
If a signal is delivered immediately before a blocking system calls the
handler will only be called after the system call returns, which may be a
long time later or never.
This is fixed by using a function (safe_syscall_base) that checks if a guest
signal is pending prior to making a system call,
Signed-off-by: Timothy Edward Baldwin
---
WARNING - NOT TESTED
linux-user/main.c | 7 ++-
linux-user/unicore32/syscall.h | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index d86751a..9ca1c99 100644
--- a/linux-user/ma
Signed-off-by: Timothy Edward Baldwin
---
Works without signals, but my signal test case
crashes with or without my changes.
linux-user/main.c| 6 +-
linux-user/sh4/syscall.h | 2 ++
linux-user/signal.c | 16 ++--
3 files changed, 13 insertions(+), 11 deletions(-)
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index da6d140..f89b730 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6106,7 +6106,10 @@ abi_long do
Without this a signal could vanish on thread exit.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4839154..efe61e3 100644
--- a/linux-user/syscall.c
+++ b
Signed-off-by: Timothy Edward Baldwin
---
linux-user/aarch64/syscall.h | 2 ++
linux-user/arm/syscall.h | 2 ++
linux-user/main.c| 47 +++-
linux-user/signal.c | 10 +-
4 files changed, 38 insertions(+), 23 deletions(-)
d
If multiple host signals are recieved in quick succession they would
be queued in TaskState then delivered to the guest in spite of
signals being blocked. Fixed by keeping host signals blocked until
process_pending_signals() runs, this needs the guest signal state
to be maintained by Qemu.
Blockin
Signed-off-by: Timothy Edward Baldwin
---
Works without signals, but my signal test case
crashes with or without my changes.
linux-user/main.c | 14 +-
linux-user/microblaze/syscall.h | 2 ++
linux-user/signal.c | 2 +-
3 files changed, 12 insertions(+),
Without this a signal could vanish if thread sends SIGKILL to itself.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index efe61e3..da6d140 100644
--- a/linux-user
Signed-off-by: Timothy Edward Baldwin
---
gdbstub.c | 13 -
include/exec/gdbstub.h | 1 -
2 files changed, 14 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index ffe7e6e..fd319af 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1472,19 +1472,6 @@ void gdb_exit(CPUArchState
Signed-off-by: Timothy Edward Baldwin
---
WARNING - NOT TESTED
linux-user/cris/syscall.h | 2 ++
linux-user/main.c | 6 +-
linux-user/signal.c | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/linux-user/cris/syscall.h b/linux-user/cris/syscall.h
index 295
Restart read() and write() if signals occur before, or during with SA_RESTART
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b9ad7b6..c213588 100644
--- a
Both queue_signal() and process_pending_signals() did check for default
actions of signals, this is redundant and also causes fatal and stopping
signals to incorrectly cause guest system calls to be interrupted.
The code in queue_signal() is removed.
Signed-off-by: Timothy Edward Baldwin
---
li
Signed-off-by: Timothy Edward Baldwin
---
WARNING - NOT TESTED
linux-user/main.c | 12 +---
linux-user/s390x/syscall.h | 2 ++
linux-user/signal.c| 4 ++--
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 0863
The return value of openat was being translated by get_errno() twice.
Fixed by removing calls of get_errno() in do_syscall() and keeping those
in do_openat().
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff -
Signed-off-by: Timothy Edward Baldwin
---
linux-user/main.c| 4
linux-user/ppc/syscall.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/linux-user/main.c b/linux-user/main.c
index 124e9cc..5e9e3a8 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1948,6 +1948,10 @@ v
If there is a signal pending during fork() the signal handler will
erroneously be called in both the parent and child, so handle any
pending signals first.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/linux-user/syscall.c
Signed-off-by: Timothy Edward Baldwin
---
linux-user/signal.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 15bd082..fc37f3b 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -629,7 +629,7 @@ out:
Signed-off-by: Timothy Edward Baldwin
---
linux-user/main.c| 3 +++
linux-user/signal.c | 2 +-
linux-user/sparc/syscall.h | 2 ++
linux-user/sparc64/syscall.h | 2 ++
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e68eddb..281fa2d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -698,6 +698,10 @@ safe_s
This allows SA_RESTART to be supported along with various case
where pending signals need to be handled before a system call.
New macro TARGET_ERESTARTSYS which is the error code used by Linux
to indicate that system call should be restarted.
TARGET_QEMU_ESIGRETURN moved into errno_defs.h and ren
Signed-off-by: Timothy Edward Baldwin
---
WARNING - NOT TESTED
linux-user/main.c | 22 ++
linux-user/openrisc/syscall.h | 2 ++
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 9ca1c99..b052e17 100644
--
Signed-off-by: Timothy Edward Baldwin
---
linux-user/i386/syscall.h | 2 ++
linux-user/main.c | 47 -
linux-user/signal.c | 15 +++
linux-user/syscall.c| 2 --
linux-user/x86_64/syscall.h | 2 ++
5 files change
If DEBUG_ERESTARTSYS is set restart all system calls once.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 04c91fb..80b8fa8 100644
--- a/linux-user/syscall.c
+++ b/lin
Restart open() and openat() if signals occur before,
or during with SA_RESTART.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 18 --
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index df9b2ca..e68edd
Signed-off-by: Timothy Edward Baldwin
---
linux-user/main.c | 4
linux-user/mips/syscall.h | 2 ++
linux-user/mips64/syscall.h | 2 ++
3 files changed, 8 insertions(+)
diff --git a/linux-user/main.c b/linux-user/main.c
index 9653155..124e9cc 100644
--- a/linux-user/main.c
+++ b/
Check array bounds in host_to_target_errno() and target_to_host_errno().
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 264debc..4e40dc6 100644
--- a/linux-us
ld be appreciated - this is the only change I intend to make
to unshared code to all targets.
Outstanding issues:
- The remaining blocking target system calls.
- Fatal default actions may be delayed in a broken blocking target
system call.
Timothy E Baldwin (34):
linux-user: Fix array bounds in
Whilst calls to do_fork() are wrapped in get_errno() this does not
translate return values.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f62c698..264debc 1
Implemented atomic_barrier system call using GCC/clang
builtin __sync_synchronize().
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index bca3424..72d107a 100644
--- a/
Implemented ARM __kernel_memory_barrier using GCC/clang
builtin __sync_synchronize().
Signed-off-by: Timothy Edward Baldwin
---
linux-user/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 2c9658e..f4b81b1 100644
--- a/linux-us
Whilst calls to do_fork() are wrapped in get_errno() this does not
translate return values.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f62c698..bca3424 100644
Misspelled system call name in macro was causing timerfd_create not
to be supported for the ARM target.
Signed-off-by: Timothy Edward Baldwin
---
linux-user/arm/syscall_nr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/arm/syscall_nr.h b/linux-user/arm/syscall_n
Misspelled system call name in macro was causing timerfd_create not to be
supported for the ARM target.
---
linux-user/arm/syscall_nr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/arm/syscall_nr.h b/linux-user/arm/syscall_nr.h
index 7d7be7c..53552be 100644
--- a
45 matches
Mail list logo