Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a draft proposal. Discussion on module integration to Ghaf can be found here and should be taken into consideration when evaluating this PR.
Overview
Integrate bpmp virtualization into Ghaf. This integration includes kernel patches, kernel overlays and kernel configurations as well as device tree configurations.
In Ghaf the kernel and device tree are configured in the hardware module. More precisely the hardware device tree is set here (line42). Kernel patches and configurations are set in the same file (lines19-38).
The device tree is hashed and copied to /dtbs/ in the boot configuration.
Kernel overlay example
An example to use as a template for configuring and building the kernel can be found here.
The example defines an overlay which applies a kernel patch as well as kernel configuration (as a nix expression) on top of the requested kernel package (line 10) in nixpkgs (note that instead if linuxPackages_latest we would use the appropriate kernel for example linuxPackages_5_10).
memshare_6.2.patch is the Linux kernel patch we want to apply.
memsharevm-kernel.nix defines kernel configurations and includes the patch.
overlay_config.nix defines the above as an overlay over a specific kernel version.
default.nix extends the kernel with the memsharevm-kernel overlay as a part of its build process (consumer).
The overlay can be applied to a kernel build as demonstrated in this default.nix.
boot.kernelPackages =
pkgs.linuxPackages_latest.extend (_: _: {
kernel = pkgs.memsharevm-kernel;
});
Repository: https://github.com/jpruiz84/bpmp-virt
Template: https://github.com/jkuro-tii/ghaf/tree/main/microvmConfigurations/memshare