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

A few improvements for riscv #5662

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AlexGhiti
Copy link

This reenables KASAN_INLINE and sets 4-level page table by default: note that we can use a kernel command line parameter instead if you prefer ("no5lvl").

Alexandre Ghiti added 2 commits January 9, 2025 13:33
KASAN_INLINE was fixed back in early 2023 in the riscv kernel, see
merge commit 2667e3673f70 ("Merge patch series "RISC-V kasan rework").
Riscv is far from having a hw with a 5-level support, so let's focus on the
4-level.
Copy link

google-cla bot commented Jan 9, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@a-nogikh
Copy link
Collaborator

a-nogikh commented Jan 9, 2025

Thanks!

For the dashboard/config/linux/bits: reenable KASAN_INLINE for riscv64 commit, you also need to regenerate the configs:

To update kernel configs:
- change config fragments as necessary (e.g. add additional configs to [subsystems.yml](bits/subsystems.yml) along
with minimal kernel version)
- run `syz-env make configs SOURCEDIR=/path/to/existing/linux/checkout`
(note: it will be mrproper-ed and a number of remotes will be added)
(see [this](/docs/contributing.md#using-syz-env) on how to setup/use `syz-env`)
- check in config fragments and changed kernel configs and send a PR
- changes will be deployed to `syzbot` within a day after merging

I.e. run ./tools/syz-env make configs SOURCEDIR=/path/to/linux/checkout and commit the changes.

And regarding vm/qemu: Run riscv64 kernel using 4-level page table: CI checks complain about the capitalization of Run, it should have been titled vm/qemu: run riscv64 kernel using 4-level page table.

@AlexGhiti
Copy link
Author

Arf, sorry about the "Run"...

Since I'm here, I noticed riscv is excluded from a few configs in files like dashboard/config/linux/bits/subsystems.yml although we implement them and they appear in the final generated config. Is there something to do here? Not sure I understood the goal of those.

Thanks for your quick answer!

@a-nogikh
Copy link
Collaborator

a-nogikh commented Jan 9, 2025

I noticed riscv is excluded from a few configs in files like dashboard/config/linux/bits/subsystems.yml although we implement them and they appear in the final generated config. Is there something to do here? Not sure I understood the goal of those.

Overall, we try to reduce the number of enabled configs for the platforms that we run in emulation (like riscv) - the execution is very slow and we'd rather focus it on the parts more relevant to the specific platform rather than on the generic code that's already well tested elsewhere. E.g. see the reduced bit usage here:

https://github.com/google/syzkaller/blob/7cc17001e974d9ff7d7ce042c4e2ad2e8ec0e55e/dashboard/config/linux/main.yml#L24C88-L24C95

Specifically in dashboard/config/linux/bits/subsystems.yml, I guess that the reasons were one of:

  • The intent similar to what I described above (we just did not use the -reduced condition instead, but should have done so).
  • We cannot fuzz the feature yet (no descriptions/not supported by the emulator).
  • The kernel was failing to build/boot with these enabled (though for these we usually leave an explicit comment).

If you believe that we'd better still fuzz some of them on the riscv syzbot instance, feel free to send a PR to switch them on or just let us know :)

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