Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Treat warning as error #6

Merged
merged 2 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
toolchain_tripe: riscv64-unknown-linux-gnu-
- name: linux-32ilp32-dirty
toolchain_tripe: riscv32-unknown-linux-gnu-
- name: linux-64ilp32_12hz
toolchain_tripe: riscv64-unknown-elf-
- name: linux-64lp64-dirty_12hz
toolchain_tripe: riscv64-unknown-linux-gnu-
- name: linux-32ilp32-dirty_12hz
toolchain_tripe: riscv32-unknown-linux-gnu-
# - name: linux-64ilp32_12hz
# toolchain_tripe: riscv64-unknown-elf-
# - name: linux-64lp64-dirty_12hz
# toolchain_tripe: riscv64-unknown-linux-gnu-
# - name: linux-32ilp32-dirty_12hz
# toolchain_tripe: riscv32-unknown-linux-gnu-

runs-on: ubuntu-22.04
env:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
mv linux-ffc253263a1375a65fa6c9f62a893e9767fbebfa linux-6.6
cp arch/riscv/configs/defconfig linux-6.6/arch/riscv/configs/defconfig
cd linux-6.6
make ARCH=riscv EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./
cp Documentation/admin-guide/kdump/gdbmacros.txt ./
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux modules_install headers_install gdbmacros.txt
Expand All @@ -119,7 +119,7 @@ jobs:
mv linux-ffc253263a1375a65fa6c9f62a893e9767fbebfa linux-6.6
cp arch/riscv/configs/defconfig linux-6.6/arch/riscv/configs/defconfig
cd linux-6.6
make ARCH=riscv EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./
cp Documentation/admin-guide/kdump/gdbmacros.txt ./
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux modules_install headers_install gdbmacros.txt
Expand All @@ -130,29 +130,29 @@ jobs:
if [ x"${{ matrix.name }}" = x"linux-64ilp32" ]; then
export PATH="/opt/riscv/bin:$PATH"
echo CONFIG_MMU_SV32=y >> arch/riscv/configs/64ilp32.config
make ARCH=riscv EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./Image_sv32xt
mv vmlinux vmlinux_sv32xt
mv headers_install headers_install_sv32xt
mv modules_install modules_install_sv32xt
git checkout arch/riscv/configs/64ilp32.config
make ARCH=riscv EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./
cp Documentation/admin-guide/kdump/gdbmacros.txt ./
git log --oneline -500 > git.log
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux modules_install headers_install Image_sv32xt vmlinux_sv32xt modules_install_sv32xt headers_install_sv32xt git.log gdbmacros.txt
fi
if [ x"${{ matrix.name }}" = x"linux-64lp64-dirty" ]; then
export PATH="/opt/riscv/bin:$PATH"
make ARCH=riscv EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./
cp Documentation/admin-guide/kdump/gdbmacros.txt ./
git log --oneline -500 > git.log
tar czvf ${{ matrix.name }}.tar.gz Image vmlinux git.log modules_install headers_install gdbmacros.txt
fi
if [ x"${{ matrix.name }}" = x"linux-32ilp32-dirty" ]; then
export PATH="/opt/riscv/bin:$PATH"
make ARCH=riscv EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./
cp Documentation/admin-guide/kdump/gdbmacros.txt ./
git log --oneline -500 > git.log
Expand All @@ -163,13 +163,13 @@ jobs:
export PATH="/opt/riscv/bin:$PATH"
echo CONFIG_HZ_12=y >> arch/riscv/configs/defconfig
echo CONFIG_MMU_SV32=y >> arch/riscv/configs/64ilp32.config
make ARCH=riscv EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./Image_sv32xt
mv vmlinux vmlinux_sv32xt
mv headers_install headers_install_sv32xt
mv modules_install modules_install_sv32xt
git checkout arch/riscv/configs/64ilp32.config
make ARCH=riscv EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv64ilp32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./
cp Documentation/admin-guide/kdump/gdbmacros.txt ./
git log --oneline -500 > git.log
Expand All @@ -178,7 +178,7 @@ jobs:
if [ x"${{ matrix.name }}" = x"linux-64lp64-dirty_12hz" ]; then
export PATH="/opt/riscv/bin:$PATH"
echo CONFIG_HZ_12=y >> arch/riscv/configs/defconfig
make ARCH=riscv EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./
cp Documentation/admin-guide/kdump/gdbmacros.txt ./
git log --oneline -500 > git.log
Expand All @@ -187,7 +187,7 @@ jobs:
if [ x"${{ matrix.name }}" = x"linux-32ilp32-dirty_12hz" ]; then
export PATH="/opt/riscv/bin:$PATH"
echo CONFIG_HZ_12=y >> arch/riscv/configs/defconfig
make ARCH=riscv EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
make ARCH=riscv EXTRA_CFLAGS+=-Werror EXTRA_CFLAGS+=-g rv32_defconfig all INSTALL_MOD_PATH=./modules_install modules_install INSTALL_HDR_PATH=./headers_install headers_install -j$(nproc)
mv arch/riscv/boot/Image ./
cp Documentation/admin-guide/kdump/gdbmacros.txt ./
git log --oneline -500 > git.log
Expand Down
26 changes: 13 additions & 13 deletions arch/riscv/net/bpf_jit_comp64.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static int emit_addr(u8 rd, u64 addr, bool extra_pass, struct rv_jit_context *ct
* Use the ro_insns(RX) to calculate the offset as the BPF program will
* finally run from this memory region.
*/
u64 ip = (u64)(ctx->ro_insns + ctx->ninsns);
u64 ip = (u64)(ulong)(ctx->ro_insns + ctx->ninsns);
s64 off = addr - ip;
s64 upper = (off + (1 << 11)) >> 12;
s64 lower = off & 0xfff;
Expand Down Expand Up @@ -745,10 +745,10 @@ static int invoke_bpf_prog(struct bpf_tramp_link *l, int args_off, int retval_of
}

/* arg1: prog */
emit_imm(RV_REG_A0, (const s64)p, ctx);
emit_imm(RV_REG_A0, (const s64)(ulong)p, ctx);
/* arg2: &run_ctx */
emit_addi(RV_REG_A1, RV_REG_FP, -run_ctx_off, ctx);
ret = emit_call((const u64)bpf_trampoline_enter(p), true, ctx);
ret = emit_call((const u64)(ulong)bpf_trampoline_enter(p), true, ctx);
if (ret)
return ret;

Expand All @@ -766,8 +766,8 @@ static int invoke_bpf_prog(struct bpf_tramp_link *l, int args_off, int retval_of
emit_addi(RV_REG_A0, RV_REG_FP, -args_off, ctx);
if (!p->jited)
/* arg2: progs[i]->insnsi for interpreter */
emit_imm(RV_REG_A1, (const s64)p->insnsi, ctx);
ret = emit_call((const u64)p->bpf_func, true, ctx);
emit_imm(RV_REG_A1, (const s64)(ulong)p->insnsi, ctx);
ret = emit_call((const u64)(ulong)p->bpf_func, true, ctx);
if (ret)
return ret;

Expand All @@ -784,12 +784,12 @@ static int invoke_bpf_prog(struct bpf_tramp_link *l, int args_off, int retval_of
}

/* arg1: prog */
emit_imm(RV_REG_A0, (const s64)p, ctx);
emit_imm(RV_REG_A0, (const s64)(ulong)p, ctx);
/* arg2: prog start time */
emit_mv(RV_REG_A1, RV_REG_S1, ctx);
/* arg3: &run_ctx */
emit_addi(RV_REG_A2, RV_REG_FP, -run_ctx_off, ctx);
ret = emit_call((const u64)bpf_trampoline_exit(p), true, ctx);
ret = emit_call((const u64)(ulong)bpf_trampoline_exit(p), true, ctx);

return ret;
}
Expand Down Expand Up @@ -919,7 +919,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,

/* store ip address of the traced function */
if (flags & BPF_TRAMP_F_IP_ARG) {
emit_imm(RV_REG_T1, (const s64)func_addr, ctx);
emit_imm(RV_REG_T1, (const s64)(ulong)func_addr, ctx);
emit_sd(RV_REG_FP, -ip_off, RV_REG_T1, ctx);
}

Expand All @@ -933,8 +933,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
orig_call += RV_FENTRY_NINSNS * 4;

if (flags & BPF_TRAMP_F_CALL_ORIG) {
emit_imm(RV_REG_A0, (const s64)im, ctx);
ret = emit_call((const u64)__bpf_tramp_enter, true, ctx);
emit_imm(RV_REG_A0, (const s64)(ulong)im, ctx);
ret = emit_call((const u64)(ulong)__bpf_tramp_enter, true, ctx);
if (ret)
return ret;
}
Expand Down Expand Up @@ -967,7 +967,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,

if (flags & BPF_TRAMP_F_CALL_ORIG) {
restore_args(nregs, args_off, ctx);
ret = emit_call((const u64)orig_call, true, ctx);
ret = emit_call((const u64)(ulong)orig_call, true, ctx);
if (ret)
goto out;
emit_sd(RV_REG_FP, -retval_off, RV_REG_A0, ctx);
Expand All @@ -994,8 +994,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,

if (flags & BPF_TRAMP_F_CALL_ORIG) {
im->ip_epilogue = ctx->insns + ctx->ninsns;
emit_imm(RV_REG_A0, (const s64)im, ctx);
ret = emit_call((const u64)__bpf_tramp_exit, true, ctx);
emit_imm(RV_REG_A0, (const s64)(ulong)im, ctx);
ret = emit_call((const u64)(ulong)__bpf_tramp_exit, true, ctx);
if (ret)
goto out;
}
Expand Down