* [PATCH] ppc: Include asm/ptrace.h for pt_regs struct definition
@ 2022-03-14 17:02 Khem Raj
2022-03-14 17:05 ` Peter Maydell
0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2022-03-14 17:02 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Richard Henderson, Khem Raj, Philippe Mathieu-Daudé
Fixes
../qemu-6.2.0/linux-user/host/ppc64/../ppc/host-signal.h:16:32: error: incomplete definition of type 'struct pt_regs'
return uc->uc_mcontext.regs->nip;
~~~~~~~~~~~~~~~~~~~~^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/include/host/ppc/host-signal.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/linux-user/include/host/ppc/host-signal.h b/linux-user/include/host/ppc/host-signal.h
index b80384d135..43ee2eee3b 100644
--- a/linux-user/include/host/ppc/host-signal.h
+++ b/linux-user/include/host/ppc/host-signal.h
@@ -11,6 +11,10 @@
#ifndef PPC_HOST_SIGNAL_H
#define PPC_HOST_SIGNAL_H
+#if defined(__powerpc__)
+#include <asm/ptrace.h>
+#endif
+
/* The third argument to a SA_SIGINFO handler is ucontext_t. */
typedef ucontext_t host_sigcontext;
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ppc: Include asm/ptrace.h for pt_regs struct definition
2022-03-14 17:02 [PATCH] ppc: Include asm/ptrace.h for pt_regs struct definition Khem Raj
@ 2022-03-14 17:05 ` Peter Maydell
2022-03-14 17:22 ` Khem Raj
0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2022-03-14 17:05 UTC (permalink / raw)
To: Khem Raj; +Cc: Richard Henderson, qemu-devel, Philippe Mathieu-Daudé
On Mon, 14 Mar 2022 at 17:02, Khem Raj <raj.khem@gmail.com> wrote:
>
> Fixes
> ../qemu-6.2.0/linux-user/host/ppc64/../ppc/host-signal.h:16:32: error: incomplete definition of type 'struct pt_regs'
> return uc->uc_mcontext.regs->nip;
> ~~~~~~~~~~~~~~~~~~~~^
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> ---
> linux-user/include/host/ppc/host-signal.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/linux-user/include/host/ppc/host-signal.h b/linux-user/include/host/ppc/host-signal.h
> index b80384d135..43ee2eee3b 100644
> --- a/linux-user/include/host/ppc/host-signal.h
> +++ b/linux-user/include/host/ppc/host-signal.h
> @@ -11,6 +11,10 @@
> #ifndef PPC_HOST_SIGNAL_H
> #define PPC_HOST_SIGNAL_H
>
> +#if defined(__powerpc__)
Why is this #if defined() needed ?
> +#include <asm/ptrace.h>
> +#endif
What host distro are you building with? We do test ppc64be at least
in our CI, and that builds OK.
thanks
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ppc: Include asm/ptrace.h for pt_regs struct definition
2022-03-14 17:05 ` Peter Maydell
@ 2022-03-14 17:22 ` Khem Raj
2022-03-14 18:06 ` Peter Maydell
0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2022-03-14 17:22 UTC (permalink / raw)
To: Peter Maydell
Cc: Richard Henderson, QEMU Developers, Philippe Mathieu-Daudé
On Mon, Mar 14, 2022 at 10:05 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Mon, 14 Mar 2022 at 17:02, Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Fixes
> > ../qemu-6.2.0/linux-user/host/ppc64/../ppc/host-signal.h:16:32: error: incomplete definition of type 'struct pt_regs'
> > return uc->uc_mcontext.regs->nip;
> > ~~~~~~~~~~~~~~~~~~~~^
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > Cc: Peter Maydell <peter.maydell@linaro.org>
> > Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > Cc: Richard Henderson <richard.henderson@linaro.org>
> > ---
> > linux-user/include/host/ppc/host-signal.h | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/linux-user/include/host/ppc/host-signal.h b/linux-user/include/host/ppc/host-signal.h
> > index b80384d135..43ee2eee3b 100644
> > --- a/linux-user/include/host/ppc/host-signal.h
> > +++ b/linux-user/include/host/ppc/host-signal.h
> > @@ -11,6 +11,10 @@
> > #ifndef PPC_HOST_SIGNAL_H
> > #define PPC_HOST_SIGNAL_H
> >
> > +#if defined(__powerpc__)
>
> Why is this #if defined() needed ?
yeah the define is redundant. I will send a v2
>
> > +#include <asm/ptrace.h>
> > +#endif
>
> What host distro are you building with? We do test ppc64be at least
> in our CI, and that builds OK.
I have a custom distro building with Yocto which is using musl C
library instead of glibc.
may be adelie linux or alpine will exhibit same issue
>
> thanks
> -- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ppc: Include asm/ptrace.h for pt_regs struct definition
2022-03-14 17:22 ` Khem Raj
@ 2022-03-14 18:06 ` Peter Maydell
2022-03-14 18:52 ` Richard Henderson
0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2022-03-14 18:06 UTC (permalink / raw)
To: Khem Raj; +Cc: Richard Henderson, QEMU Developers, Philippe Mathieu-Daudé
On Mon, 14 Mar 2022 at 17:22, Khem Raj <raj.khem@gmail.com> wrote:
>
> On Mon, Mar 14, 2022 at 10:05 AM Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Mon, 14 Mar 2022 at 17:02, Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > > Fixes
> > > ../qemu-6.2.0/linux-user/host/ppc64/../ppc/host-signal.h:16:32: error: incomplete definition of type 'struct pt_regs'
> > > return uc->uc_mcontext.regs->nip;
> > > ~~~~~~~~~~~~~~~~~~~~^
> > >
> > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > Cc: Peter Maydell <peter.maydell@linaro.org>
> > > Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > > Cc: Richard Henderson <richard.henderson@linaro.org>
> > > ---
> > > linux-user/include/host/ppc/host-signal.h | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/linux-user/include/host/ppc/host-signal.h b/linux-user/include/host/ppc/host-signal.h
> > > index b80384d135..43ee2eee3b 100644
> > > --- a/linux-user/include/host/ppc/host-signal.h
> > > +++ b/linux-user/include/host/ppc/host-signal.h
> > > @@ -11,6 +11,10 @@
> > > #ifndef PPC_HOST_SIGNAL_H
> > > #define PPC_HOST_SIGNAL_H
> > >
> > > +#if defined(__powerpc__)
> >
> > Why is this #if defined() needed ?
>
> yeah the define is redundant. I will send a v2
>
> >
> > > +#include <asm/ptrace.h>
> > > +#endif
> >
> > What host distro are you building with? We do test ppc64be at least
> > in our CI, and that builds OK.
>
> I have a custom distro building with Yocto which is using musl C
> library instead of glibc.
Ah, musl. I found this gcc mailing list post from one of the musl
upstream developers:
https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg281012.html
where he suggests a different approach involving uc_regs->gregs[32]
for ppc32 and uc_mcontext.gp_regs[32] for ppc64.
Richard: any opinion on that idea ?
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ppc: Include asm/ptrace.h for pt_regs struct definition
2022-03-14 18:06 ` Peter Maydell
@ 2022-03-14 18:52 ` Richard Henderson
0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2022-03-14 18:52 UTC (permalink / raw)
To: Peter Maydell, Khem Raj; +Cc: QEMU Developers, Philippe Mathieu-Daudé
On 3/14/22 11:06, Peter Maydell wrote:
>> I have a custom distro building with Yocto which is using musl C
>> library instead of glibc.
>
> Ah, musl. I found this gcc mailing list post from one of the musl
> upstream developers:
> https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg281012.html
>
> where he suggests a different approach involving uc_regs->gregs[32]
> for ppc32 and uc_mcontext.gp_regs[32] for ppc64.
>
> Richard: any opinion on that idea ?
Reasonable. I would also remove the indirection between
linux-user/include/host/ppc64/host-signal.h to linux-user/include/host/ppc/host-signal.h.
We don't support ppc32 anymore -- there are afaik no current distros supporting ppc32 with
which we could even test.
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-14 18:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 17:02 [PATCH] ppc: Include asm/ptrace.h for pt_regs struct definition Khem Raj
2022-03-14 17:05 ` Peter Maydell
2022-03-14 17:22 ` Khem Raj
2022-03-14 18:06 ` Peter Maydell
2022-03-14 18:52 ` Richard Henderson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.