From b6d684825226e4e4d0d9f7a4a92721df9730dc81 Mon Sep 17 00:00:00 2001 From: Thuy Tran Date: Wed, 31 Oct 2018 11:34:46 +0900 Subject: rcar-gen3: linux-renesas: WORKAROUND to fix build error with Linux v4.14 This commit backports a fix patch from Linux v4.15 to fix build error below: | ERROR: linux-libc-headers-4.14-r0 do_install: oe_multilib_header: Unable to find header asm/bpf_perf_event.h. Signed-off-by: Thuy Tran Signed-off-by: Takamitsu Honda --- ...orrect-broken-uapi-for-BPF_PROG_TYPE_PERF.patch | 61 ++++++++++++++++++++++ .../linux-libc-headers/linux-libc-headers_4.14.bb | 5 ++ ...orrect-broken-uapi-for-BPF_PROG_TYPE_PERF.patch | 61 ++++++++++++++++++++++ .../recipes-kernel/linux/linux-renesas_4.14.bb | 5 ++ 4 files changed, 132 insertions(+) create mode 100644 meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch create mode 100644 meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch diff --git a/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch b/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch new file mode 100644 index 0000000..9c38a32 --- /dev/null +++ b/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch @@ -0,0 +1,61 @@ +From a39cada70268aadff7153e4f782bcd90a5c69d07 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Mon, 4 Dec 2017 10:56:46 +0100 +Subject: [PATCH] arm64/bpf: correct broken uapi for BPF_PROG_TYPE_PERF_EVENT + program type + +Correct the broken uapi for the BPF_PROG_TYPE_PERF_EVENT program type +by exporting the user_pt_regs structure instead of the pt_regs structure +that is in-kernel only. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Thomas Richter +Acked-by: Alexei Starovoitov +Cc: Will Deacon +Cc: Mark Rutland +Cc: Arnaldo Carvalho de Melo +Signed-off-by: Daniel Borkmann +--- + arch/arm64/include/asm/perf_event.h | 2 ++ + arch/arm64/include/uapi/asm/bpf_perf_event.h | 9 +++++++++ + 2 files changed, 11 insertions(+) + create mode 100644 arch/arm64/include/uapi/asm/bpf_perf_event.h + +diff --git a/arch/arm64/include/asm/perf_event.h b/arch/arm64/include/asm/perf_event.h +index 8d5cbec..f9ccc36 100644 +--- a/arch/arm64/include/asm/perf_event.h ++++ b/arch/arm64/include/asm/perf_event.h +@@ -18,6 +18,7 @@ + #define __ASM_PERF_EVENT_H + + #include ++#include + + #define ARMV8_PMU_MAX_COUNTERS 32 + #define ARMV8_PMU_COUNTER_MASK (ARMV8_PMU_MAX_COUNTERS - 1) +@@ -79,6 +80,7 @@ struct pt_regs; + extern unsigned long perf_instruction_pointer(struct pt_regs *regs); + extern unsigned long perf_misc_flags(struct pt_regs *regs); + #define perf_misc_flags(regs) perf_misc_flags(regs) ++#define perf_arch_bpf_user_pt_regs(regs) ®s->user_regs + #endif + + #define perf_arch_fetch_caller_regs(regs, __ip) { \ +diff --git a/arch/arm64/include/uapi/asm/bpf_perf_event.h b/arch/arm64/include/uapi/asm/bpf_perf_event.h +new file mode 100644 +index 0000000..b551b74 +--- /dev/null ++++ b/arch/arm64/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 ++ ++typedef struct user_pt_regs bpf_user_pt_regs_t; ++ ++#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */ +-- +2.7.4 + diff --git a/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb b/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb index 67ec4b3..fdc8a2c 100644 --- a/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb +++ b/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb @@ -31,3 +31,8 @@ SRC_URI_append = " \ " S = "${WORKDIR}/git" + +# W/A Fix build issue with Linux v4.14 +SRC_URI_append = " \ + file://0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch \ +" diff --git a/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch new file mode 100644 index 0000000..9c38a32 --- /dev/null +++ b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch @@ -0,0 +1,61 @@ +From a39cada70268aadff7153e4f782bcd90a5c69d07 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Mon, 4 Dec 2017 10:56:46 +0100 +Subject: [PATCH] arm64/bpf: correct broken uapi for BPF_PROG_TYPE_PERF_EVENT + program type + +Correct the broken uapi for the BPF_PROG_TYPE_PERF_EVENT program type +by exporting the user_pt_regs structure instead of the pt_regs structure +that is in-kernel only. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Thomas Richter +Acked-by: Alexei Starovoitov +Cc: Will Deacon +Cc: Mark Rutland +Cc: Arnaldo Carvalho de Melo +Signed-off-by: Daniel Borkmann +--- + arch/arm64/include/asm/perf_event.h | 2 ++ + arch/arm64/include/uapi/asm/bpf_perf_event.h | 9 +++++++++ + 2 files changed, 11 insertions(+) + create mode 100644 arch/arm64/include/uapi/asm/bpf_perf_event.h + +diff --git a/arch/arm64/include/asm/perf_event.h b/arch/arm64/include/asm/perf_event.h +index 8d5cbec..f9ccc36 100644 +--- a/arch/arm64/include/asm/perf_event.h ++++ b/arch/arm64/include/asm/perf_event.h +@@ -18,6 +18,7 @@ + #define __ASM_PERF_EVENT_H + + #include ++#include + + #define ARMV8_PMU_MAX_COUNTERS 32 + #define ARMV8_PMU_COUNTER_MASK (ARMV8_PMU_MAX_COUNTERS - 1) +@@ -79,6 +80,7 @@ struct pt_regs; + extern unsigned long perf_instruction_pointer(struct pt_regs *regs); + extern unsigned long perf_misc_flags(struct pt_regs *regs); + #define perf_misc_flags(regs) perf_misc_flags(regs) ++#define perf_arch_bpf_user_pt_regs(regs) ®s->user_regs + #endif + + #define perf_arch_fetch_caller_regs(regs, __ip) { \ +diff --git a/arch/arm64/include/uapi/asm/bpf_perf_event.h b/arch/arm64/include/uapi/asm/bpf_perf_event.h +new file mode 100644 +index 0000000..b551b74 +--- /dev/null ++++ b/arch/arm64/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 ++ ++typedef struct user_pt_regs bpf_user_pt_regs_t; ++ ++#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */ +-- +2.7.4 + diff --git a/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb index 1def91d..f0aa4b8 100644 --- a/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb +++ b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb @@ -68,6 +68,11 @@ SRC_URI_append = " \ ${@bb.utils.contains('MACHINE_FEATURES','usb3','file://usb3.cfg','',d)} \ " +# W/A Fix build issue with Linux v4.14 +SRC_URI_append = " \ + file://0001-arm64-bpf-correct-broken-uapi-for-BPF_PROG_TYPE_PERF.patch \ +" + do_download_firmware () { install -m 755 ${WORKDIR}/r8a779x_usb3_v*.dlmem ${STAGING_KERNEL_DIR}/firmware } -- cgit 1.2.3-korg