Skip to content

[PW_SID:1079009] add riscv32 double-word shifts and library test#1743

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

[PW_SID:1079009] add riscv32 double-word shifts and library test#1743
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1079009

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1079009 applied to workflow__riscv__fixes

Name: add riscv32 double-word shifts and library test
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1079009
Version: 2

Add riscv32-specific '__ashldi3()', '__ashrdi3()', and '__lshrdi3()'.
Initially it was intended to fix the following link error observed
when building EFI-enabled kernel with CONFIG_EFI_STUB=y and
CONFIG_EFI_GENERIC_STUB=y:

riscv32-linux-gnu-ld: ./drivers/firmware/efi/libstub/lib-cmdline.stub.o: in function `__efistub_.L49':
__efistub_cmdline.c:(.init.text+0x1f2): undefined reference to `__efistub___ashldi3'
riscv32-linux-gnu-ld: __efistub_cmdline.c:(.init.text+0x202): undefined reference to `__efistub___lshrdi3'

Reported at [1] trying to build https://patchew.org/linux/20260212164413.889625-1-dmantipov@yandex.ru,
tested with 'qemu-system-riscv32 -M virt' only.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603041925.KLKqpK6N-lkp@intel.com [1]
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add KUnit tests for '__ashldi3()', '__ashrdi3()', and '__lshrdi3()'
helper functions used to implement 64-bit arithmetic shift left,
arithmetic shift right and logical shift right, respectively,
on a 32-bit CPUs.

Tested with 'qemu-system-riscv32 -M virt' and 'qemu-system-arm -M virt'.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 134.99 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 912.53 seconds
Result: ERROR
Output:

Redirect to /build/tmp.3k7btRSCzd and /build/tmp.WKbjUqoul5
Tree base:
506e7f67b3724 ("Adding CI files")
Building the whole tree with the patch
error:
Warning: /build/tmpc9_pjsqx/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:244 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3



real	15m4.296s
user	565m0.583s
sys	106m7.790s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1422.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 24.68 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 26.11 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 3.08 seconds
Result: WARNING
Output:

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#80: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 138 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 e0dde6451d20 ("riscv: add platform-specific double word shifts for riscv32") 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, 1 warnings, 0 checks, 138 lines checked
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 82.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
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 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
kdoc
Desc: Detects for kdoc errors
Duration: 1.71 seconds
Result: ERROR
Output:

Checking the tree before the patch
Error: Cannot find file arch/riscv/lib/ashldi3.S
Error: Cannot find file arch/riscv/lib/ashrdi3.S
Error: Cannot find file arch/riscv/lib/lshrdi3.S
Checking the tree with the patch
Warning: arch/riscv/lib/ashldi3.S:2 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
 * Adopted for the Linux kernel from IPXE project, see
Warning: arch/riscv/lib/ashldi3.S:10 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
 * Shift left
Warning: arch/riscv/lib/ashrdi3.S:2 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
 * Adopted for the Linux kernel from IPXE project, see
Warning: arch/riscv/lib/ashrdi3.S:10 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
 * Arithmetic shift right
Warning: arch/riscv/lib/lshrdi3.S:2 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
 * Adopted for the Linux kernel from IPXE project, see
Warning: arch/riscv/lib/lshrdi3.S:10 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
 * Logical shift right
Errors and warnings before: 3 this patch: 12
New warnings added
1,3c1,12
< Error: Cannot find file arch/riscv/lib/ashldi3.S
< Error: Cannot find file arch/riscv/lib/ashrdi3.S
< Error: Cannot find file arch/riscv/lib/lshrdi3.S
---
> Warning: arch/riscv/lib/ashldi3.S:2 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
>  * Adopted for the Linux kernel from IPXE project, see
> Warning: arch/riscv/lib/ashldi3.S:10 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
>  * Shift left
> Warning: arch/riscv/lib/ashrdi3.S:2 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
>  * Adopted for the Linux kernel from IPXE project, see
> Warning: arch/riscv/lib/ashrdi3.S:10 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
>  * Arithmetic shift right
> Warning: arch/riscv/lib/lshrdi3.S:2 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
>  * Adopted for the Linux kernel from IPXE project, see
> Warning: arch/riscv/lib/lshrdi3.S:10 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
>  * Logical shift right
Per-file breakdown


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
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: "[v2,1/2] riscv: add platform-specific double word shifts for riscv32"
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/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 134.78 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 915.61 seconds
Result: ERROR
Output:

Redirect to /build/tmp.emNaskPuJx and /build/tmp.E7BZUbJvBy
Tree base:
e0dde6451d203 ("riscv: add platform-specific double word shifts for riscv32")
Building the whole tree with the patch
error:
Warning: /build/tmpnerhl5ur/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:244 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3
ld.lld: error: ./arch/riscv/kernel/vmlinux.lds:9: symbol not found: __ashldi3



real	15m7.269s
user	564m59.424s
sys	106m31.232s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1344.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 24.80 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 25.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.31 seconds
Result: WARNING
Output:

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#58: 
new file mode 100644

CHECK: Please use a blank line after function/struct/union/enum declarations
#234: FILE: lib/tests/shdi3_kunit.c:172:
+};
+kunit_test_suite(shdi3_test_suite);

total: 0 errors, 1 warnings, 1 checks, 198 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 8e73e42aaa4e ("lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()") 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, 1 warnings, 1 checks, 198 lines checked
CHECK: Please use a blank line after function/struct/union/enum declarations
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 82.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
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/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
kdoc
Desc: Detects for kdoc errors
Duration: 0.93 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
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: "[v2,2/2] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1079009 branch April 17, 2026 01:52
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