diff mbox series

[03/17] um: don't generate asm/bpf_perf_event.h

Message ID 20240704143611.2979589-4-arnd@kernel.org (mailing list archive)
State Handled Elsewhere
Headers show
Series arch: convert everything to syscall.tbl | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR success PR summary
conchuod/patch-3-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-3-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-3-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-3-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-3-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-3-test-6 warning .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-3-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-3-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-3-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-3-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-3-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-3-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Arnd Bergmann July 4, 2024, 2:35 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

If we start validating the existence of the asm-generic side of
generated headers, this one causes a warning:

make[3]: *** No rule to make target 'arch/um/include/generated/asm/bpf_perf_event.h', needed by 'all'.  Stop.

The problem is that the asm-generic header only exists for the uapi
variant, but arch/um has no uapi headers and instead uses the x86
userspace API.

Add a custom file with an explicit redirect to avoid this.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/um/include/asm/Kbuild           | 1 -
 arch/um/include/asm/bpf_perf_event.h | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 arch/um/include/asm/bpf_perf_event.h

Comments

Stephen Rothwell July 5, 2024, 12:26 p.m. UTC | #1
Hi Arnd,

On Thu,  4 Jul 2024 16:35:57 +0200 Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
> 
> If we start validating the existence of the asm-generic side of
> generated headers, this one causes a warning:
> 
> make[3]: *** No rule to make target 'arch/um/include/generated/asm/bpf_perf_event.h', needed by 'all'.  Stop.
> 
> The problem is that the asm-generic header only exists for the uapi
> variant, but arch/um has no uapi headers and instead uses the x86
> userspace API.
> 
> Add a custom file with an explicit redirect to avoid this.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/um/include/asm/Kbuild           | 1 -
>  arch/um/include/asm/bpf_perf_event.h | 3 +++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>  create mode 100644 arch/um/include/asm/bpf_perf_event.h
> 
> diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
> index 6fe34779291a..6c583040537c 100644
> --- a/arch/um/include/asm/Kbuild
> +++ b/arch/um/include/asm/Kbuild
> @@ -1,5 +1,4 @@
>  # SPDX-License-Identifier: GPL-2.0
> -generic-y += bpf_perf_event.h
>  generic-y += bug.h
>  generic-y += compat.h
>  generic-y += current.h
> diff --git a/arch/um/include/asm/bpf_perf_event.h b/arch/um/include/asm/bpf_perf_event.h
> new file mode 100644
> index 000000000000..0a30420c83de
> --- /dev/null
> +++ b/arch/um/include/asm/bpf_perf_event.h
> @@ -0,0 +1,3 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#include <asm-generic/bpf_perf_event.h>

Just wondering if that file should have some explanatory comment in it
to prevent it being cleaned up in a few years ... or at least to
explain why it causes the above error when removed.
Masahiro Yamada July 12, 2024, 8:37 a.m. UTC | #2
On Thu, Jul 4, 2024 at 11:37 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> If we start validating the existence of the asm-generic side of
> generated headers, this one causes a warning:
>
> make[3]: *** No rule to make target 'arch/um/include/generated/asm/bpf_perf_event.h', needed by 'all'.  Stop.
>
> The problem is that the asm-generic header only exists for the uapi
> variant, but arch/um has no uapi headers and instead uses the x86
> userspace API.
>
> Add a custom file with an explicit redirect to avoid this.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/um/include/asm/Kbuild           | 1 -
>  arch/um/include/asm/bpf_perf_event.h | 3 +++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>  create mode 100644 arch/um/include/asm/bpf_perf_event.h
>
> diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
> index 6fe34779291a..6c583040537c 100644
> --- a/arch/um/include/asm/Kbuild
> +++ b/arch/um/include/asm/Kbuild
> @@ -1,5 +1,4 @@
>  # SPDX-License-Identifier: GPL-2.0
> -generic-y += bpf_perf_event.h
>  generic-y += bug.h
>  generic-y += compat.h
>  generic-y += current.h
> diff --git a/arch/um/include/asm/bpf_perf_event.h b/arch/um/include/asm/bpf_perf_event.h
> new file mode 100644
> index 000000000000..0a30420c83de
> --- /dev/null
> +++ b/arch/um/include/asm/bpf_perf_event.h
> @@ -0,0 +1,3 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#include <asm-generic/bpf_perf_event.h>
> --
> 2.39.2
>


I guess this is a step backward.

Technically, kernel-space asm/*.h files are allowed to
wrap UAPI <asm-generic/*.h>.
There is no reason why we ban generic-y for doing this,
whereas check-in source is allowed.




--
Best Regards
Masahiro Yamada
Arnd Bergmann July 12, 2024, 9:13 a.m. UTC | #3
On Fri, Jul 12, 2024, at 10:37, Masahiro Yamada wrote:
> On Thu, Jul 4, 2024 at 11:37 PM Arnd Bergmann <arnd@kernel.org> wrote:
>> --- a/arch/um/include/asm/Kbuild
>> +++ b/arch/um/include/asm/Kbuild
>> @@ -1,5 +1,4 @@
>>  # SPDX-License-Identifier: GPL-2.0
>> -generic-y += bpf_perf_event.h
>>  generic-y += bug.h
>>  generic-y += compat.h
>>  generic-y += current.h
>> diff --git a/arch/um/include/asm/bpf_perf_event.h b/arch/um/include/asm/bpf_perf_event.h
>> new file mode 100644
>> index 000000000000..0a30420c83de
>> --- /dev/null
>> +++ b/arch/um/include/asm/bpf_perf_event.h
>> @@ -0,0 +1,3 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +
>> +#include <asm-generic/bpf_perf_event.h>
>
> I guess this is a step backward.
>
> Technically, kernel-space asm/*.h files are allowed to
> wrap UAPI <asm-generic/*.h>.
> There is no reason why we ban generic-y for doing this,
> whereas check-in source is allowed.

I think in this case, the simplicity is the more important
argument: this is the only case we have of wrapping a
uapi header from a non-uapi header, and no other architecture
would need to do this.

The way the syscall-y rule works relies on enforcing some
checking for existing asm-generic headers, and I could extend
it to allow this special case, but that would make the
Makefile rule less readable  in exchange for avoiding
effectively a one-line file.

    Arnd
diff mbox series

Patch

diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
index 6fe34779291a..6c583040537c 100644
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
@@ -1,5 +1,4 @@ 
 # SPDX-License-Identifier: GPL-2.0
-generic-y += bpf_perf_event.h
 generic-y += bug.h
 generic-y += compat.h
 generic-y += current.h
diff --git a/arch/um/include/asm/bpf_perf_event.h b/arch/um/include/asm/bpf_perf_event.h
new file mode 100644
index 000000000000..0a30420c83de
--- /dev/null
+++ b/arch/um/include/asm/bpf_perf_event.h
@@ -0,0 +1,3 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <asm-generic/bpf_perf_event.h>