openwrt icon indicating copy to clipboard operation
openwrt copied to clipboard

rockchip: Enable KVM in kernel 6.12

Open davidandreoletti opened this issue 8 months ago • 3 comments

Enable hypervisor with hardware virtualisation support on supported Rochchip devices.

As per OpenWRT's Hardware DB, OpenWRT supports the following rockchip SOCs RK3399/RK3328/RK3566/RK3568/RK3568B2/RK3588/RK3588S/RK3308B/RK3568(J).

All of them have the following properties:

  • all have SD card support => image size increase due to new kernel config changes is mitigated.
  • all have min 256Mb ram (with the large majority actually having 1G/4G RAM) => memory should not be a concern when not using KVM.

Note on performance:

  • On the only tested device (NanoPi R4s 4G), no notable performance regression observed.

Tested on: NanoPi R4S (4G ram) Kernel size change: untested for now (one other had 3.3% kernel size increase)

Related:

  • https://github.com/openwrt/packages/pull/26797

davidandreoletti avatar Jun 19 '25 03:06 davidandreoletti

@peterwillcn I pushed new changes. Would you mind approving them for automated review checks to kick-in, please ?

davidandreoletti avatar Jun 24 '25 07:06 davidandreoletti

@peterwillcn main does not support linux kernel 6.6 for rockchip. New changes pushed.

davidandreoletti avatar Jul 04 '25 03:07 davidandreoletti

@geldot Honestly, the best future is probably one where OpenWRT focuses on core routing functionality and hardware support, telling users to spin up a supported OS for server/containerization/media workloads, to the point where KVM is inevitable sooner or later for the health of the project. Hadn't considered this before, my bad. (https://github.com/openwrt/openwrt/pull/17495#issuecomment-2882770339)

Absolutely, this PR is working toward adding general KVM support for rockchip devices.

  • What's next to make this vision a reality ?
  • Any idea amongst https://openwrt.org/about#people to reach out to raise this issue ?

davidandreoletti avatar Jul 04 '25 03:07 davidandreoletti

The build fails with this error:

*
Kernel-based Virtual Machine (KVM) support (KVM) [Y/n/?] y
  Debug mode for non-VHE EL2 object (NVHE_EL2_DEBUG) [N/y/?] n
  Present the stage-2 pagetables to debugfs (PTDUMP_STAGE2_DEBUGFS) [N/y/?] (NEW) make[7]: *** [scripts/kconfig/Makefile:85: syncconfig] Error 1
make[6]: *** [Makefile:686: syncconfig] Error 2
make[5]: *** [/__w/openwrt/openwrt/openwrt/build_dir/target-aarch64-openwrt-linux-musl_musl/linux-rockchip_armv8/linux-6.12.48/Makefile:787: include/config/auto.conf.cmd] Error 2
make[4]: *** [Makefile:224: __sub-make] Error 2

hauke avatar Sep 23 '25 19:09 hauke

@hauke Thanks for reporting. The issue should be fixed now.

davidandreoletti avatar Sep 24 '25 12:09 davidandreoletti