Skip to contentSkip to conversation

target/ppc: fix signal delivery for ppc64abi32

PATCH Applied Alex Bennée 3 participants 5 messages Sep 11, 2019 – Sep 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/ppc: fix signal delivery for ppc64abi32

We were incorrectly setting NIP resulting in a segfault. This fixes linux-test for this ABI.

---
 linux-user/ppc/signal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
linux-user/ppc/signal.c +3 -1
index 619a56950df..5b82af6cb62 100644
@@ -501,7 +501,9 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,
     int i, err = 0;
 #if defined(TARGET_PPC64)
     struct target_sigcontext *sc = 0;
+#if !defined(TARGET_ABI32)
     struct image_info *image = ((TaskState *)thread_cpu->opaque)->info;
+#endif
 #endif
 
     rt_sf_addr = get_sigframe(ka, env, sizeof(*rt_sf));
@@ -557,7 +559,7 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,
     env->gpr[5] = (target_ulong) h2g(&rt_sf->uc);
     env->gpr[6] = (target_ulong) h2g(rt_sf);
 
-#if defined(TARGET_PPC64)
+#if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
     if (get_ppc64_abi(image) < 2) {
         /* ELFv1 PPC64 function pointers are pointers to OPD entries. */
         struct target_func_ptr *handler =
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Alex Bennée

We were incorrectly setting NIP resulting in a segfault. This fixes linux-test for this ABI.

Perhaps better:
We were incorrectly using the 64-bit AIX ABI instead of the 32-bit SYSV ABI for setting NIP for the signal handler.

?

Quoted 5 lines
---
 linux-user/ppc/signal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Anyway,

Applied
#2 lore raw
Quoted 7 lines · Richard Henderson
Quoted 2 lines · Alex Bennée

We were incorrectly setting NIP resulting in a segfault. This fixes linux-test for this ABI.

Perhaps better:
We were incorrectly using the 64-bit AIX ABI instead of the 32-bit SYSV ABI for setting NIP for the signal handler.

Applied to ppc-for-4.2, with Richard's updated description.

For future reference, it's better to directly CC me on such patches. I only barely keep on top of the mailing lists, so if you just send it there it's likely to be some time before I pick it up, or even get lost entirely.

Quoted 12 lines

?

Quoted 5 lines
---
 linux-user/ppc/signal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Anyway,

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#3 lore raw
Quoted 9 lines · David Gibson
Quoted 7 lines · Richard Henderson
Quoted 2 lines · Alex Bennée

We were incorrectly setting NIP resulting in a segfault. This fixes linux-test for this ABI.

Perhaps better:
We were incorrectly using the 64-bit AIX ABI instead of the 32-bit SYSV ABI for setting NIP for the signal handler.

Quoted 6 lines

Applied to ppc-for-4.2, with Richard's updated description.

For future reference, it's better to directly CC me on such patches. I only barely keep on top of the mailing lists, so if you just send it there it's likely to be some time before I pick it up, or even get lost entirely.

Should you be added to linux-user/ppc/ in MAINTAINERS?

Quoted 5 lines
Quoted 5 lines

?

Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
---
 linux-user/ppc/signal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Anyway,

--
Alex Bennée

#4 lore raw
Quoted 12 lines · Alex Bennée
Quoted 9 lines · David Gibson
Quoted 7 lines · Richard Henderson
Quoted 2 lines · Alex Bennée

We were incorrectly setting NIP resulting in a segfault. This fixes linux-test for this ABI.

Perhaps better:
We were incorrectly using the 64-bit AIX ABI instead of the 32-bit SYSV ABI for setting NIP for the signal handler.

Quoted 8 lines
Quoted 6 lines

Applied to ppc-for-4.2, with Richard's updated description.

For future reference, it's better to directly CC me on such patches. I only barely keep on top of the mailing lists, so if you just send it there it's likely to be some time before I pick it up, or even get lost entirely.

Should you be added to linux-user/ppc/ in MAINTAINERS?

Hm, maybe. It's not like I know much about the stuff in there, but it's also not like anyone else is paying any attention to it.

Quoted 16 lines
Quoted 14 lines
Quoted 14 lines

?

Quoted 5 lines
---
 linux-user/ppc/signal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Anyway,

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson