[Qemu-devel] [PATCH] target/ppc: fix signal delivery for ppc64abi32

Alex Bennée posted 1 patch 4 years, 7 months ago
Test docker-clang@ubuntu passed
Test FreeBSD passed
Test checkpatch passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190911093951.6244-1-alex.bennee@linaro.org
linux-user/ppc/signal.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[Qemu-devel] [PATCH] target/ppc: fix signal delivery for ppc64abi32
Posted by Alex Bennée 4 years, 7 months ago
We were incorrectly setting NIP resulting in a segfault. This fixes
linux-test for this ABI.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 linux-user/ppc/signal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c
index 619a56950df..5b82af6cb62 100644
--- a/linux-user/ppc/signal.c
+++ b/linux-user/ppc/signal.c
@@ -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 =
-- 
2.20.1


Re: [Qemu-devel] [PATCH] target/ppc: fix signal delivery for ppc64abi32
Posted by Richard Henderson 4 years, 7 months ago
On 9/11/19 5:39 AM, Alex Bennée wrote:
> 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.

?

> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  linux-user/ppc/signal.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Anyway,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: fix signal delivery for ppc64abi32
Posted by David Gibson 4 years, 7 months ago
On Wed, Sep 11, 2019 at 10:33:45AM -0400, Richard Henderson wrote:
> On 9/11/19 5:39 AM, Alex Bennée wrote:
> > 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.

> 
> ?
> 
> > 
> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > ---
> >  linux-user/ppc/signal.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Anyway,
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> 

-- 
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
Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: fix signal delivery for ppc64abi32
Posted by Alex Bennée 4 years, 7 months ago
David Gibson <david@gibson.dropbear.id.au> writes:

> On Wed, Sep 11, 2019 at 10:33:45AM -0400, Richard Henderson wrote:
>> On 9/11/19 5:39 AM, Alex Bennée wrote:
>> > 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.

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

>
>>
>> ?
>>
>> >
>> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> > ---
>> >  linux-user/ppc/signal.c | 4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> Anyway,
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>


--
Alex Bennée

Re: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: fix signal delivery for ppc64abi32
Posted by David Gibson 4 years, 7 months ago
On Mon, Sep 16, 2019 at 08:22:42AM +0100, Alex Bennée wrote:
> 
> David Gibson <david@gibson.dropbear.id.au> writes:
> 
> > On Wed, Sep 11, 2019 at 10:33:45AM -0400, Richard Henderson wrote:
> >> On 9/11/19 5:39 AM, Alex Bennée wrote:
> >> > 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.
> 
> 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.


> 
> >
> >>
> >> ?
> >>
> >> >
> >> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> >> > ---
> >> >  linux-user/ppc/signal.c | 4 +++-
> >> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >> Anyway,
> >> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> >>
> 
> 

-- 
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