Posts
4983
Following
329
Followers
494
Linux kernel hacker and maintainer etc.

OpenPGP: 3AB05486C7752FE1

Jarkko Sakkinen

Edited 4 months ago
awesome, almost ready to ship :-)

this came out pretty nice and clean

❯ git ls-files
.tokeignore
CHANGELOG.md
LICENSE
Makefile
README.md
down.c
down.h
iommu.c
iommu.h
log.c
log.h
lsiommu.1
main.c
main.h
meson.build
meson.options
strbuf.c
strbuf.h
util.h

#linux #iommu
2
1
1

Jarkko Sakkinen

❯ 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

1
0
1

Jarkko Sakkinen

I made lsiommu as I just wanted to get rid of the shitty combination of bash and python I had before:

~/work/staging/lsiommu master*
❯ build/lsiommu
IOMMU Group 0
	00:07.1 Class 060400: Vendor 8086 Device 9a25 [8086:9a25] (rev 01)
IOMMU Group 1
	00:07.0 Class 060400: Vendor 8086 Device 9a23 [8086:9a23] (rev 01)
IOMMU Group 2
	00:02.0 Class 030000: Vendor 8086 Device 9a49 [8086:9a49] (rev 01)
IOMMU Group 3
	00:00.0 Class 060000: Vendor 8086 Device 9a14 [8086:9a14] (rev 01)
IOMMU Group 4
	00:04.0 Class 118000: Vendor 8086 Device 9a03 [8086:9a03] (rev 01)
IOMMU Group 5
	00:0a.0 Class 118000: Vendor 8086 Device 9a0d [8086:9a0d] (rev 01)
IOMMU Group 6
	00:0d.0 Class 0c0330: Vendor 8086 Device 9a13 [8086:9a13] (rev 01)
	00:0d.2 Class 0c0340: Vendor 8086 Device 9a1b [8086:9a1b] (rev 01)
IOMMU Group 7
	00:0e.0 Class 010400: Vendor 8086 Device 9a0b [8086:9a0b] (rev 00)
IOMMU Group 8
	00:14.0 Class 0c0330: Vendor 8086 Device a0ed [8086:a0ed] (rev 20)
	00:14.2 Class 050000: Vendor 8086 Device a0ef [8086:a0ef] (rev 20)
IOMMU Group 9
	00:14.3 Class 028000: Vendor 8086 Device a0f0 [8086:a0f0] (rev 20)
IOMMU Group 10
	00:15.0 Class 0c8000: Vendor 8086 Device a0e8 [8086:a0e8] (rev 20)
IOMMU Group 11
	00:16.0 Class 078000: Vendor 8086 Device a0e0 [8086:a0e0] (rev 20)
IOMMU Group 12
	00:1d.0 Class 060400: Vendor 8086 Device a0b0 [8086:a0b0] (rev 20)
IOMMU Group 13
	00:1f.0 Class 060100: Vendor 8086 Device a082 [8086:a082] (rev 20)
	00:1f.3 Class 040100: Vendor 8086 Device a0c8 [8086:a0c8] (rev 20)
	00:1f.4 Class 0c0500: Vendor 8086 Device a0a3 [8086:a0a3] (rev 20)
	00:1f.5 Class 0c8000: Vendor 8086 Device a0a4 [8086:a0a4] (rev 20)
IOMMU Group 14
	55:00.0 Class 010802: Vendor 144d Device a808 [144d:a808] (rev 00)

Perhaps the most interesting implementation note is that it uses libudev for PCI discovery, instead of traversing sysfs (because the latter sucks).

Right and I made my own shitty teardown manager framwork:

/* SPDX-License-Identifier: GPL-3.0-or-later */
/*
 * Copyright(c) Opinsys Oy 2025
 */

#ifndef TEARDOWN_H
#define TEARDOWN_H

#include <libudev.h>

#define teardown(func) __attribute__((cleanup(func)))

void teardown_udev(struct udev **udev);
void teardown_udev_device(struct udev_device **dev);
void teardown_udev_enumerate(struct udev_enumerate **enumerate);

#endif /* TEARDOWN_H */

Dependencies:

❯ ldd build/lsiommu 
	linux-vdso.so.1 (0x00007f083ccd5000)
	libargtable2.so.0 => /lib/x86_64-linux-gnu/libargtable2.so.0 (0x00007f083cc8a000)
	libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f083cc5c000)
	libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f083cb8c000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f083c9ab000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f083ccd7000)
	libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f083c99f000)
	libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f083c856000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f083c827000)
	libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f083c76b000)
	liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f083c745000)
	libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f083c71d000)

I can throw this to some Git repository if anyone is interested any of this. It’s really just “by me for me”, but I neither mind sharing it.

#linux #kernel #iommu

2
2
2

Jarkko Sakkinen

consolidated my linux pr process to a a repo, so that i can improve it over time :-) i tried printf first to generate substitutions for the mustache based email template but jq is needed here just purely for escaping the summary generated by git request-pull.

https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-pull-request.git/tree/?h=main

0
0
0

Jarkko Sakkinen

Sometimes it would be useful if you could have multiple Git repositories in the same clone as long as they don't share files. E..g, for separating private data.

#git
3
0
0

Jarkko Sakkinen

There is an alternative for Rocksmith, which also plays its '.RS files: https://tonelib.net/jam-overview.html

This not only fixes the issue macOS but there is also a native Linux version. Further, it happened to be 60% discount :-)
0
0
0

Jarkko Sakkinen

Cool, my PR for rust-hex was merged:

https://github.com/KokaKiwi/rust-hex/pull/83

It adds decode_in_slice() function, which decodes the hex string within the input buffer overwriting the contents. It is with ugly but still useful for e.g., fast and constrained protocol implementations.

Just came as surprise because the PR was made almost two years ago...

#rust #rustlang
1
0
6

Jarkko Sakkinen

I enjoyed responding this:

https://lore.kernel.org/linux-integrity/aGffUrDSjNH6w6rB@kernel.org/

Enjoyment did come like e.g, for "winning the argument". Instead it s fun to do this type of comparisons for the cause and effect of choices to the resulting binary :-) I did honestly did not know the correct answer beforehand.

Reviewing random day-by day patches can be boring. If I have some extra bandwidth this how I usually spice it up just a bit.

#linux #kernel #arm
0
0
1

Jarkko Sakkinen

The fact that the issue is so trivial makes me doubtful of myself in this one:

https://github.com/himmelblau-idm/himmelblau/pull/592

#systemd #himmelblau
0
0
0

Jarkko Sakkinen

Himmelblau is the "new Samba" really, but how fast the situation needs to be addressed is on the other hand more like in the metrics of "EFI secure boot", which was an edge case 10+ years ago.

https://www.youtube.com/watch?v=gHnG8KZpYg4

Intune is a technology where open source community needs to be clear on that "no, microsoft, edge + a shitty daemon running on a subset of linux distributions is not acceptable".

#microsoft #intune #himmelblau #samba
0
0
1

Jarkko Sakkinen

experienced this today on a machine running debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1078608

fixed up by:
sudo rm -rv /var/lib/apt/lists/*

#debian
0
1
0

Jarkko Sakkinen

Linux Foundation should take Himmeblau under its Umbrella.

As of today, the project is based on reverse engineering Apple and Windows clients, as the Intune API for Linux that Edge uses in tandem with intune-portal service does not have machine authentication.

"Microsoft Intune App" is based on chain of Microsoft binaries scavenging requested data from a system (Edge and intune-portal).

This blocks essentially the management tools for organization Linux machines by large.

Himmelblau on the other hand is a piece of middleware that manages the computer through the power cycle system-wide for the whole system, and thus can provide both boot-time initialization (himmelblaud) and reoccuring updates needed to maintain the trust (himmelblaud-tasks), such as Kerberos ticket and that kind of stuff.
0
0
0

Jarkko Sakkinen

Edited 4 months ago
a checkpatch error that provides an insecure URL as guidance lol:

WARNING: unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html

Tried to fix it but also https is broken. It's also quite common mistake, meaning that it pushes insecure in volumes to developers.

#linux #kernel
1
0
0

Jarkko Sakkinen

finnish electro classic from 25-26'ish years ago: https://www.youtube.com/watch?v=xZpZWm5GRXo

i.e. when the electroclash boom was ongoing with lots of stuff coming from i-f, parallax corporation, miss kittin and the hacker, dmx krew and others. stuff like that was playing a lot at venues. good times :-)
0
0
0

Jarkko Sakkinen

Edited 5 months ago

for what it is worth this is how you “lsusb” in macOS:

$ ioreg -p IOUSB
+-o Root  <class IORegistryEntry, id 0x100000100, retain 36>
  +-o AppleT8112USBXHCI@01000000  <class AppleT8112USBXHCI, id 0x100000371, reg$
  | +-o Magic Keyboard@01100000  <class IOUSBHostDevice, id 0x100000d5a, regist$
  +-o AppleT8112USBXHCI@03000000  <class AppleT8112USBXHCI, id 0x1000003bb, reg$
  +-o AppleT8112USBXHCI@00000000  <class AppleT8112USBXHCI, id 0x1000003ca, reg$
  | +-o 4-Port USB 2.0 Hub@00100000  <class IOUSBHostDevice, id 0x100000a0e, re$
  | | +-o USB2.0 Hub             @00140000  <class IOUSBHostDevice, id 0x100000$
  | | +-o Rocksmith USB Guitar Adapter@00110000  <class IOUSBHostDevice, id 0x1$
  | +-o 4-Port USB 3.0 Hub@00200000  <class IOUSBHostDevice, id 0x100000a10, re$
  |   +-o RTL9210B-CG@00220000  <class IOUSBHostDevice, id 0x100000a43, registe$
  |   +-o USB3.0 Hub             @00240000  <class IOUSBHostDevice, id 0x100000$
  |     +-o USB3.0 Card Reader@00243000  <class IOUSBHostDevice, id 0x100000a71$
  +-o AppleT8112USBXHCI@02000000  <class AppleT8112USBXHCI, id 0x10000036e, reg$
  | +-o Scarlett 4i4 USB@02100000  <class IOUSBHostDevice, id 0x100000a56, regi$
  +-o AppleEmbeddedUSBXHCIASMedia3142@08000000  <class AppleEmbeddedUSBXHCIASMe$
    +-o USB Receiver@08300000  <class IOUSBHostDevice, id 0x100000a2f, register$
    +-o YubiKey FIDO+CCID@08400000  <class IOUSBHostDevice, id 0x100000a37, reg$

ioreg is a wrapper utility for doing queries from https://developer.apple.com/documentation/iokit

just learned this and now i’ll probably remember it too after writing this ;-)

1
0
4

Jarkko Sakkinen

submitted fish version of the mc-wrapper:

https://github.com/MidnightCommander/mc/pull/4726

i'm actually using zsh (and no immediate plans to switch), but i just wanted to see how fish feels like so did a little bit of scripting ...

#fish #shell #mc
0
0
0

Jarkko Sakkinen

Really have been satisfied on moving to Fastmail for personal, kernel.org account etc. It scales the best from iPhone to mutt with no glitches.

#fastmail
0
0
1

Jarkko Sakkinen

cleanup.h is almost like Symbian cleanup stack (ugh)

#linux #kernel #symbian
1
2
1

Jarkko Sakkinen

Just learned how to update OVMF_VARS.fd offline before running QEMU:

 virt-fw-vars \
    --input "$OUTPUT/OVMF_VARS.fd" \
    --output "$OUTPUT/OVMF_VARS.fd" \
    --append-boot-filepath /EFI/debian/grubx64.efi

E.g., in Debian the package containing virt-fw-vars is python3-virt-firmware but it is also available from PIP: https://pypi.org/project/virt-firmware/

#qemu #ovmf

0
1
0
Show older