[Boot] add amd cluster id patches

This commit is contained in:
Antoine Viallon 2023-04-13 21:00:46 +02:00
parent b5e030c852
commit ac42f2fa18
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -22,6 +22,16 @@ let
ENERGY_MODEL y
'';
};
amdClusterId = {
name = "cluster-id-amd";
patch = pkgs.fetchpatch {
url = "https://lkml.org/lkml/diff/2023/4/10/479/1";
hash = "sha256-bpe+iWYQldlGiIlWr4XPbIBPQBetEjfRKZ0Te2I14dk=";
};
extraConfig = ''
SCHED_CLUSTER y
'';
};
optimizeForCPUArch = arch: let
archConfigMap = {
"k8" = "K8"; "opteron" = "K8"; "athlon64" = "K8"; "athlon-fx" = "K8";
@ -104,6 +114,7 @@ in {
kvdo.enable = mkEnableOption "dm-kvdo kernel module";
rtGroupSched.enable = mkEnableOption "RT cgroups";
energyModel.enable = mkEnableOption "Energy Model";
amdClusterId.enable = mkEnableOption "Energy Model";
efi = mkOption rec {
description = "Use EFI bootloader";
@ -186,9 +197,11 @@ in {
++ optional cfg.x32abi.enable customKernelPatches.enableX32ABI
++ optional cfg.rtGroupSched.enable customKernelPatches.enableRTGroupSched
++ optional cfg.energyModel.enable customKernelPatches.enableEnergyModel
++ optional cfg.amdClusterId.enable customKernelPatches.amdClusterId
++ optional (isXanmod cfg.kernel && config.aviallon.optimizations.enable) (customKernelPatches.optimizeForCPUArch config.aviallon.general.cpuArch)
;
loader.grub.enable = cfg.useGrub;
loader.grub = {
version = 2;