I think I found it, L2 was simply never assigned if missing, and this would basically never trigger except for ARM cpus without L2, or BSDs that did not get L2 detected.
With latest patch this 'should' be working, it was basically an assumption based on the fact that essentially all intel/amd type cpus report their their L2 in /proc/cpuinfo, so this tiny assumption had remained hidden for all these years. I don't see anywhere where L3 was assigned to L2 however, so I think that's maybe not related. Basically for most cpus on linux, L2 i s always available, and usually but not always, L1 and L3 only came from dmidecode, with the exception of Elbrus cpus, which provide all three variants, actually more, since they have several L1 types.
There was a further bsd only condition that triggered because the more advanced logic used for linux can't work without all the required data, so i t had a simpler default, which resulted in for stuff that didn't have L1/2/3 cache data in dmesg.boot or sysctl output, it would never show the data, and I never found this because testing in vm's doesn't give much dmi data, if any.
With latest patch this 'should' be working, it was basically an assumption based on the fact that essentially all intel/amd type cpus report their their L2 in /proc/cpuinfo, so this tiny assumption had remained hidden for all these years. I don't see anywhere where L3 was assigned to L2 however, so I think that's maybe not related. Basically for most cpus on linux, L2 i s always available, and usually but not always, L1 and L3 only came from dmidecode, with the exception of Elbrus cpus, which provide all three variants, actually more, since they have several L1 types.
There was a further bsd only condition that triggered because the more advanced logic used for linux can't work without all the required data, so i t had a simpler default, which resulted in for stuff that didn't have L1/2/3 cache data in dmesg.boot or sysctl output, it would never show the data, and I never found this because testing in vm's doesn't give much dmi data, if any.