lsiommu provides now also json output:
❯ build/lsiommu | head -10
Group 000 Address 0000:00:07.1 Class 060400 ID 8086:9a25 Revision 01
Group 001 Address 0000:00:07.0 Class 060400 ID 8086:9a23 Revision 01
Group 002 Address 0000:00:02.0 Class 030000 ID 8086:9a49 Revision 01
Group 003 Address 0000:00:00.0 Class 060000 ID 8086:9a14 Revision 01
Group 004 Address 0000:00:04.0 Class 118000 ID 8086:9a03 Revision 01
Group 005 Address 0000:00:0a.0 Class 118000 ID 8086:9a0d Revision 01
Group 006 Address 0000:00:0d.0 Class 0c0330 ID 8086:9a13 Revision 01
Group 006 Address 0000:00:0d.2 Class 0c0340 ID 8086:9a1b Revision 01
Group 007 Address 0000:00:0e.0 Class 010400 ID 8086:9a0b Revision 00
Group 008 Address 0000:00:14.0 Class 0c0330 ID 8086:a0ed Revision 20
~/work/github.com/puavo-org/lsiommu master
❯ build/lsiommu --style json | head -10
{
"iommu_groups": [{
"id": 0,
"devices": [{
"address": "0000:00:07.1",
"class": "060400",
"vendor": "8086",
"device": "9a25",
"revision": "01"
}]
better not to tag 1.0.0 yet to leave room for command-line interface and output formatting tweaks although now it is “feature complete”.
first valgrind pass i tried also looked pretty decent:
==425020==
==425020== HEAP SUMMARY:
==425020== in use at exit: 0 bytes in 0 blocks
==425020== total heap usage: 2,143 allocs, 2,143 frees, 786,679 bytes allocated
==425020==
==425020== All heap blocks were freed -- no leaks are possible
==425020==
==425020== For lists of detected and suppressed errors, rerun with: -s
==425020== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
was a bit surprise tho :-)
❯ wc -l *.c *.h
317 iommu.c
31 log.c
70 main.c
32 teardown.c
26 iommu.h
16 log.h
11 main.h
20 teardown.h
523 total
Not too bad considering that iommu.c has a heap tree and radix sort implementation (I dislike qsort for anything really)
RE: https://social.kernel.org/objects/96e13d6c-6be2-4180-9bbc-f4e3fbd6a38b