Skip to content

[PW_SID:971515] RISC-V: turn sbi_ecall into a variadic macro#519

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw971515
Closed

[PW_SID:971515] RISC-V: turn sbi_ecall into a variadic macro#519
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw971515

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 971515 applied to workflow__riscv__fixes

Name: RISC-V: turn sbi_ecall into a variadic macro
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=971515
Version: 1

Counting the arguments to sbi_ecall() and padding with zeros gets old
pretty quick.  It's also harder to distinguish a tailing 0 argument and
the padding.  The patch changes sbi_ecall() to accept anything between 1
and 8 integer arguments.

Those who can count are also given sbi_ecall1() to sbi_ecall8(), which
the variadic magic uses under the hood.  The error messages upon a
programmer error are a bit hairy, as expected of macros, and the
static_assert is there to improve them a bit.

The final goal would be avoid clobbering registers that are not used in
the ecall, but we first have to fix the code generation around
tracepoints if sbi_ecall is expected to be used in paths where
performance is critical.

Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The new sbi_ecall doesn't have to list all 8 arguments anymore, so only
pass the actual numbers of arguments for each SBI function.

Trailing 0 is sometimes intentional.

Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 102.19 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1029.00 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1505.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.53 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.69 seconds
Result: WARNING
Output:

WARNING: Argument '_' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

WARNING: Argument 'a' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

WARNING: Argument 'b' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

WARNING: Argument 'c' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

WARNING: Argument 'd' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

WARNING: Argument 'e' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

WARNING: Argument 'f' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

WARNING: Argument 'g' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

WARNING: Argument 'h' is not used in function-like macro
#65: FILE: arch/riscv/include/asm/sbi.h:487:
+#define __sbi_count_args_magic(_, a, b, c, d, e, f, g, h, N, ...) N

total: 0 errors, 9 warnings, 0 checks, 48 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 9853fe554f69 ("RISC-V: sbi: turn sbi_ecall into variadic macro") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 9 warnings, 0 checks, 48 lines checked
WARNING: Argument '_' is not used in function-like macro
WARNING: Argument 'a' is not used in function-like macro
WARNING: Argument 'b' is not used in function-like macro
WARNING: Argument 'c' is not used in function-like macro
WARNING: Argument 'd' is not used in function-like macro
WARNING: Argument 'e' is not used in function-like macro
WARNING: Argument 'f' is not used in function-like macro
WARNING: Argument 'g' is not used in function-like macro
WARNING: Argument 'h' is not used in function-like macro


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 70.69 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
kdoc
Desc: Detects for kdoc errors
Duration: 3.14 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] RISC-V: sbi: turn sbi_ecall into variadic macro"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 101.76 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1029.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1502.54 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.39 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 70.92 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
module-param
Desc: Detect module_param changes
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] RISC-V: make use of variadic sbi_ecall"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw971515 branch June 19, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants