All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf] bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
@ 2018-12-06  9:27 ` Sandipan Das
  0 siblings, 0 replies; 7+ messages in thread
From: Sandipan Das @ 2018-12-06  9:27 UTC (permalink / raw)
  To: daniel, ast; +Cc: netdev, linuxppc-dev, mpe, naveen.n.rao

Now that there are different variants of pt_regs for userspace and
kernel, the uapi for the BPF_PROG_TYPE_PERF_EVENT program type must
be changed by exporting the user_pt_regs structure instead of the
pt_regs structure that is in-kernel only.

Fixes: 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
---
 arch/powerpc/include/asm/perf_event.h          | 2 ++
 arch/powerpc/include/uapi/asm/Kbuild           | 1 -
 arch/powerpc/include/uapi/asm/bpf_perf_event.h | 9 +++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 arch/powerpc/include/uapi/asm/bpf_perf_event.h

diff --git a/arch/powerpc/include/asm/perf_event.h b/arch/powerpc/include/asm/perf_event.h
index 8bf1b6351716..16a49819da9a 100644
--- a/arch/powerpc/include/asm/perf_event.h
+++ b/arch/powerpc/include/asm/perf_event.h
@@ -26,6 +26,8 @@
 #include <asm/ptrace.h>
 #include <asm/reg.h>
 
+#define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs
+
 /*
  * Overload regs->result to specify whether we should use the MSR (result
  * is zero) or the SIAR (result is non zero).
diff --git a/arch/powerpc/include/uapi/asm/Kbuild b/arch/powerpc/include/uapi/asm/Kbuild
index a658091a19f9..3712152206f3 100644
--- a/arch/powerpc/include/uapi/asm/Kbuild
+++ b/arch/powerpc/include/uapi/asm/Kbuild
@@ -1,7 +1,6 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
-generic-y += bpf_perf_event.h
 generic-y += param.h
 generic-y += poll.h
 generic-y += resource.h
diff --git a/arch/powerpc/include/uapi/asm/bpf_perf_event.h b/arch/powerpc/include/uapi/asm/bpf_perf_event.h
new file mode 100644
index 000000000000..b551b741653d
--- /dev/null
+++ b/arch/powerpc/include/uapi/asm/bpf_perf_event.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _UAPI__ASM_BPF_PERF_EVENT_H__
+#define _UAPI__ASM_BPF_PERF_EVENT_H__
+
+#include <asm/ptrace.h>
+
+typedef struct user_pt_regs bpf_user_pt_regs_t;
+
+#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH bpf] bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
@ 2018-12-06  9:27 ` Sandipan Das
  0 siblings, 0 replies; 7+ messages in thread
From: Sandipan Das @ 2018-12-06  9:27 UTC (permalink / raw)
  To: daniel, ast; +Cc: naveen.n.rao, netdev, linuxppc-dev

Now that there are different variants of pt_regs for userspace and
kernel, the uapi for the BPF_PROG_TYPE_PERF_EVENT program type must
be changed by exporting the user_pt_regs structure instead of the
pt_regs structure that is in-kernel only.

Fixes: 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
---
 arch/powerpc/include/asm/perf_event.h          | 2 ++
 arch/powerpc/include/uapi/asm/Kbuild           | 1 -
 arch/powerpc/include/uapi/asm/bpf_perf_event.h | 9 +++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 arch/powerpc/include/uapi/asm/bpf_perf_event.h

diff --git a/arch/powerpc/include/asm/perf_event.h b/arch/powerpc/include/asm/perf_event.h
index 8bf1b6351716..16a49819da9a 100644
--- a/arch/powerpc/include/asm/perf_event.h
+++ b/arch/powerpc/include/asm/perf_event.h
@@ -26,6 +26,8 @@
 #include <asm/ptrace.h>
 #include <asm/reg.h>
 
+#define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs
+
 /*
  * Overload regs->result to specify whether we should use the MSR (result
  * is zero) or the SIAR (result is non zero).
diff --git a/arch/powerpc/include/uapi/asm/Kbuild b/arch/powerpc/include/uapi/asm/Kbuild
index a658091a19f9..3712152206f3 100644
--- a/arch/powerpc/include/uapi/asm/Kbuild
+++ b/arch/powerpc/include/uapi/asm/Kbuild
@@ -1,7 +1,6 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
-generic-y += bpf_perf_event.h
 generic-y += param.h
 generic-y += poll.h
 generic-y += resource.h
diff --git a/arch/powerpc/include/uapi/asm/bpf_perf_event.h b/arch/powerpc/include/uapi/asm/bpf_perf_event.h
new file mode 100644
index 000000000000..b551b741653d
--- /dev/null
+++ b/arch/powerpc/include/uapi/asm/bpf_perf_event.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _UAPI__ASM_BPF_PERF_EVENT_H__
+#define _UAPI__ASM_BPF_PERF_EVENT_H__
+
+#include <asm/ptrace.h>
+
+typedef struct user_pt_regs bpf_user_pt_regs_t;
+
+#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH bpf] bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
  2018-12-06  9:27 ` Sandipan Das
@ 2018-12-09 22:34   ` Alexei Starovoitov
  -1 siblings, 0 replies; 7+ messages in thread
From: Alexei Starovoitov @ 2018-12-09 22:34 UTC (permalink / raw)
  To: Sandipan Das; +Cc: daniel, ast, netdev, linuxppc-dev, mpe, naveen.n.rao

On Thu, Dec 06, 2018 at 02:57:01PM +0530, Sandipan Das wrote:
> Now that there are different variants of pt_regs for userspace and
> kernel, the uapi for the BPF_PROG_TYPE_PERF_EVENT program type must
> be changed by exporting the user_pt_regs structure instead of the
> pt_regs structure that is in-kernel only.
> 
> Fixes: 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")
> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>

Thanks! Applied to bpf tree.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH bpf] bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
@ 2018-12-09 22:34   ` Alexei Starovoitov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexei Starovoitov @ 2018-12-09 22:34 UTC (permalink / raw)
  To: Sandipan Das; +Cc: daniel, ast, linuxppc-dev, netdev, naveen.n.rao

On Thu, Dec 06, 2018 at 02:57:01PM +0530, Sandipan Das wrote:
> Now that there are different variants of pt_regs for userspace and
> kernel, the uapi for the BPF_PROG_TYPE_PERF_EVENT program type must
> be changed by exporting the user_pt_regs structure instead of the
> pt_regs structure that is in-kernel only.
> 
> Fixes: 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")
> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>

Thanks! Applied to bpf tree.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH bpf] bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
  2018-12-09 22:34   ` Alexei Starovoitov
@ 2018-12-10  2:29     ` Michael Ellerman
  -1 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2018-12-10  2:29 UTC (permalink / raw)
  To: Alexei Starovoitov, Sandipan Das
  Cc: daniel, ast, netdev, linuxppc-dev, naveen.n.rao

Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:

> On Thu, Dec 06, 2018 at 02:57:01PM +0530, Sandipan Das wrote:
>> Now that there are different variants of pt_regs for userspace and
>> kernel, the uapi for the BPF_PROG_TYPE_PERF_EVENT program type must
>> be changed by exporting the user_pt_regs structure instead of the
>> pt_regs structure that is in-kernel only.
>> 
>> Fixes: 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")
>> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
>
> Thanks! Applied to bpf tree.

I already have this in the fixes branch of the powerpc tree. I don't
mind if you take it also, git should probably handle the merge OK.

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH bpf] bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
@ 2018-12-10  2:29     ` Michael Ellerman
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2018-12-10  2:29 UTC (permalink / raw)
  To: Alexei Starovoitov, Sandipan Das
  Cc: naveen.n.rao, netdev, ast, daniel, linuxppc-dev

Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:

> On Thu, Dec 06, 2018 at 02:57:01PM +0530, Sandipan Das wrote:
>> Now that there are different variants of pt_regs for userspace and
>> kernel, the uapi for the BPF_PROG_TYPE_PERF_EVENT program type must
>> be changed by exporting the user_pt_regs structure instead of the
>> pt_regs structure that is in-kernel only.
>> 
>> Fixes: 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")
>> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
>
> Thanks! Applied to bpf tree.

I already have this in the fixes branch of the powerpc tree. I don't
mind if you take it also, git should probably handle the merge OK.

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bpf] bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
  2018-12-06  9:27 ` Sandipan Das
  (?)
  (?)
@ 2018-12-10  2:43 ` Michael Ellerman
  -1 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2018-12-10  2:43 UTC (permalink / raw)
  To: Sandipan Das, daniel, ast; +Cc: naveen.n.rao, netdev, linuxppc-dev

On Thu, 2018-12-06 at 09:27:01 UTC, Sandipan Das wrote:
> Now that there are different variants of pt_regs for userspace and
> kernel, the uapi for the BPF_PROG_TYPE_PERF_EVENT program type must
> be changed by exporting the user_pt_regs structure instead of the
> pt_regs structure that is in-kernel only.
> 
> Fixes: 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")
> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/a6460b03f945ee216dbf42a0d9ee78

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-12-10  2:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06  9:27 [PATCH bpf] bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT Sandipan Das
2018-12-06  9:27 ` Sandipan Das
2018-12-09 22:34 ` Alexei Starovoitov
2018-12-09 22:34   ` Alexei Starovoitov
2018-12-10  2:29   ` Michael Ellerman
2018-12-10  2:29     ` Michael Ellerman
2018-12-10  2:43 ` [bpf] " Michael Ellerman

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.