[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/7] linux-user/hppa: Fix setup_sigcontext()
From: |
Helge Deller |
Subject: |
[PATCH 7/7] linux-user/hppa: Fix setup_sigcontext() |
Date: |
Sat, 24 Sep 2022 13:45:01 +0200 |
We don't emulate a preemptive kernel on this level, and the hppa architecture
doesn't allow context switches on the gateway page. So we always have to return
to sc_iaoq[] and not to gr[31].
This fixes the remaining random segfaults which still occured.
Signed-off-by: Helge Deller <deller@gmx.de>
---
linux-user/hppa/signal.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/linux-user/hppa/signal.c b/linux-user/hppa/signal.c
index 396e310dc9..f253a15864 100644
--- a/linux-user/hppa/signal.c
+++ b/linux-user/hppa/signal.c
@@ -49,23 +49,13 @@ struct target_rt_sigframe {
static void setup_sigcontext(struct target_sigcontext *sc, CPUArchState *env)
{
- int flags = 0;
int i;
- /* ??? if on_sig_stack, flags |= 1 (PARISC_SC_FLAG_ONSTACK). */
-
- if (env->iaoq_f < TARGET_PAGE_SIZE) {
- /* In the gateway page, executing a syscall. */
- flags |= 2; /* PARISC_SC_FLAG_IN_SYSCALL */
- __put_user(env->gr[31], &sc->sc_iaoq[0]);
- __put_user(env->gr[31] + 4, &sc->sc_iaoq[1]);
- } else {
- __put_user(env->iaoq_f, &sc->sc_iaoq[0]);
- __put_user(env->iaoq_b, &sc->sc_iaoq[1]);
- }
+ __put_user(env->iaoq_f, &sc->sc_iaoq[0]);
+ __put_user(env->iaoq_b, &sc->sc_iaoq[1]);
__put_user(0, &sc->sc_iasq[0]);
__put_user(0, &sc->sc_iasq[1]);
- __put_user(flags, &sc->sc_flags);
+ __put_user(0, &sc->sc_flags);
__put_user(cpu_hppa_get_psw(env), &sc->sc_gr[0]);
for (i = 1; i < 32; ++i) {
--
2.37.3
- [PATCH 0/7] linux-user fixes for hppa target - part 2, Helge Deller, 2022/09/24
- [PATCH 2/7] linux-user: Add proper strace format strings for getdents()/getdents64(), Helge Deller, 2022/09/24
- [PATCH 4/7] linux-user/hppa: Drop stack guard page on hppa target, Helge Deller, 2022/09/24
- [PATCH 5/7] linux-user/hppa: Increase guest stack size to 80MB for hppa target, Helge Deller, 2022/09/24
- [PATCH 7/7] linux-user/hppa: Fix setup_sigcontext(),
Helge Deller <=
- [PATCH 1/7] linux-user: Fix TARGET_PROT_SEM for XTENSA, Helge Deller, 2022/09/24
- [PATCH 6/7] linux-user/hppa: Allow PROT_GROWSUP and PROT_GROWSDOWN in mprotect(), Helge Deller, 2022/09/24
- [PATCH 3/7] linux-user/hppa: Add signal trampoline for hppa target, Helge Deller, 2022/09/24
- Re: [PATCH 0/7] linux-user fixes for hppa target - part 2, Laurent Vivier, 2022/09/27