From 78beead335f364bb3721642964ee49cf9a622c4b Mon Sep 17 00:00:00 2001 From: Francisco Javier Honduvilla Coto Date: Mon, 29 Apr 2024 11:42:20 +0100 Subject: [PATCH] Remediation for verifier regression in kernels ~6.8 and greater Some days ago we put a fix for arm64 kernels as a verifier regression was introduced causing loading errors [commit](https://github.com/javierhonduco/lightswitch/commit/a8094d18d0e8a662d3581380934cd185eb30bf45). Turns out this is not just affecting arm64, as it just happened it's that my arm64 VM was running a more up to date kernel. This regression affects x86 as well. This commit changes the remediation to unrolloing the binary search loop and adds a kernel regression test. I haven't measured the performance implication of doing this vs the previous remediation. This is out of the scope of this PR and it's something I will work on later on. When I have spare cycles I should report this upstream. The error ========= ``` 292: (bf) r6 = r3 ; R3_w=scalar(id=52209,smin=umin=smin32=umin32=2,smax=umax=smax32=umax32=0x1869e,var_off=(0x0; 0x1ffff)) R6_w=scalar(id=52209,smin=umin=smin32=umin32=2,smax=umax=smax32=umax32=0x1869e,var_off=(0x0; 0x1ffff)) 293: (bf) r3 = r2 ; R2_w=scalar(id=52208,smin=umin=smin32=umin32=1,smax=umax=smax32=umax32=0x1869d,var_off=(0x0; 0x1ffff)) R3_w=scalar(id=52208,smin=umin=smin32=umin32=1,smax=umax=smax32=umax32=0x1869d,var_off=(0x0; 0x1ffff)) 294: (2d) if r4 > r8 goto pc+1 296: R0_w=scalar() R1=11 R2_w=scalar(id=52208,smin=umin=smin32=umin32=1,smax=umax=smax32=umax32=0x1869d,var_off=(0x0; 0x1ffff)) R3_w=scalar(id=52208,smin=umin=smin32=umin32=1,smax=umax=smax32=umax32=0x1869d,var_off=(0x0; 0x1ffff)) R4_w=scalar(umin=9,umax=0xfffffffffffffffa) R5_w=scalar() R6_w=scalar(id=52209,smin=umin=smin32=umin32=2,smax=umax=smax32=umax32=0x1869e,var_off=(0x0; 0x1ffff)) R7=scalar(id=52027,smin=umin=smin32=umin32=2,smax=umax=smax32=umax32=0x1869e,var_off=(0x0; 0x1ffff)) R8=scalar(id=24520,umin=8,umax=0xfffffffffffffff9) R9_w=scalar(smin=smin32=0,smax=umax=smax32=umax32=0xff0000,var_off=(0x0; 0xff0000)) R10=fp0 fp-16=mmmmmmmm fp-24=mmmmmmmm fp-32=mmmmmmmm fp-40=mmmmmmmm fp-48=map_value(map=unwind_tables,ks=8,vs=1400000) fp-56=6 fp-64=scalar(id=52027,smin=umin=smin32=umin32=2,smax=umax=smax32=umax32=0x1869e,var_off=(0x0; 0x1ffff)) fp-72=map_value(map=heap,ks=4,vs=1080) fp-80=map_value(map=heap,ks=4,vs=1080) fp-88=map_value(map=exec_mappings,ks=16,vs=32) fp-96=mmmmmmmm fp-104=ctx() fp-112=mmmmmmmm fp-120=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff)) fp-128=scalar(smin=smin32=0,smax=umax=smax32=umax32=255,var_off=(0x0; 0xff)) fp-136=scalar(smin=smin32=0,smax=umax=smax32=umax32=255,var_off=(0x0; 0xff)) ; if (table->rows[mid].pc <= pc) { 296: (2d) if r4 > r8 goto pc-83 214: R0_w=scalar() R1=11 R2_w=scalar(id=52208,smin=umin=smin32=umin32=1,smax=umax=smax32=umax32=0x1869d,var_off=(0x0; 0x1ffff)) R3_w=scalar(id=52208,smin=umin=smin32=umin32=1,smax=umax=smax32=umax32=0x1869d,var_off=(0x0; 0x1ffff)) R4_w=scalar(umin=9,umax=0xfffffffffffffffa) R5_w=scalar() R6_w=scalar(id=52209,smin=umin=smin32=umin32=2,smax=umax=smax32=umax32=0x1869e,var_off=(0x0; 0x1ffff)) R7=scalar(id=52027,smin=umin=smin32=umin32=2,smax=umax=smax32=umax32=0x1869e,var_off=(0x0; 0x1ffff)) R8=scalar(id=24520,umin=8,umax=0xfffffffffffffff9) R9_w=scalar(smin=smin32=0,smax=umax=smax32=umax32=0xff0000,var_off=(0x0; 0xff0000)) R10=fp0 fp-16=mmmmmmmm fp-24=mmmmmmmm fp-32=mmmmmmmm fp-40=mmmmmmmm fp-48=map_value(map=unwind_tables,ks=8,vs=1400000) fp-56=6 fp-64=scalar(id=52027,smin=umin=smin32=umin32=2,smax=umax=smax32=umax32=0x1869e,var_off=(0x0; 0x1ffff)) fp-72=map_value(map=heap,ks=4,vs=1080) fp-80=map_value(map=heap,ks=4,vs=1080) fp-88=map_value(map=exec_mappings,ks=16,vs=32) fp-96=mmmmmmmm fp-104=ctx() fp-112=mmmmmmmm fp-120=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff)) fp-128=scalar(smin=smin32=0,smax=umax=smax32=umax32=255,var_off=(0x0; 0xff)) fp-136=scalar(smin=smin32=0,smax=umax=smax32=umax32=255,var_off=(0x0; 0xff)) ; LOG("========== left %llu right %llu (shard index %d)", left, right, 214: (18) r9 = 0xbadfadbadfadbad ; R9_w=0xbadfadbadfadbad ; for (int i = 0; i < MAX_BINARY_SEARCH_DEPTH; i++) { 216: (07) r1 += -1 ; R1_w=10 217: (bf) r2 = r1 ; R1_w=10 R2_w=10 218: (67) r2 <<= 32 BPF program is too large. Processed 1000001 insn processed 1000001 insns (limit 1000000) max_states_per_insn 29 total_states 18306 peak_states 2761 mark_read 106 -- END PROG LOAD LOG -- libbpf: prog 'dwarf_unwind': failed to load: -7 libbpf: failed to load object 'profiler_bpf' libbpf: failed to load BPF skeleton 'profiler_bpf': -7 thread 'main' panicked at src/profiler.rs:159:36: load skel: Error: Argument list too long (os error 7) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Test Plan ========= Added a regression test. --- flake.nix | 2 ++ profile.json | 1 + src/bpf/profiler.bpf.c | 26 ++++++++------------------ vm.nix | 26 ++++++++++++++++++++++++++ vmtest.toml | 10 ++++++++++ 5 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 profile.json diff --git a/flake.nix b/flake.nix index 5cff985..62c8764 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,8 @@ (import ./vm.nix { inherit pkgs; }).kernel_6_0 (import ./vm.nix { inherit pkgs; }).kernel_6_2 (import ./vm.nix { inherit pkgs; }).kernel_6_6 + (import ./vm.nix { inherit pkgs; }).kernel_6_8_7 + (import ./vm.nix { inherit pkgs; }).kernel_6_9_rc5 ]; LIBCLANG_PATH = lib.makeLibraryPath [ llvmPackages_16.libclang ]; diff --git a/profile.json b/profile.json new file mode 100644 index 0000000..dff6d21 --- /dev/null +++ b/profile.json @@ -0,0 +1 @@ +{"meta":{"categories":[{"name":"Other","color":"grey","subcategories":["Other"]},{"name":"User","color":"yellow","subcategories":["Other"]},{"name":"Kernel","color":"orange","subcategories":["Other"]}],"debug":false,"extensions":{"baseURL":[],"id":[],"length":0,"name":[]},"interval":1.0,"preprocessedProfileVersion":44,"processType":0,"product":"target/release/lightswitch","sampleUnits":{"eventDelay":"ms","threadCPUDelta":"µs","time":"ms"},"startTime":1714313802605.5928,"symbolicated":false,"pausedRanges":[],"version":24,"usesOnlyOneStackType":true,"doesNotUseFrameImplementation":true,"sourceCodeIsNotOnSearchfox":true,"markerSchema":[]},"libs":[{"name":"ld-linux-x86-64.so.2","path":"/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5/lib/ld-linux-x86-64.so.2","debugName":"ld-linux-x86-64.so.2","debugPath":"/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5/lib/ld-linux-x86-64.so.2","breakpadId":"A844C365245AB69FD15C9CC7379E3C9F0","codeId":"65c344a85a249fb6d15c9cc7379e3c9f97cf6d86","arch":null},{"name":"lightswitch","path":"/home/javierhonduco/code/lightswitch/target/release/lightswitch","debugName":"lightswitch","debugPath":"/home/javierhonduco/code/lightswitch/target/release/lightswitch","breakpadId":"DBAB09F79A2C3D8BDE17B6C0C52EDA170","codeId":null,"arch":null},{"name":"libc.so.6","path":"/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5/lib/libc.so.6","debugName":"libc.so.6","debugPath":"/nix/store/ddwyrxif62r8n6xclvskjyy6szdhvj60-glibc-2.39-5/lib/libc.so.6","breakpadId":"538D4C22C4CEAFF2E0C167F14DC41E080","codeId":"224c8d53cec4f2afe0c167f14dc41e087c39dfba","arch":null}],"threads":[{"frameTable":{"length":79,"address":[112599,117133,111090,123107,41639,39136,37814,143733,-1,293716,172488,172301,358972,2297989,496027,451765,340089,706250,701845,583183,583177,581583,571999,701895,625495,623798,650051,1090831,583665,581549,571972,581517,581767,701627,570625,570435,701747,702250,438817,445084,489730,1769572,277388,1846876,1769173,1428743,702361,739983,739903,1429220,703747,703219,574143,702865,570019,572179,569466,571456,568260,703058,703204,706816,568849,570404,577433,743597,1428544,703004,573290,574075,567478,706918,703690,572583,574132,573302,577529,1428992,743608],"inlineDepth":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"category":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"subcategory":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"func":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78],"nativeSymbol":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"innerWindowID":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"implementation":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"line":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"column":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"optimizations":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]},"funcTable":{"length":79,"name":[1,2,3,4,5,6,7,8,9,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81],"isJS":[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false],"relevantForJS":[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false],"resource":[0,0,0,0,0,0,0,0,-1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1],"fileName":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"lineNumber":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"columnNumber":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]},"markers":{"length":0,"category":[],"data":[],"endTime":[],"name":[],"phase":[],"startTime":[]},"name":"GeckoMain","nativeSymbols":{"length":0,"address":[],"functionSize":[],"libIndex":[],"name":[]},"pausedRanges":[],"pid":143903,"processName":"<143903>","processShutdownTime":64828183.336373,"processStartupTime":0.0,"processType":"default","registerTime":0.0,"resourceTable":{"length":3,"lib":[0,1,2],"name":[0,10,12],"host":[null,null,null],"type":[1,1,1]},"samples":{"length":32,"stack":[7,19,22,27,28,30,31,32,34,35,36,45,47,49,50,52,56,59,60,62,64,67,50,70,71,72,73,74,75,76,78,79],"time":[64828046.218753,64828047.191054,64828047.300967,64828047.410843,64828047.629624,64828048.068177,64828048.70178,64828049.468194,64828050.311874,64828051.203306,64828052.126729,64828053.071298,64828054.026246,64828054.992571,64828055.968559,64828056.950703,64828057.938158,64828058.928889,64828059.921643,64828060.916727,64828061.913004,64828062.910399,64828063.909581,64828064.908529,64828065.908449,64828066.908148,64828067.907309,64828068.906673,64828069.905493,64828070.905817,64828071.905482,64828072.906191],"weight":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"weightType":"samples","threadCPUDelta":[0,972,109,109,218,438,633,766,843,891,923,944,954,966,975,982,987,990,992,995,996,997,999,998,999,999,999,999,998,1000,999,1000]},"stackTable":{"length":80,"prefix":[null,0,1,2,3,4,5,6,null,8,9,10,11,12,13,14,15,16,17,18,18,20,21,17,23,24,25,26,18,20,29,20,20,17,33,33,17,17,37,38,39,40,41,42,43,44,17,46,46,48,17,17,51,17,53,54,55,53,57,58,17,17,61,53,63,51,65,66,17,68,69,58,61,17,55,51,68,51,77,65],"frame":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,21,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78],"category":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"subcategory":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"stringArray":["ld-linux-x86-64.so.2","0x1b7d7","0x1c98d","0x1b1f2","0x1e0e3","0xa2a7","0x98e0","0x93b6","0x23175","0x7ffff956ce57","lightswitch","0x47b54","libc.so.6","0x2a1c8","0x2a10d","0x57a3c","0x231085","0x7919b","0x6e4b5","0x53079","0xac6ca","0xab595","0x8e60f","0x8e609","0x8dfcf","0x8ba5f","0xab5c7","0x98b57","0x984b6","0x9eb43","0x10a50f","0x8e7f1","0x8dfad","0x8ba44","0x8df8d","0x8e087","0xab4bb","0x8b501","0x8b443","0xab533","0xab72a","0x6b221","0x6ca9c","0x77902","0x1b0064","0x43b8c","0x1c2e5c","0x1afed5","0x15cd07","0xab799","0xb4a8f","0xb4a3f","0x15cee4","0xabd03","0xabaf3","0x8c2bf","0xab991","0x8b2a3","0x8bb13","0x8b07a","0x8b840","0x8abc4","0xaba52","0xabae4","0xac900","0x8ae11","0x8b424","0x8cf99","0xb58ad","0x15cc40","0xaba1c","0x8bf6a","0x8c27b","0x8a8b6","0xac966","0xabcca","0x8bca7","0x8c2b4","0x8bf76","0x8cff9","0x15ce00","0xb58b8"],"tid":143903,"unregisterTime":64828183.336373}],"pages":[],"profilerOverhead":[],"counters":[]} \ No newline at end of file diff --git a/src/bpf/profiler.bpf.c b/src/bpf/profiler.bpf.c index b570f67..3d08111 100644 --- a/src/bpf/profiler.bpf.c +++ b/src/bpf/profiler.bpf.c @@ -71,29 +71,19 @@ struct { } rate_limits SEC(".maps"); -// On arm64 running 6.8.4-200.fc39.aarch64 the verifier fails with argument list too long. This -// did not use to happen before and it's probably due to a regression in the way the verifier -// accounts for the explored paths. I have tried many other things, such as two mid variables -// but that did not do it. The theory of why this works is that perhaps it's making the verifier -// reset the state it had about the program exploration so the branches its exploring per iteration -// do not grow as much. -#ifdef __TARGET_ARCH_arm64 -static u32 __attribute__((optnone)) verifier_workaround(u32 value) { - return value; -} -#endif -#ifdef __TARGET_ARCH_x86 -static __always_inline u32 verifier_workaround(u32 value) { - return value; -} -#endif - // Binary search the unwind table to find the row index containing the unwind // information for a given program counter (pc) relative to the object file. static __always_inline u64 find_offset_for_pc(stack_unwind_table_t *table, u64 pc, u64 left, u64 right) { u64 found = BINARY_SEARCH_DEFAULT; + + // On kernels ~6.8 and greater the verifier fails with argument list too long. This did not use to + // happen before and it's probably due to a regression in the way the verifier accounts for the explored + // paths. I have tried many other things, such as two mid variables but that did not do it. + // Perhaps unrolling the loop works is that the verifier doesn't have as many states to explore + // per iteration. + #pragma unroll for (int i = 0; i < MAX_BINARY_SEARCH_DEPTH; i++) { // TODO(javierhonduco): ensure that this condition is right as we use // unsigned values... @@ -102,7 +92,7 @@ static __always_inline u64 find_offset_for_pc(stack_unwind_table_t *table, u64 p return found; } - u32 mid = verifier_workaround((left + right) / 2); + u32 mid = (left + right) / 2; // Appease the verifier. if (mid < 0 || mid >= MAX_UNWIND_TABLE_SIZE) { LOG("\t.should never happen, mid: %lu, max: %lu", mid, diff --git a/vm.nix b/vm.nix index 173f4b2..53b7d49 100644 --- a/vm.nix +++ b/vm.nix @@ -52,6 +52,32 @@ ''; }; + kernel_6_8_7 = pkgs.stdenv.mkDerivation { + name = "download-kernel-6.6"; + src = pkgs.fetchurl { + url = "https://github.com/javierhonduco/lightswitch-kernels/raw/c0af7a3/bzImage_v6.8.7"; + hash = "sha256-fZwGajRi9+otzokRxoss99aH9PLRuyl2UfJ5Echehdo="; + }; + dontUnpack = true; + installPhase = '' + mkdir -p $out + cp -r $src $out/bzImage + ''; + }; + + kernel_6_9_rc5 = pkgs.stdenv.mkDerivation { + name = "download-kernel-6.6"; + src = pkgs.fetchurl { + url = "https://github.com/javierhonduco/lightswitch-kernels/raw/c0af7a3/bzImage_v6.9-rc5"; + hash = "sha256-EA+nJ1M0/6QFPVA+fYkvXDhBcsmTnALpGr+tCJZsVyw="; + }; + dontUnpack = true; + installPhase = '' + mkdir -p $out + cp -r $src $out/bzImage + ''; + }; + vmtest = pkgs.rustPlatform.buildRustPackage { name = "vmtest"; src = pkgs.fetchFromGitHub { diff --git a/vmtest.toml b/vmtest.toml index 3a06893..b29b724 100644 --- a/vmtest.toml +++ b/vmtest.toml @@ -16,4 +16,14 @@ command = "/mnt/vmtest/target/debug/lightswitch --duration 0" [[target]] name = "Fedora 6.6" kernel = "/nix/store/77ixckavs2qidx1pglmlxsj6bfvjqijb-download-kernel-6.6/bzImage" +command = "/mnt/vmtest/target/debug/lightswitch --duration 0" + +[[target]] +name = "Upstream 6.8.7" +kernel = "/nix/store/almv3m0cmz80jhf0qi4616f3pb71287h-bzImage_v6.8.7" +command = "/mnt/vmtest/target/debug/lightswitch --duration 0" + +[[target]] +name = "Upstream v6.9-rc5" +kernel = "/nix/store/78jmg8v3z8dkfv49i3awm6vjvh094fbk-bzImage_v6.9-rc5" command = "/mnt/vmtest/target/debug/lightswitch --duration 0" \ No newline at end of file