Hi,
Following up on Luca's series addressing ioctl-related GCC warnings,
this series takes care of the remaining warnings reported by GCC (but
not Clang). The patches are all straightforward, except patch 13 (see
below).
Some notes:
- Patch 1-3 fix up small oversights in our own commits (see Fixes:
tags).
- Patch 9-10 are about creating user pointers in cases where it is
unavoidable, such cases are not concerning.
- Patch 11-12 and 14-18 are about creating user pointers because of
uapi deficiencies (i.e. user pointers represented as __u64 in
structs). They should therefore be viewed as a stopgap while waiting
for a full solution (uapi change and compat handling); this is tracked
by the following tickets:
* Patch 11: https://git.morello-project.org/morello/kernel/linux/-/issues/48
* Patch 12: https://git.morello-project.org/morello/kernel/linux/-/issues/47
* Patch 14: https://git.morello-project.org/morello/kernel/linux/-/issues/46
* Patch 15: https://git.morello-project.org/morello/kernel/linux/-/issues/50
* Patch 16: https://git.morello-project.org/morello/kernel/linux/-/issues/51
* Patch 17-18: https://git.morello-project.org/morello/kernel/linux/-/issues/52
- Patch 13 is upstreamable and is written in that spirit. Fixing up the
msg_control/msg_control_user split required grepping all uses, as only
a few misuses actually lead to warnings in PCuABI. Note that as an
exceptional bending of the rules, this patch introduces a warning
(both with Clang and GCC), which is impossible to avoid in a patch for
upstream. The next patch (14) fixes the warnings so it should not be
an issue in practice.
With these patches and Luca's, only a handful of genuine GCC warnings
are left:
- A few in fs/aio.c, tracked by
https://git.morello-project.org/morello/kernel/linux/-/issues/49
- A few under kernel/bpf/, should be addressed by
https://git.morello-project.org/morello/kernel/linux/-/issues/4
Other warnings are Morello GCC defects and have been reported.
Thanks,
Kevin
Kevin Brodsky (18):
arm64: signal: Avoid unnecessary capability arithmetic
drivers/android/binder: Cast to (void *) when printing %p
drivers/android/binder: Cast user_uintptr_t arg when printing
math.h: Make round_{up,down} capability-friendly
asm-generic/cacheflush.h: Use appropriate user pointer conversion
kernel: signal: Use appropriate user pointer conversion
perf/core: Use appropriate user pointer conversion
compat: Fix shift warning in compat64
audit: Explicitly create user pointer
coredump: Explicitly create user pointer
kernel/futex: Explicitly create user pointer
rseq: Explicitly create user pointers
net: Finish up ->msg_control{,_user} split
tcp: Explicitly create user pointers
Input: evdev: Explicitly create user pointers
mmc: block: Explicitly create user pointers
drm: Explicitly create user pointers
drm/panfrost: Explicitly create user pointers
arch/arm64/kernel/signal.c | 6 +++--
drivers/android/binder.c | 4 ++--
drivers/android/binder_alloc.c | 25 +++++++++++----------
drivers/gpu/drm/drm_atomic_uapi.c | 8 +++----
drivers/gpu/drm/drm_color_mgmt.c | 12 +++++-----
drivers/gpu/drm/drm_connector.c | 8 +++----
drivers/gpu/drm/drm_crtc.c | 2 +-
drivers/gpu/drm/drm_framebuffer.c | 2 +-
drivers/gpu/drm/drm_lease.c | 4 ++--
drivers/gpu/drm/drm_mode_object.c | 4 ++--
drivers/gpu/drm/drm_plane.c | 2 +-
drivers/gpu/drm/panfrost/panfrost_drv.c | 4 ++--
drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 2 +-
drivers/input/evdev.c | 4 ++--
drivers/mmc/core/block.c | 6 ++---
fs/coredump.c | 2 +-
include/asm-generic/cacheflush.h | 6 ++---
include/linux/math.h | 5 +++++
kernel/auditsc.c | 2 +-
kernel/compat.c | 4 ++--
kernel/events/core.c | 2 +-
kernel/futex/waitwake.c | 2 +-
kernel/rseq.c | 4 ++--
kernel/signal.c | 2 +-
net/compat.c | 13 ++++++-----
net/core/scm.c | 9 +++++---
net/ipv4/tcp.c | 8 +++----
27 files changed, 82 insertions(+), 70 deletions(-)
--
2.38.1
Hi all,
This patch series addresses the issue reported in the following issue:
https://git.morello-project.org/morello/kernel/linux/-/issues/42
Changes available at:
https://git.morello-project.org/Sevenarth/linux/-/commits/morello/6.1-fix-f…
v2:
- added a new argi variable which performs explicit int casting
- updated all of the commands with int argument to use argi explicitly
- updated signatures for the abstract generic_setlease and vfs_setlease with int argument
Luca Vizzarro (5):
fs/fcntl: Fix F_SETLEASE argument type
fs/fcntl: Fix F_SETSIG argument type
fs/fcntl: Fix F_SETPIPE_SZ argument type
fs/fcntl: Fix F_ADD_SEALS argument type
fs/fcntl: Update commands with argi
fs/cifs/cifsfs.c | 2 +-
fs/fcntl.c | 23 ++++++++++++-----------
fs/libfs.c | 2 +-
fs/locks.c | 22 +++++++++++-----------
fs/nfs/nfs4file.c | 2 +-
fs/nfs/nfs4proc.c | 4 ++--
fs/pipe.c | 6 +++---
include/linux/fs.h | 16 ++++++++--------
include/linux/memfd.h | 4 ++--
include/linux/pipe_fs_i.h | 4 ++--
mm/memfd.c | 6 +-----
11 files changed, 44 insertions(+), 47 deletions(-)
--
2.34.1
Hi all,
This patch series addresses the issue reported in the following issue:
https://git.morello-project.org/morello/kernel/linux/-/issues/42
Changes available at:
https://git.morello-project.org/Sevenarth/linux/-/commits/morello/6.1-fix-f…
v3:
- move the explicit cast change before updating the interfaces
- fix typos
v2:
- added a new argi variable which performs explicit int casting
- updated all of the commands with int argument to use argi explicitly
- updated signatures for the abstract generic_setlease and vfs_setlease with int argument
Luca Vizzarro (4):
fs/fcntl: Cast commands with int args explicitly
fs/fcntl: Fix F_SETLEASE helper functions
fs/fcntl: Fix F_SETPIPE_SZ helper functions
fs/fcntl: Fix F_ADD_SEALS helper functions
fs/cifs/cifsfs.c | 2 +-
fs/fcntl.c | 23 ++++++++++++-----------
fs/libfs.c | 2 +-
fs/locks.c | 22 +++++++++++-----------
fs/nfs/nfs4file.c | 2 +-
fs/nfs/nfs4proc.c | 4 ++--
fs/pipe.c | 6 +++---
include/linux/fs.h | 16 ++++++++--------
include/linux/memfd.h | 4 ++--
include/linux/pipe_fs_i.h | 4 ++--
mm/memfd.c | 6 +-----
11 files changed, 44 insertions(+), 47 deletions(-)
--
2.34.1
On 13/02/2023 14:30, Björn Töpel wrote:
> Björn Töpel <bjorn(a)kernel.org> writes:
>
>> From: Björn Töpel <bjorn(a)rivosinc.com>
>>
>> When the BPF selftests are cross-compiled, only the a host version of
>> bpftool is built. This version of bpftool is used to generate various
>> intermediates, e.g., skeletons.
>>
>> The test runners are also using bpftool. The Makefile will symlink
>> bpftool from the selftest/bpf root, where the test runners will look
>> for the tool:
>>
>> | ...
>> | $(Q)ln -sf $(if $2,..,.)/tools/build/bpftool/bootstrap/bpftool \
>> | $(OUTPUT)/$(if $2,$2/)bpftool
>>
>> There are two issues for cross-compilation builds:
>>
>> 1. There is no native (cross-compilation target) build of bpftool
>> 2. The bootstrap variant of bpftool is never cross-compiled (by
>> design)
>>
>> Make sure that a native/cross-compiled version of bpftool is built,
>> and if CROSS_COMPILE is set, symlink to the native/non-bootstrap
>> version.
>
> ...and the grand master plan is to add BPF CI support for riscv64, where
> this patch a prerequisite to [1]. I would suspect that other platforms
> might benefit from cross-compilation builds as well.
Similar use case. There also seems to be a lot of issues building these
tests out of tree.
I have some potential fixes up to 6.1 but linux-next seems to have
introduced a few more issues on top.
>
> [1] https://github.com/kernel-patches/vmtest/pull/194
Hi All,
This series are modifications in kselftests required to compile
with alpha version of Morello Gnu toochain recently released [1].
The whole series can also be found here [2].
Changes in v3 as reviewed by Kevin:
* Patch 4 modified to fix the comment message.
* Patch 5 modified to define INT_MAX inside freestanding.h.
* Dropped patch 6 from v2 as the issue is reported to Morello GCC team.
* Patch 8 modified to add macros to create capability and not rely on clearing
selective permissions.
* Patch 9 modified to add memcpy/memmove optimized routine in a new file.
* Patch 10 modified to all allow LLVM definitions from user to swith to clang build.
Thanks,
Amit Daniel
[1]: https://developer.arm.com/downloads/-/arm-gnu-toolchain-for-morello-downloa…
[2]: git@git.morello-project.org:amitdaniel/linux.git gcc_kselftests_support_v3
Amit Daniel Kachhap (10):
kselftests/arm64: morello: Fix inline assembly syntax
kselftests/arm64: morello: Define uintcap_t for GCC
kselftests/arm64: morello: Fix the -Wcast-function-type warnings
kselftests/arm64: morello: Fix the fallthrough warning
kselftests/arm64: morello: Avoid limits.h for Gcc
kselftests/arm64: morello: clone: Initialize the local variable
kselftests/arm64: morello: clone: Guard if clause to avoid warning
kselftests/arm64: morello: Process the dynamic relocations
kselftests/arm64: morello: Add optimized routine for memcpy
kselftests/arm64: morello: Enable Gcc toolchain support
.../testing/selftests/arm64/morello/Makefile | 20 +-
.../selftests/arm64/morello/bootstrap.c | 7 +-
tools/testing/selftests/arm64/morello/clone.c | 6 +-
.../selftests/arm64/morello/freestanding.h | 7 +
.../arm64/morello/freestanding_init_globals.c | 133 ++++-
.../arm64/morello/freestanding_start.S | 5 +-
.../selftests/arm64/morello/morello_memcpy.S | 533 ++++++++++++++++++
.../testing/selftests/arm64/morello/signal.c | 4 +-
8 files changed, 693 insertions(+), 22 deletions(-)
create mode 100644 tools/testing/selftests/arm64/morello/morello_memcpy.S
--
2.25.1
Hi All,
This series are modifications in kselftests required to compile
with alpha version of Morello Gnu toochain recently released [1].
The whole series can also be found here [2].
Changes in v2:
Rebased and tested on Morello 6.1 kernel.
1) "kselftests/arm64: morello: Fix inline assembly syntax"
- Commit log change as suggested by Kevin.
2) "kselftests/arm64: morello: Define uintcap_t for GCC"
- Used "#ifndef __clang__" instead of "#ifndef uintcap_t"
3) "kselftests/arm64: morello: Fix the -Wcast-function-type warnings"
- New patch to fix cast function type warnings.
4) "kselftests/arm64: morello: Fix the fallthrough warning"
- New patch to fix fallthrough warning
5) "kselftests/arm64: morello: Avoid limits.h for Gcc"
- New patch to fix the compilation of non-existing limits.h
6) "kselftests/arm64: morello: Fix the field initializer warnings"
- New patch
7) "kselftests/arm64: morello: clone: Initialize the local variable"
- New patch to fix an uninitialized variable.
8) "kselftests/arm64: morello: clone: Guard if clause to avoid warning"
- New patch
9) "kselftests/arm64: morello: Process the dynamic relocations"
- Code re-structered and macros to create explicit capabilities. Now the logic
to create R/RW/RX is simpilfied and inspired from dyn. relocations in CheriBSD.
- Fixed position of __attribute__((may_alias)) in the pointer.
- Removed compiler barrier instruction.
- Functions renamed from __morello_init_{cap/dynamic}_relocs to __morello_process_{cap/dynamic}_relocs*.
- Implemented several minor suggestions from Kevin.
10) "kselftests/arm64: morello: Add optimized routine for memcpy"
- New patch to add memcpy/memmove assembly routines as suggested by Kevin.
11) "kselftests/arm64: morello: Enable Gcc toolchain support"
- Removed -integrated-as and --target clang flags as they are added
in 6.1 kernel as suggested by Kevin.
Thanks,
Amit Daniel
[1]: https://developer.arm.com/downloads/-/arm-gnu-toolchain-for-morello-downloa…
[2]: git@git.morello-project.org:amitdaniel/linux.git gcc_kselftests_support_v2
Amit Daniel Kachhap (11):
kselftests/arm64: morello: Fix inline assembly syntax
kselftests/arm64: morello: Define uintcap_t for GCC
kselftests/arm64: morello: Fix the -Wcast-function-type warnings
kselftests/arm64: morello: Fix the fallthrough warning
kselftests/arm64: morello: Avoid limits.h for Gcc
kselftests/arm64: morello: Fix the field initializer warnings
kselftests/arm64: morello: clone: Initialize the local variable
kselftests/arm64: morello: clone: Guard if clause to avoid warning
kselftests/arm64: morello: Process the dynamic relocations
kselftests/arm64: morello: Add optimized routine for memcpy
kselftests/arm64: morello: Enable Gcc toolchain support
.../testing/selftests/arm64/morello/Makefile | 12 +-
.../selftests/arm64/morello/bootstrap.c | 7 +-
tools/testing/selftests/arm64/morello/clone.c | 58 +-
.../selftests/arm64/morello/freestanding.h | 3 +
.../arm64/morello/freestanding_init_globals.c | 114 +++-
.../arm64/morello/freestanding_start.S | 525 +++++++++++++++++-
.../testing/selftests/arm64/morello/signal.c | 4 +-
7 files changed, 689 insertions(+), 34 deletions(-)
--
2.25.1