-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add support for RISC-V #172
base: master
Are you sure you want to change the base?
Conversation
Hello @bcoles, Cool, thanks for your work and interest to this project! Some thoughts for the beginning:
|
No, we don't need all three. I have replaced these with one:
I thought the included defconf files were supposed to represent the mainline defaults. The other defconf files in the repository certainly do not pass - they result in multiple failures. Perhaps I misunderstand. Can you elaborate? |
I mean For example,
It's the first thing that we need to fix in this pull request:
After this work, our Thank you! |
Thanks.
That makes sense. I have implemented these changes.
I have implemented these changes for Output:
|
As for the checks, KSPP Recommended Settings does not currently have recommendations for RISC-V, but some of the existing recommendations for other architectures are likely to be applicable. These may need to be assessed individually. For example:
Do you have a suggestion for the |
Sure, I can add config files for a few distros. Unfortunately https://github.com/oracle/kconfigs does not have KConfig files for RISC-V systems. Is there a better approach than pulling the config from |
I've added OpenSUSE to the I've added a |
This PR adds support for RISC-V. Fixes #56.
generate defconfig
The provided kernel config files were generated using the RISC-V toolchain (gcc):
git checkout v6.9 PATH="/home/user/Desktop/riscv/bin:$PATH" ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- make defconfig mv .config ../kernel-hardening-checker/kernel_hardening_checker/config_files/defconfigs/riscv_defconfig_6.9.config
(I can also provide configs built with
musl
if that would be of any use.)detect_arch_by_kconfig()
Kernel configs for both 32-bit and 64-bit RISC-V systems use
CONFIG_RISCV_*
.detect_arch_by_kconfig()
uses"RISCV"
for architecture detection, ignoring bit-width.detect_arch_by_sysctl()
I examined multiple Linux RISC-V systems, many of which did not populate the
kernel.arch
sysctl.detect_arch_by_sysctl()
usesriscv32
andriscv64
for 32-bit and 64-bit respectively.uname -m
provides the same values. Perhaps a newdetect_arch_by_uname()
function should be added as a fallback.Example Output
Example output on
debian-20240128-convert_riscv64-virt
in Qemu:Output: