Skip to content

[PW_SID:1064028] selftests: riscv: Fix compilation issues for v_ptrace and cfi#1582

Closed
linux-riscv-bot wants to merge 4 commits into
workflow__riscv__fixesfrom
pw1064028
Closed

[PW_SID:1064028] selftests: riscv: Fix compilation issues for v_ptrace and cfi#1582
linux-riscv-bot wants to merge 4 commits into
workflow__riscv__fixesfrom
pw1064028

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1064028 applied to workflow__riscv__fixes

Name: selftests: riscv: Fix compilation issues for v_ptrace and cfi
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1064028
Version: 2

The BIT() macros is used by the validate_v_ptrace() test case, but not
defined. Include linux/bits.h to pull in this definition. To ensure that
the header in the kernel source is used, add tools/include to the header
search path.

Fixes: 30eb191 ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
EXPECT_EQ() expands to multiple lines, breaking up one-line if
statements. This issue was not present in the patch on the mailing list
but was instead introduced by the maintainer when attempting to fix up
checkpatch warnings. Add braces around EXPECT_EQ() to avoid the error
even though checkpatch suggests them to be removed:

validate_v_ptrace.c:626:17: error: ‘else’ without a previous ‘if’

Fixes: 3789d5e ("selftests: riscv: verify syscalls discard vector context")
Fixes: 30eb191 ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Fixes: 849f05a ("selftests: riscv: verify ptrace accepts valid vector csr values")
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
BIT() is being used in ptrace.h without a definition, resulting in
compilation errors in tools/testing/selftests/riscv/cfi/cfitests.c:

cfitests.c:101:60: error: implicit declaration of function ‘BIT’ [-Wimplicit-function-declaration]
  101 |                      if ((cfi_reg.cfi_status.cfi_state & CFI_ENABLE_MASK) != CFI_ENABLE_MASK)

Include linux/bits.h to resolve this issue.

Fixes: 2af7c9c ("riscv/ptrace: expose riscv CFI status and state via ptrace and in core files")
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Reviewed-by: Deepak Gupta <debug@rivosinc.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The cfi selftest was missing a license so add it.

Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Reviewed-by: Deepak Gupta <debug@rivosinc.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.92 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1001.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1375.98 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.11 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.00 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 86.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
kdoc
Desc: Detects for kdoc errors
Duration: 0.83 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/4] selftests: riscv: Add definition of BIT() macro"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.58 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1001.50 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1363.85 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.09 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.60 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.76 seconds
Result: WARNING
Output:

WARNING: braces {} are not necessary for any arm of this statement
#35: FILE: tools/testing/selftests/riscv/vector/validate_v_ptrace.c:294:
+		if (is_xtheadvector_supported()) {
[...]
-		else
[...]

WARNING: braces {} are not necessary for any arm of this statement
#49: FILE: tools/testing/selftests/riscv/vector/validate_v_ptrace.c:624:
+		if (is_xtheadvector_supported()) {
[...]
-		else
[...]

WARNING: braces {} are not necessary for any arm of this statement
#63: FILE: tools/testing/selftests/riscv/vector/validate_v_ptrace.c:833:
+		if (is_xtheadvector_supported()) {
[...]
-		else
[...]

total: 0 errors, 3 warnings, 0 checks, 39 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 b8042a436a8a ("selftests: riscv: Add braces around EXPECT_EQ()") 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, 3 warnings, 0 checks, 39 lines checked
WARNING: braces {} are not necessary for any arm of this statement


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 85.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
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: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
kdoc
Desc: Detects for kdoc errors
Duration: 0.85 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.35 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/4] selftests: riscv: Add braces around EXPECT_EQ()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.59 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2288.05 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 3045.80 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.95 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.77 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
kdoc
Desc: Detects for kdoc errors
Duration: 4.19 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
module-param
Desc: Detect module_param changes
Duration: 0.54 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/4] riscv: ptrace: Fix BIT() compilation issues"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.04 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1006.71 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1365.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.47 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.96 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v2,4/4] selftests: riscv: Add license to cfi selftest"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1064028 branch March 18, 2026 00:02
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