#Managarm and related projects

1 messages · Page 7 of 1

fervent zodiac
#

very cool stuff

vestal sapphire
#

Ok can to work today ig

trim eagle
#

With the way I’m feeling atm, can join in. Systemd here we go?

native prairie
#

bruh

serene portal
#

state broken

#

sounds like managram alright

native prairie
#

state: assertos

serene portal
#

jk

trim eagle
#

Yikes

#

Literal AssertOS

trim eagle
#

Cancel that: the fucking train just broke down @nocturne tide @serene portal

#

@safe glen

serene portal
reef steeple
#

lol

trim eagle
#

Literally

native prairie
#

assertos train

trim eagle
#

They just announced shits fucked and the driver is checking what can be done

#

Worst case a different train has to push / pull us to Breda and we change there

lament grove
#

Train moment

carmine current
#

Lol

trim eagle
#

Come on just go we’re wasting valuable systemd porting time

nocturne tide
#

LMAO

reef steeple
#

just port in the train

#

need no internet

#

just the downloaded code

trim eagle
#

Last time this train died it took 5 FUCKING HOURS

#

Please send emergency 12 gauge shells to my forehead

#

We ballin we’re moving

nocturne tide
#

holy shit big

trim eagle
# reef steeple just port in the train

I did do some looking into MATE. Their file browser seems to want gvfs according to gentoo and that’s meh. Might skip that for now. No big issues identified so far

safe glen
#

holy shit French people man i swear

nocturne tide
#

real

#

blame the french

trim eagle
#

Real

#

(It’s a Dutch NS train)

nocturne tide
vestal sapphire
#

Probably stolen from Germany

trim eagle
#

ETA 20-25 minutes

lament grove
trim eagle
#

Based

lament grove
trim eagle
#

GEKOLONISEERD

wild stone
#

Why are so many people here dutch

lament grove
#

yes

vestal sapphire
#

okay I think the bragi stuff is mostly done

#

I have a few unhandled cases (that just get ignored) but I don't care enough to implement them

#
unhandled tail member uint8[] mask
unhandled type <class 'bragi.tokens.Struct'>
unhandled tag member Rect[] drm_clips
unhandled tail member uint32[] fds
unhandled tag member Rect[] drm_clips
unhandled type <class 'bragi.tokens.Struct'>
unhandled tail member Ifconf[] ifconf
unhandled tail member uint32[] values
vestal sapphire
wild stone
#

i wonder how hard it would be to make wireshark be able to intercept bragi comms inside of managarm

vestal sapphire
#

just expose it over a special socket or something

vestal sapphire
#

ok I think the only missing codegen feature for the wireshark dissector is handling structs

#

after I implement that ig I can PR in that stuff

trim eagle
#

Based

trim eagle
#

Mental note to self: make build environment that runs without containers or all that jazz and do the funny

carmine current
#

What?

trim eagle
#

I have a segfault during build (of course it’s gobject-introspection related) and that allegedly dumps core but in cbuildrt that’s not happening / not possible to exfiltrate. See if I can repro it without containerization and gdb that bitch

#

This would unblock gnome-calculator, gtk4 and friends

carmine current
#

You can probably just hack the build system to launch gdb inside cbuildrt

trim eagle
#

I haven’t found out why and this has been nagging me for literal months now

#

Fuck the fine grained approach I’m bringing the sledgehammer this time

#

Gobject-introspection will bow to me and do as I wish

carmine current
#

Doesn't it make sense to focus on systemd first? meme

trim eagle
#

Yes, it does, but maybe I can let the shit that I need build in the background

#

More specifically, I can let it build while I go to sleep tonight lol

#

Then debug tomorrow / later

vestal sapphire
#

I have a working bragi wireshark codegen on my bragi fork on the wireshark branch

#

@trim eagle if you want to take a look

#

the bootstrap PR with support for it is already up

#

I'll need to clean up my managarm and mlibc work

#

I have not added support for bragi struct yet tho

trim eagle
#

Nice work

vestal sapphire
#

ok, the bragi PR is ready for review

#

it seems to work fine for dissecting my dumps

#

next up, mlibc

#

ok, only managarm remaining now I hope

fervent zodiac
#

may i recommend adding helpers that make the code slightly less impossible to read though

carmine current
#

which code?

fervent zodiac
#

the bragi stuff

#

when working with any sort of code generation anything, its usually advisable to add a helper type which automatically prepends the indent and appends the newline every time you add stuff

vestal sapphire
#

fair point

vestal sapphire
#

ig I'll do functions like this

fervent zodiac
#

just use a builder class lol

#

that automatically prepends self.indent etc

vestal sapphire
#

I wonder if we could use virtio sockets to allow for more granular control over which ostrace events are emitted

#

or virtio-console ig

carmine current
#

How would a different transport help with that?

vestal sapphire
#

basically we could activate certain ostrace events depending on what virtio-sockets are available for instance

#

and discard the others

#

obv running ostrace selectively improves performance when booting with ostrace

#

btw, in the PR I made sure all the ostrace stuff is dumped lazily so there is no measurable runtime cost to the PR when booting without ostrace

carmine current
#

imo we should just have a way to filter out certain events

#

at the kernel command line maybe

fervent zodiac
#

do the config by injecting an ACPI table :^)

upbeat smelt
#

smbios table since qemu has an argument to do that :^)

#

although without a patch we apply (that we should upstream) it forgets to copy the null terminator meme

fervent zodiac
upbeat smelt
#

huh

#

makes sense ig

wind hamlet
#

what about real hardware

#

will y'all be able to listen to bragi over serial or something in real hardware?

vestal sapphire
#

I'm not quite decided on how to do that yet

#

I was considering just dumping it over UDP or serial but wiring that up is not entirely trivial

#

because microkernel meme

carmine current
#

i don't think dumping it over udp is particularly hard

vestal sapphire
#

I mean we'd need to have a way to have netserver advertise an ostrace thingy

#

I updated the bragi PR with improved codegen (readability)

carmine current
#

we could just put something like ostrace-udp=10.0.0.123 into the command line

#

and then have a userspace utility that reads the ring buffer and that dumps to netserver

nocturne tide
#

wouldn’t reading the ring buffer and sending it over network generate additional logs

vestal sapphire
#

yeah but we could exclude those meme

trim eagle
#

Journald dump kmsg moment

wind hamlet
#

cool

vestal sapphire
#

bruh

#

my thonkpad's UEFI impl requires TFTP extension support on the server??????????//

upbeat smelt
#

inb4 doesn't check what dhcp says and assumes the dhcp server is the tftp server

vestal sapphire
#

no that part is fine

#

afaict it requires the block size option

upbeat smelt
#

ah i misread your message

#

missed the extension part

vestal sapphire
#

at least the tftp server is short (< 100 SLOC of python)

#

despite paying attention to being correct to the spec and preventing path traversal attacks

vestal sapphire
#

okay I got the PXE and NVMe-oF boot working on my laptop pretty ez

#

all it took was writing the tftp server, everything else worked

#

I am now battling sysfs code currently

#

it seems like the devpath resolving or sysfs structure is borked?

#

not sure

carmine current
#

btw leo is there anything I should review?

vestal sapphire
#

yes

#

the open PRs

carmine current
#

what are "the open PRs"?

#

the wireshark one is marked as draft

vestal sapphire
#

yeah because all the wireshark PRs need to be merged in sync

#

that was a measure to prevent one of them being merged by accident

#

830, 833 are also open

#

also mlibc #1190

vestal sapphire
#

yeah so about the devpath resolving

#

it is supposed to be round-trip going from the protocol -> text -> protocol, however on my thonkpad it is not

#

it also ignores the friggin options to not use short notation

vestal sapphire
#

alright so we can't really rely on the devpath2text protocol, so time to just roll our own ig

#

it wasn't that hard tbf

vestal sapphire
#

AAAAAAAAAAAAAAAAAAAAAAAAAAAA I HATE EDK2

#

it always reports PNP0A03 for every PCI root, no matter if it actually is

#

given that there are no further requirements on _UID being correct, I think we're cooked

vestal sapphire
#

I think the only sanity-preserving solution is to obtain the segment number of the PCI root and go with that

#

so basically we should just store the PCI and PCIe roots as the same devpath node and replace the _UID with segment number so that PciRoot(0) just means whatever root handles segment 0

#

edk2 is being kinda insane here ngl

#

also the impl is probably not up to spec meme

#

okay getting the segment number is a bit ugly, as I have to get the PCI root protocol for the device path, but whatever

vestal sapphire
#

see #osdev-misc-0 too

#

but

#

I have a UEFI device path that I convert to text and pass to managarm for setting up the correct NIC

native prairie
#

interesting

vestal sapphire
#

thing is, when trying to follow that device path I noticed that despite the machine having PCIe roots (PNP0A08), UEFI's device path always reports PNP0A03

#

so, how do I deal with that

native prairie
#

i mean the _BBN and _SEG are always unique

#

who cares if its pcie or pci

vestal sapphire
#

I thought to basically just do gBS->LocateDevicePath(&PciRootIoProtocol, device_path) to get the segment num as I'll assume the device path's reported _UID is borked

native prairie
#

does PciRoot(0) mean _UID of 0?

vestal sapphire
#

yes, that is supposed to mean HID=PNP0A03 _UID=0

#

however, even a PNP0A08 with _UID=0 is commonly reported as PciRoot(0)

native prairie
#

_UID should be unique for all pci roots, no matter the HID no?

vestal sapphire
#

which is turbo annoying for the managarm side as I access them via the HID

vestal sapphire
native prairie
#

is there even a PcieRoot?

vestal sapphire
#

yes

native prairie
#

well

vestal sapphire
native prairie
#

u can just work around this behavior by checking if there are device paths with PcieRoot or something

vestal sapphire
#

nah so the thing is that I need to uniquely identify which controller to pick

#

and the PciRoot _UID is useless to me as it kinda doesn't actually mean anything on real impls

#

like I actually cannot resolve that to an actual ACPI device

#

it could be either PNP0A08 or PNP0A03 and I have no way of knowing

#

so my thought was to resolve this on the UEFI side, where I just slightly meme modify the PCI root device paths: I can just replace the reported _UID with the segment number and be done

#

I don't see a way to get _BBN in UEFI tho

native prairie
#

i see

#

yeah kinda annoying

carmine current
#

I still think just matching MAC addresses is good enough

vestal sapphire
#

the problem with that is that you probably need to initialize NICs just to then notice that MAC address collisions are suprisingly common

#

I have the devpath trickery implemented now tho, I can disklessly boot as far as into netserver now

#

not sure what's wrong there now tho

#

what I'll probably also do is carve out some memory early in UEFI for setting up an early bootAlloc

carmine current
carmine current
#

There's no point in running with NICs disabled

vestal sapphire
#

I'm thinking that wanting to blacklist some devices on boot might be useful esp for getting hw to boot

#

hence why I'm reluctant to just init everything

#

hmmm I'm now getting an assert in the NVMe driver??????

#

bruh

carmine current
#

the ability to deny driver loading on boot might indeed be useful

vestal sapphire
#

yeah for instance my NVMe on my laptop is giving me weird asserts, so I had to comment out the NVMe PCI probing which would be nice to avoid

#

anyways I might just open a PR for the tftp serving stuff I wired up in vm-util

#

so basically what I do for diskless boot of my laptop is having the NVMe-oF controller running (configure using nvmetcli) and then I can just do vm-util.py tftp, which sets up a tftp directory and starts serving that

#

we could possibly also integrate NVMe-oF controller configuration by writing to configfs into that to have a full no-worries diskless boot setup done by vm-util

carmine current
#

Yea we should use configfs, not nvmetcli

#

As nvmetcli was quite broken when i checked it out a few weeks ago

native prairie
vestal sapphire
#

the assert is that the slot number is in range, which it isn't for some godforsaken reason

#

so it seems like a logic bug somewhere

vestal sapphire
#

still no further progress with diskless boot on the thonkpad

carmine current
#

what's the blocker?

vestal sapphire
#

however while debugging stuff I wrote some nice vm-util.py additions, guess I'll pr them in

#

basically I have a vm-util.py tftp command that sets up a tftp root and runs a tftp server without the braindamage required for "regular" tftp servers

#

and I also wrote a vm-util.py wol <mac> that just yeets a WoL packet

#

turns out fedora's packaged wol pkgs are borked? idk they don't work

#

ig for wol it might be nice to have it read a config file at CWD to allow for aliases

vestal sapphire
#

hmm I wonder if I can make UEFI use the window size option to make tftp downloads quicker

brittle mauve
#

you probably can't make it very fast no matter what you do as the protocol is garbage

#

the http boot should be better but I have no idea what its supported by, at least my laptop didn't support it

vestal sapphire
#

ok so apparently I can use the window size option when using the (M)TFTP protocol itself

#

however, that is not possible with the protocol you get from the PXE protocol

#

I mean what we could also do is to just ship a NVMe-oF DXE and use that instead of TFTP for loading everything after limine

#

or a HTTP boot DXE

#

alternatively, ig we could also just spin up a new TFTP protocol instance using the data about the server we obtain from PXE

#

that would allow us to set the window size option

#

we'd probably still need the PXE TFTP proto impl as a fallback as the proper MTFTP protocols might not be available I'd think

carmine current
#

I don't think this is worth optimizing with custom solutions

vestal sapphire
#

NVMe-oF would have the added benefit on not relying on kernel cmdline for passing parameters, as it installs an ACPI table meme

#

the downside being that there's no NVMe-oF DXE implementation that I'm aware of

#

also technically I think it requires UEFI 2.10 because the device path type was reserved before but that's probably just minor details

#

maybe optimizing this with the "normal" TFTP protocol is worth it rn tho

#

it's just an alternative codepath to download a file

carmine current
#

On non-UEFI platforms, workarounds like this also won't work

vestal sapphire
#

on non-UEFI platforms you wouldn't run eir-uefi meme

serene portal
#

checkmate

carmine current
#

Even on uefi platforms, we probably want to stick to something that works out of the box on real hw

#

without installing/loading custom DXEs etc

vestal sapphire
#

yeah you can do the proper TFTP protocol with window size without custom DXEs

#

it's very very likely present if you do PXE boot, and if not we can just fall back to the slow PXE->Mtftp() variant

carmine current
#

How does the window size work?

vestal sapphire
#

the window size determines how many data blocks are sent until an ACK is expected

#

so instead of ACKing every data packet you can cut out the ping-pong for 63/64 packets with window size of 64 for instance

#
IETF Datatracker

The "Trivial File Transfer Protocol" (RFC 1350) is a simple, lockstep, file transfer protocol that allows a client to get or put a file onto a remote host. One of its primary uses is in the early stages of nodes booting from a Local Area Network (LAN). TFTP has been used for this application because it is very simple to implement. The employment...

vestal sapphire
#

ah I figured out the the wol stuff didn't work

#

apparently that was due to the fact that something got confused about which of my (many) interfaces to use

#

so my solution to bind the socket to a specific interface circumvented that accudentally

#

(I currently have 3 NICs + 2 wg connections active)

#

oh and wifi

carmine current
#

That can only really happen if you specify the wrong broadcast IP, can't it?

#

Say, you have two interfaces 10.1.0.5 and 10.2.0.27, then you should send to 10.1.0.255 to target the first interface

#

(Assuming /24 subnets)

vestal sapphire
#

thing is, for WoL, you are supposed to send it to INADDR_BROADCAST

carmine current
#

I don't think wol cares about the IP inside the ip header

vestal sapphire
#

it doesn't but I'm not sure whether it would get switched if the machine has been down for longer?

#

not sure how WoL works on a NIC level

#

WoL probably just greps for the magic packet as that format is static

carmine current
#

yeah

#

For the magic packet + correct mac address

#

If the switch forgot the mac address, it'll broadcast across all links

vestal sapphire
#

ok update on the diskless boot thing

#

it seems like it gets stuck trying to set up a NVMe-oF connection

#

it tries to send ARP requests, never gets a reply, and the TCP sending fails with that

#

I also don't see the arp requests in wireshark which is weird

#

the NIC works fine when booting from disk, and I see it receiving packets with diskless booting

#

thus I'd conclude the NIC driver is at least not completely broken

#

(the machine has a i219-V, which is served by our freebsd-e1000 driver)

#

I'm really not sure what's going on

#

afaict the network parameters supplied from UEFI are correct, too

#

this exact setup work in qemu, too

#

ah I think I can replicate it with a tap device

carmine current
#

Sounds weird indeed

vestal sapphire
#

it works in qemu with a tap device

#

but it does not on real hw

#

hmm maybe we don't reset the NIC properly on init? I can't think on any real reason except for memes like that

carmine current
#

yeah that's not unlikely

#

you can try a PCI level reset

#

but that needs a new hw protocol request

vestal sapphire
#

i'll probably check the driver on freebsd or somthing similar first

#

maybe I'm just missing something there

carmine current
#

Maybe we overwrite the uefi implementation's ring buffers etc with garbage and the device goes into an error state

#

Or the uefi firmware disables the device in some way

#

Do we enable bus mastering on that device?

vestal sapphire
#

iirc yes

#

but good point, I could try shutting down the PXE protocol

carmine current
#

Did that yield any progress?

vestal sapphire
#

I tried shutting down the PXE protocol but that didn't help

#

it's still failing to send ARP requests

carmine current
#

thonk i can only imagine that the problem is that the card somehow doesn't work correctly after being driven by the firmware

#

Did you try the PCI reset?

vestal sapphire
#

not yet

blissful bluff
#

How does managarm deal with events/software bus? (iiuic)

carmine current
#

can you make that question more specific?

#

I'm not really sure what you mean by "events/software bus"

blissful bluff
#

I want to have some sort of system for device (resource) discovery, where different servers can publish devices and so on

#

Like a disk driver can publish disks, the blockd server can publish partitions, the init server can publish handles for filesystem drivers, and so on

#

I think Linux has dbus

#

But managarm also had some sort of system for this? I want to know how people typically do it

#

Or some sort of event bus

vestal sapphire
#

we have mbus

#

you can inspect that on a managarm system by running lsmbus

#

if you want to dump it to e9, run lsmbus > /dev/helout

#

for the source, look for mbus

carmine current
#

Linux uses sysfs for this purpose, dbus is a userspace mechanism

#

Managarm uses mbus which unifies enumeration and monitoring (for hotplug)

#

mbus is essentially a table of objects that you can (1) enumerate and (2) watch for changes

blissful bluff
#

But I think VFS is too inconvenient for this

#

And I think what I could even potentially do is some sort of broadcast system

vestal sapphire
#

kobject/udev netlink meme

carmine current
#

The way monitoring works for mbus is that each object has a sequence number that is updated on object creation and on object property change and you can ask mbus for all objects where the sequence number is larger than X

blissful bluff
carmine current
#

where "updated" means that a global counter is incremented and then written to the object's sequence number

#

This scheme is stateless on the server side so listeners cannot perform denial-of-service attacks against the mbus server

blissful bluff
#

What do you mean by stateless in this context?

carmine current
#

The server doesn't have to keep per-client state

blissful bluff
#

Yeah, but how do you make sure the clients don't invent bogus sequence numbers?

upbeat smelt
#

if the seq number you send is above anything mbus knows about you just get an empty response

blissful bluff
#

Ok, I'll take a look at it

#

The docs I found just linked to GitHub

carmine current
#

In contrast, sysfs (or rather, netlink kevent) on linux is not stateless and only privileged clients are allowed to subscribe to events

#

That's because the linux kernel queues an unbounded number of kevent notifications on netlink sockets that are subscribed to kernel events

blissful bluff
#

the problem with sysfs is that it's user(space)-facing thing

#

And iiuc the kernel is using some internal API for publishing things on it?

vestal sapphire
#

I mean it's just a representation of stuff that drivers publish

blissful bluff
#

yeah, but it doesn't describe how things are published

#

(on the driver side)

upbeat smelt
#

mbus is a server you talk to over ipc

#

you send a request to publish a new object, and get a management ipc handle, on which you send ipc requests to feed other clients that bind to the object with handles

#

usually those handles are for object-specific ipc streams

#

e.g. usb device mbus nodes give you an ipc stream you can send usb requests over, etc

#

the only special kernel support is that it has a supercall that gives you the handle to the ipc lane to talk to mbus over

blissful bluff
upbeat smelt
#

the client prepares property filters (each object has a set of properties attached to it), then in a loop starting with seq=0 you send an enumerate request with the seq and filter, get a set of results back, and if the result was paginated you send another request at the seq indicated by the response

#

that gets you the ids and properties of the objects you queried, then you can bind to the object by id to get a handle to whatever the object is serving

blissful bluff
#

but if the server is stateless, where are the properties stored?

carmine current
upbeat smelt
blissful bluff
#

ok

#

that sounds reasonable

blissful bluff
carmine current
#

yes

blissful bluff
#

So basically, mbus is a server which lets you publish a bunch of things, and then everyone can just request/read them, based on a bunch of filters?

#

This seems simple and effective...

#

(why am I talking like an LLM?)

carmine current
#

yes

blissful bluff
#

(I just need to think how to deal with the async part of it all)

#

I think I'm gonna implement something like this then as well

quaint fern
#

if you like udev try looking at solaris' devfsadmd

#

on solaris devices are presented in /devices (the devicefs) in the same hierarchy as they occupy in the device tree gotten from openfirmware (or a fake one on x86) after it's been decorated by driver loading and attachment

fervent zodiac
#

thats neat

quaint fern
#

devfsadm in turn then creates links in /dev based on this + configuration files

quaint fern
fervent zodiac
#

procfs is from plan9, i think?

#

which isnt a unix

quaint fern
#

let me insert "good" between "every" and "linux"

fervent zodiac
#

lmfao

#

namespaces are from plan9 too

carmine current
#

plan9 has no shortage of bad ideas though meme

#

But it was designed at a time where its ideas made more sense

carmine current
#

here's how Gemini thinks mbus fits into Managarm meme

mbus is a fundamental component for enabling dynamic interactions within Managarm:
Drivers: Bus drivers utilize mbus to register devices they manage. This allows other system components to discover and utilize these devices without hardcoded configurations.
System Servers: System servers, like the POSIX server, rely on mbus to discover and locate other services they depend on. This promotes modularity and allows for flexible system configurations.
Applications: While applications may not directly interact with mbus for discovery in typical scenarios, the services and devices they utilize are made available through mbus, indirectly relying on it for system functionality.

#

the description wouldn't actually be too bad if it didn't add a lot of stupid fluff ("This promotes modularity and allows for flexible system configurations." / "enabling dynamic interactions within Managarm")

wild stone
reef steeple
#

all coding capable AIs have been made to at least skim thru most github code for the most common languages, usually sorted by stars

#

which is why they suck at Ironclad, because for the longest time, Ironclad wasnt on github

carmine current
#

i think by now it can also use google search results, so part of the info may come from there

wild stone
#

how long will it be until they scan fosdem talks

carmine current
#

i think they can do that already

#

the real question is: how long until they can write our docs? halfmemeleft

carmine current
#

but this feature is incompatible with enabling web search nooo

#

the results are mixed

#

it does manage to summarize the talk slides but the explanation is not very detailed

#

like, the Solution: Leveraging Events and IPC section only states half of the solution and not the entire thing

carmine current
#

somebody fine tune an LLM to generate handbook pages from a discord bot halfmemeright

#
Clients discover objects by sending enumerate requests to the mbus server over IPC.
These requests include property filters, allowing clients to specify criteria for the objects they are interested in.
Enumeration is sequence-number based for efficient monitoring.
Clients start with a sequence number of 0 and send an enumerate request along with their filters.
The server responds with a set of objects matching the filter and having a sequence number greater than the provided sequence number.
If the response is paginated (i.e., not all matching objects are returned in one response), the response indicates a sequence number for the next request to continue enumeration.
If a client sends a sequence number higher than anything mbus knows about, it receives an empty response.
#

^ in particular, this part is a pretty good and correct summary of what qookie and I wrote

wild stone
#

because scaleway has a (atm because beta free) very cheap LLM api

carmine current
#

this would probably be actually useful

#

not sure how much effort it is, never messed with LLM APIs

wild stone
#

i mean i normally quite strongly dislike LLMs

#

but this sounds interesting

#

its also more fun than listening to this lecture

wild stone
reef steeple
#

LLM written docs suck ass

#

just write them as you develop, much easier and much more accurate

wild stone
#

also i kinda want to see how it would summarize other things too

reef steeple
#

sumarizing code into docs? I can tell you how it will do that now, horribly

carmine current
#

we were talking about summarizing discord chats into docs, not code

reef steeple
#

madre de dios bendito

carmine current
#

if you give it code as input it probably indeed sucks hard

reef steeple
#

im gonna be honest, of all things, I am not sure discord chats are an improvement

#

but by all means, try it out

#

I am willing to swallow my preconceptions

#

I doubt I will

#

get deepseek-r1 running locally with ollama and feed the AI a file with the chats

#

its gonna be the easiest way to do this

#

no need to bother with discord API

#

just download the chats with a bot

wild stone
#

@carmine current discord bot account created halfmemeright

carmine current
#

i guess you could feed the entire messages ever written on the managarm discord into it and then add a /command to ask it for info about a specific topic

#

i can add the bot and make an experimental channel if you want to

wild stone
#

i was just gonna make it a "summarize the last x messages" or "summarize from here" thing

carmine current
#

send a link

carmine current
#

or we can just have both i guess

wild stone
wild stone
#

anyway 30 min uni break NekoRave

blissful bluff
#

Discord has it already

#

Though it's a bit different...

vestal sapphire
#

@carmine current about the post-install step

#

I'm not sure that's a great idea, as that would run it every boot which takes a solid 7-10 seconds on my (beefy) machine

carmine current
#

no it doesn't

#

xbps-reconfigure configures each package only once

vestal sapphire
#

not on package install/update?

carmine current
#

uhm that might be the case

#

not sure

vestal sapphire
#

yeah that'd be super annoying ngl

carmine current
#

hmm

#

you could still test whether it already exists i guess

vestal sapphire
#

given that the hwdb doesn't really change I would want to have it run more than exactly once

carmine current
#

but maybe if systemd will fix this anyway we can merge it as-is

vestal sapphire
#

systemd has a unit file that only gets triggered if the hwdb does not exist

carmine current
#

alright

vestal sapphire
#

also, a SEA OF GREEN

vestal sapphire
#

it makes sure that the hwdb does not get nuked by a make-image which would regnerate it on the next boot

#

also has the advantage that the xbbs nighly image already has it pregenerated meme

carmine current
#

no, the xbbs nightly image runs with -snapshot

#

but yeah makes sense

vestal sapphire
#

ah unforunate

carmine current
#

we'd need proper shutdown if we want to run w/o -snapshot meme

#

systemd support will help with that

vestal sapphire
#

Alt+M D

#

wanna take a look at the NVMe PR?

#

otherwise I'll just merge it ig

carmine current
#

looks fine

blissful bluff
carmine current
#

yes

blissful bluff
#

Isn't it kinda expensive?

fervent zodiac
#

not really?

carmine current
#

what exactly?

upbeat smelt
blissful bluff
#

Like if you have a lot of drivers requesting with a bunch of filters, it's a lot of processing for every new object

upbeat smelt
#

although ig sequence id -> object is also a std::map of sorts, although we explicitly use the frigg intrusive rb_tree

blissful bluff
#

The sequence id is not the problem

blissful bluff
carmine current
#

each filter needs to processed once for each update

#

there's no way around that, really

#

we could build additional indexes to skip some filters but that's just an optimization

fervent zodiac
#

its a pretty classic DB problem

blissful bluff
#

What I'm thinking is making my thing a tree

fervent zodiac
#

which is another way of saying "there's a shitload of research into making this kind of thing scale well"

blissful bluff
blissful bluff
fervent zodiac
#

that should be the default

carmine current
#

I don't think a tree fundamentally saves any processing here

#

A tree is equivalent to an additional index that indexes a "parent" property

fervent zodiac
blissful bluff
#

But like the processing could be subdivided

fervent zodiac
#

you can rank properties by how much they get used

carmine current
#

Hm?

fervent zodiac
#

like for example if you publish an object with properties (p1: v1, p2: v2)

#

instead of looking at every filter

#

you can try looking only at filters which constrain p2 to the correct value

blissful bluff
fervent zodiac
#

this works especially well if you structure your properties more cleverly than just a flat dictionary

blissful bluff
#

But what I'm thinking about is that for example, this system can be used for devices discovery, and for some other events

The device discovery thing can have a lot of listeners, but new devices rarely appear, but the frequently changing stuff would be in a different domain and would not run a lot of filters

fervent zodiac
#

but impl wise this is hard to do

carmine current
#

that's true, but this is essentially what i mean by "you can add more indexes"

fervent zodiac
blissful bluff
#

VFS-like thing basically

fervent zodiac
#

you have to select one of the properties you are matching on as a "primary" property

#

and then you have a map of <hash of primary property, list of listeners>

blissful bluff
fervent zodiac
#

then you just hash each property and wake up every listener matching it

#

and if you choose the primary property well you will get woken up only when it might be necessary for you to do shit

blissful bluff
#

Ok, and that doesn't require changing the interface if I decide to implement that later

fervent zodiac
#

yeah

blissful bluff
#

And you allow duplicate names?

fervent zodiac
#

names?

#

for what, for devices?

blissful bluff
#

you have std::string _name;

#

Yeah

carmine current
#

yes but names are informational only and not used in filters

blissful bluff
#

that's interesting

carmine current
#

if you require names to be globally unique you need some policy to decide which server can register which name

#

otherwise one server can do a denial of service attack against another server

vestal sapphire
#

ok so I've only looked at the man page so far but implementing fdinfo doesn't even seem to be that hard?

#

that may just be the next thing I tackle after getting ironclad NVMe done

trim eagle
#

Based

native prairie
#

Leo doing insane work in every dept

trim eagle
#

Maybe we can trick him into mountinfo too????

#

And with that info exposed, /proc/self/mounts is more of the same (mountinfo exposes more iirc)

#

Then /etc/mtab becomes a thing (that’s nowadays a symlink to /proc/self/mounts)

icy verge
#

managarm should get suspend one day

#

that would be cool

#

especially in a microkernel

vestal sapphire
carmine current
#

mountinfo sounds trivial, i can do that as well

#

it's just a list of mount points, isn't it?

#

or wait, i may be mistaking it for /proc/mounts

#

ah but yeah it's basically the same thing

vestal sapphire
#

so a few things about that

#

we need to assign mount IDs to mounts and same for major, minor numbers

#

wiring stat to show st_dev for regular files should be easy after that

native prairie
#

Well actually in managarm it would work fine because it has acpi in kernel mode

vestal sapphire
#

all of /proc/mounts, /proc/[pid]/mounts and /proc/[pid]/mountinfo are similar

carmine current
#

mount IDs are trivial to allocate

#

and we have major / minor numbers, we just don't store the device that backs a mount point

#

but we can easily add that without major changes

vestal sapphire
#

yeah

carmine current
#

tell all drivers that we're going to suspend

#

give them a few seconds to react

#

if they don't react, either wait or kill them (depending on the importance of the device)

native prairie
#

Yeah

#

If it was in userspace tho

#

How would resume work?

#

Since that happens in real mode

#

And everything dies and resets as in every device state

reef steeple
#

Do you guys ever get complaints about managarm not being an actual microkernel because of all these things being in kernel mode

#

Or because of the POSIX server being extremely monolithic

carmine current
#

not really

forest bear
#

managarm is FAKE

carmine current
#

also, other than ACPI there's nothing in kernel mode that could be moved to user mode

forest bear
#

scheduler?

carmine current
#

(while keeping the same design)

fervent zodiac
reef steeple
#

I would imagine people would complain about the POSIX server quite a bit

vestal sapphire
#

never encountered that

reef steeple
#

Interesting

carmine current
fervent zodiac
#

ah yeah

carmine current
#

the POSIX server is kinda monolithic, that's true. but that's due to the nature of POSIX

#

some parts could be moved out

#

but the POSIX server is still much smaller than a monolithic kernel

blissful bluff
carmine current
#

it doesn't talk to devices, it doesn't implement persistent file systems or networking etc

reef steeple
#

I see

native prairie
carmine current
#

the attack surface of the posix server is much smaller than the attack surface of a monolithic kernel

#

you could also reimplement the posix server in almost 100% safe rust if you really wanted to

#

;D

#

or Ada ;D

reef steeple
#

Ew you guys have enough already with C++

carmine current
#

for example, it's also true for seL4

nocturne tide
#

isn't seL4 basically useless anyway

carmine current
#

no, why?

forest bear
#

sel4 has uses

#

it's just not general purpose

carmine current
#

seL4 is used in production

nocturne tide
#

interesting

#

didn't know that

worn rampart
#

The new apple modem runs cL4

carmine current
#

it had a DARPA grant to implement a secure system, go figure what it may be used for meme

wild stone
#

when managarm on rockets used to bombard people

blissful bluff
#

memory leaks don't matter on rockets

wild stone
#

powered by assertos™️ missile

worn rampart
forest bear
worn rampart
#

It collects all the memory and even some area around it :^)

forest bear
#

too

carmine current
reef steeple
#

l4 is arguably used for drones yeah

reef steeple
#

I say arguably because those drones run like 3 OSes

#

And they have not made it into general use afaik

#

They are like networked air decoys iirc

#

It's neat

blissful bluff
#

imo drones are not neat things

reef steeple
#

Shame that they are american

#

The european ones will be ironclad powered

reef steeple
blissful bluff
#

then it's fun

reef steeple
#

They are just deployed by fighters and are meant to imitate planes

#

So air defense is confused

blissful bluff
#

lol imagine drone running managarm and assert fail

reef steeple
#

It just crashes on a school killing countless innocent children like every machine of war

#

Assert makes it default to factory settings

fast silo
#

hi

fervent zodiac
reef steeple
#

I honestly dont know how I would react if Ironclad was used in like a weapon to kill people

#

I know that if time goes on and I keep the ball rolling, thats just a thing that comes in the field at a certain point, these companies try a lot of stuff just to pad budgets

#

but idk man

fervent zodiac
#

if not your os, it would be some other os

reef steeple
#

that point works until your code is used to blow up children you know

fervent zodiac
#

yeahhhhhhh

quaint fern
trim eagle
#

TLDR: mountinfo (therefore mounts and mtab) soon and fdinfo soon!

#

Based

carmine current
#

Leo is doing some work on /proc/mounts rn

vestal sapphire
#

^

trim eagle
#

Yooooo. Based

vestal sapphire
#

close enough

trim eagle
#

Progress on mounts ngl

#

@vestal sapphire do you also have a list of mountable FS types? Cuz if yes we can export that over procfs too (managarm#593 and potentially managarm#594)

vestal sapphire
#

not yet

trim eagle
#

Noted

#

Then for now disregard that I guess

vestal sapphire
#

I'll prob impl a bunch of stuff tho so it might just get very easy to do

trim eagle
#

If it is, then please do so. Otherwise I don’t believe it’s actively blocking anything so don’t worry

vestal sapphire
#

ok we ball

trim eagle
#

Balling

icy verge
#

nice

trim eagle
#

But aren’t we missing /dev/pts?

#

It’s a thing in on Linux. Devpts. Idk if we implement it as a separate FS tho

vestal sapphire
#

too ez

#

yeah wait

#

devpts is not registered wtf

trim eagle
#

Yikes

vestal sapphire
#

ah no wait

#

I don't recursively handle children mountpoints

#

ah I need to traverse multiple mount points now, damn

trim eagle
#

Oof

carmine current
#

did you implement multiple mount point traversal?

#

btw something that we also shouldn't forget about is reviving the rust build

vestal sapphire
#

do we have a utility for that already?

#

I might just be too stupid to use ViewPath ngl

carmine current
#

No

vestal sapphire
#

but ViewPath::getPath already does mountpoint traversal?

carmine current
#

yes

#

when going down in the fs hierarchy you need to check the child mount points to see if you enter a different mount

#

when you go up via .. you need to check against the MountView's origin to check if you enter the parent mount

#

But the latter is already done by getPath

vestal sapphire
#

okay so why does ViewPath.getPath assert on having no owner

#

I just don't understand the logic of it

#

okay I guess the problem is that I don't know what mount the link returned by getAnchor() is?

vestal sapphire
#

yeah I guess changing the anchor to be a ViewPath works

carmine current
#

getAnchor always returns a link in the parent mount

vestal sapphire
#

yoooooooooooo

upbeat smelt
#

this code very fast

carmine current
#

nice

#

The first line is not correct yet though

vestal sapphire
#

oh yeah

carmine current
#

Since it should show /dev/sda2 or something like that

vestal sapphire
#

I wasn't passing the info to mount meme

upbeat smelt
#

/dev/sda1/

vestal sapphire
#

that's just what ViewPath does

#

don't mind the trailing /

trim eagle
#

Based

vestal sapphire
#

now mountinfo is next

#

and after that, fdinfo

#

that should allow us to drop some systemd patches

#

we can't run mount with the changes, yet

nocturne tide
#

why is it appending a slash if it's not a directory lmao

trim eagle
vestal sapphire
#

I tried to fix it once and ... it wasn't pretty

vestal sapphire
trim eagle
#

Also, try a symlink from /proc/self/mounts (yes that’s a thing) to /etc/mtab

vestal sapphire
#

time for mountinfo

trim eagle
vestal sapphire
#

I already have /proc/self/mounts lol

trim eagle
#

Good

#

But /etc/mtab symlink?

#

Some tools still look for that. LFS makes it in chapter 7

nocturne tide
#

testing if symlinks work in managarm? meme

#

fair enough

trim eagle
nocturne tide
#

i know im just joking

#

since you asked leo for that mtab symlink so persistently

trim eagle
#

Maybe mount falls back to it lol

#

That’s why

#

And because it’s supposed to exist but I can add that myself later anyway

vestal sapphire
#

okay let's see if mountinfo just works™️

trim eagle
#

Be advised systemd (and I think technically libmount) wants to poll that file

vestal sapphire
#

yeah about that

#

that needs additional wiring ig

trim eagle
#

Yeah

#

That’s what I was getting at

#

Poll not implemented for that stuff

vestal sapphire
#

good enough ig

trim eagle
#

Do the numbers make sense?

#

If so, big pog

vestal sapphire
#

yeah they're reasonable afaict

trim eagle
#

Nice

vestal sapphire
#

ig I should wire up stat to report the major:minor numbers as well

carmine current
#

that's up to each fs

#

tmpfs stats should be fixed in general

#

Also the c/a/mtime

#

And perms / uid / gid

#

Should be pretty trivial

#

Just a few additional integers to store

vestal sapphire
#

it doesn't do it when I strace mount

#

it does on managarm tho

carmine current
#

poll seems easy to do

#

Just raise a recurring event on each mount

vestal sapphire
#

I'm confused by the fact that it doesn't do it on linux

carmine current
#

Polling isn't mentioned on the man page

#

Does it even work on linux?

vestal sapphire
#

I'll look into the source later today ig

carmine current
#

It might take some fallback path in managarm because we don't implement newer interfaces to discover mounts (?)

#

Maybe it polls a different proc file instead on linux

trim eagle
#

You Might want to look into drain_libmount_events iirc

carmine current
#

Today I'll have time to rework the fifo implementation

trim eagle
#

Based

vestal sapphire
trim eagle
#

Nice

vestal sapphire
#

maybe I should bump uACPI today

#

I assume no meaningful changes to the sysdeps are needed?

#

or consumers of the API

carmine current
#

do we gain anything by bumping?

#

didn't we just bump a few days ago? meme

vestal sapphire
#

being up to date and easier bumping in the future

carmine current
#

alright

#

you could also bump rust

#

actually, is there anything important that i should do?

#

regarding systemd requirements etc

native prairie
#

xhci fixes, kde port, gnome port trl

trim eagle
#

SOCK_DGRAM

#

The test suite

vestal sapphire
trim eagle
native prairie
carmine current
trim eagle
#

In general test if it’s conforming to spec and review the open PR for it

carmine current
#

imho we also shouldn't invest time into elogind

trim eagle
carmine current
#

at least not until systemd works

vestal sapphire
#

ig I'll work on fdinfo next

#

that allows us to drop another systemd patch

trim eagle
#

Yes please

#

I’ll test all of the things whenever time permits

#

I fear that won’t be until Wednesday tho

#

However, Wednesday and thursday should be full days to work on Managarm (after I write 3 not so long reports that I need to hand off ASAP)

carmine current
#

alright, compiling the test suite and adding some DGRAM tests makes sense

#

afterwards, I can probably rewrite the CoW implementation

trim eagle
#

Sounds good

vestal sapphire
#

ok the fdinfo stuff is a bit funni for the case on anonymous inodes

#

inspecting linux gives me nonsense

trim eagle
#

Bruh momento

vestal sapphire
#

okay I think fdinfo works good enough

#

I also wired up mount IDs to statx

trim eagle
#

Based

vestal sapphire
#

ok PR updated, you should be able to just apply it

#

the mlibc side is easy, just add
statxbuf->stx_mnt_id = resp.mount_id();
to sys_statx

trim eagle
#

Sounds good

vestal sapphire
#

okay I think a problem we will run into with IOMMU is the fact that we need to exclude regions that are marked reserved in the memory map from being mapped through it

#

so ig first order of business is doing that

carmine current
#

the RMRRs?

#

but that's easy enough to support, isn't it?

nocturne tide
#

managarm iommu support? wtf did i miss

serene portal
#

leo is bored again apparently

nocturne tide
#

then port xorg

carmine current
#

xorg is obsolete tech in maintenance only mode

lament grove
#

Wayland gang

carmine current
#

btw @nocturne tide do you want to PR the KVM changes?

#

they probably need some minor changes before merging

#

but nothing crazy

nocturne tide
#

i mean it's broken soooo

#

i wouldn't try upstreaming it just yet

carmine current
#

it might be broken due to kernel bugs though

#

how did you test it btw?

nocturne tide
#

with the little modification of where i write a zero into every page that i mmap

carmine current
#

in the guest or from the host?

nocturne tide
#

on the host

#

it needs to be done before the ioctl which maps a memory region

#

right after this

#

just a little loop from 0 to mem_size writing zeroes every 4096 bytes

#

but as you said, this won't be needed when ept/npt code gets converted to use cursor or whatever

#

so it's a little workaround for now

carmine current
#

imho it still makes sense to PR the changes in

#

at least if you have some time to fix the comment that'll be posted during review

#

since that'll make testing much easier

#

maybe i can also do the conversion to the cursor

nocturne tide
#

yeah i guess it can be a draft pr since i don't really feel like it's anywhere near ready for upstream

#

i'll try to rebase it today and draft a pr

carmine current
#

code doesn't need to be perfect to be committed

nocturne tide
#

i am aware

#

that's why it's on my fork and not upstream

carmine current
#

@vestal sapphire btw did you make any progress on iommu yesterday after i left?

vestal sapphire
#

nah I was mostly just reading

carmine current
#

i'll probably look into converting the EPT code to the cursor this evening

#

i expect that the iommu pt code will be pretty similar

trim eagle
#

Timing update, leaving the GF for home now, so after dinner and my administrative work I guess systemd is on the menu again

carmine current
#

i'm available at 7pm

trim eagle
#

Sounds good, hopefully I’m done writing the reports by then

carmine current
nocturne tide
vestal sapphire
#

Currently cycling but I'll be available until 19:20

lament grove
#

Has anyone tested Managarm on the HiFive Unmatched?

#

And: Does it use the Limine boot protocol?

carmine current
#

no, but i would be interested to see the result

lament grove
#

I'll volunteer to test that, then.

carmine current
#

I don't expect it to work out of the box though

lament grove
#

Assuming the ISO fits in <=32MB

carmine current
#

but just getting the console log would be useful

#

why 32 MB?

lament grove
#

My largest SDcard

#

I might be able to get it on the SATA HDD in there but that'd take way longer because I'd have to temp. transfer that to my main PC, copy it on, and transfer it back.

carmine current
#

huh

nocturne tide
#

i hope you mean GB lol

#

who the fuck has 32MB SD cards

carmine current
#

yeah i'm confused as well

lament grove
#

am rarted pls help

#

no it's 32GB dw

nocturne tide
#

lmao i was gonna ask whats ur smallest SD card

#

if 32MB is ur largest

#

😭

#

but yeha that makes sense

carmine current
#

alright, that makes more sense 😄

nocturne tide
#

the x86-64 managarm image is like 5GB

#

so risc-v one will definitely be smaller

carmine current
#

the problem is that we don't have automatically built images for riscv yet

#

but i can send you and image

lament grove
#

I'd appreciate that

carmine current
#

does limine work on the unmatched?

lament grove
#

Assuming U-boot is configured properly, yes

#

I know how to do that for the unmatched

carmine current
#

how do you boot it?

#

using uefi?

#

uefi = uboot's uefi

lament grove
#
  1. U-boot SPL (with OpenSBI) in a partition.
  2. U-boot proper in the second
  3. EFI partition
  4. Anything else
carmine current
#

so i can just send you an image that has limine installed as BOOT/BOOTRISCV64.EFI on the ESP, right?

lament grove
#

yes

#

but

#

Send me the root FS and ESP separately

#

Because the first two partitions require specific formatting

carmine current
#

alright

#

I'll prepare that in a few hours, don't have time to do it rn

lament grove
#

ok

carmine current
#

Progress: systemd-journald yields output now

lament grove
#

If you wait too long I'm going to bed

carmine current
#

Hm, I'm still working on a different thing rn, so maybe I'll send it tomorrow instead

lament grove
#

ok

vestal sapphire
#

@trim eagle how did yesterday's systemd go

#

also available for vc until ~2pm

carmine current
#

So journald output to kmsg (aka e9) works

#

which allows us to see the messages of all services which is nice

#

journald itself is hanging in a busy loop though, so that needs to be fixed

#

it gets POLLHUP on some socket. for some reason it doesn't close the socket nor does it stop polling it. hence, the next poll immediately returns and it keeps looping.

#

I think it might expect an error from some other syscall (e.g., write()) that we don't return correctly (comments in the code in systemd indicate that they rely on error returns from other functions to notice that the socket is truly closed by the remote)

#

kmscon dies due to seat-related issues (unclear why it's behaving differently when systemd runs vs. when it does not run)

vestal sapphire
#

still nice progress

carmine current
#

It would probably be good to write unit tests for our unix socket implementation, in particular checking:

  • if the local/remote sockaddrs after connect etc are correct
  • to check if disconnecting behaves correctly (disconnecting DGRAM sockets should not do anything, writing to disconnected stream sockets should error out, poll should return the correct flags after disconnect, the handling of disconnect but not yet empty socket buffers needs to be correct.)
  • checking if multiple DGRAM sockets sending to the same DGRAM socket work correctly (I think the current code manages the "connected" state incorrectly for DGRAM -- DGRAM should simply not use the state)
carmine current
#

There are also a few other issues (iirc mount fails due to getopt / we could try if weston works) but imho we should focus on journald

#

systemd without journald is not viable as we won't be able to see log messages during boot if journald is not present

carmine current
#

@trim eagle imho it would also be a good idea to clean up the systemd patches such they can be merged

#

then it's much easier to play around with it locally

trim eagle
#

Merged you say. Yeah I don’t see that happening soon as it’s still riddled with debug prints and I’m not comfortable merging stuff that doesn’t work

#

What I will do, is update my patches to remove some of the no longer needed prints (journald main loop) and to use fdinfo and mountinfo and see if that fixes something

carmine current
#

I'm not saying that we should merge + enable it

#

but cleaning up the patches such that the patches can be merged would be good

#

Ofc we don't enable it until it works

#

this probably amounts to splitting the patches into two parts: stuff that is reasonable and can be merged + debugging prints on top that won't be merged

carmine current
#

but for example it would be great if i could just build systemd-utils on master and get to an already working journald

trim eagle
#

After I update my patches it should just be pull my bootstrap branch and sock DGRAM and settimeofday fix and go

carmine current
#

nice. it would still be good to split the patches into "can basically be already applied because it makes sense" + "whacky stuff that we probably want to remove"

carmine current
#

That's the first thing I'll do today when i get to my PC ;D

lament grove
#

:D

carmine current
#

Waiting for hwdb update on qemu RISC-V is not fun meme

trim eagle
#

Imagine systemd proper

carmine current
#

systemd itself is probably mostly slow due to logs

trim eagle
#

It’s not helping no

carmine current
#

this is a gpt image with ESP + root partition

#

I guess the easiest way to extract the partitions is by using losetup -Pf image, then copying the partition out of /dev/loop0p1 / /dev/loop0p2 ?

#

or one could just copy out the files

lament grove
carmine current
#

nice ty

#

Had to rebuild a bunch of stuff that's why it took some time

vestal sapphire
#

btw I think the assumption that we need to copy out all structs to not invoke UB is incorrect

#

like in the case of DMAR structs, I have some memory that is previously untouched

#

I have a void pointer to it, and I construct a frg span of uint8_t to it

#

if I then reinterpret_cast a section of it to the struct type that is not violating struct aliasing and not violating alignment requirements if the struct has the proper alignment specified

carmine current
#

While that is true in general, there is no guarantee that DMAR is properly aligned

#

looking at my own machines, there is none where DMAR is misaligned but there is one where RSDP is misaligned, for example

#

seems that the alignment is not even consistent among multiple AMI firmwares meme

#

one machine that i have as page aligned ACPI tables

#

the others have 8 byte alignment

vestal sapphire
#

DMAR structs should be packed tho

carmine current
#

if you have packed structs and you're careful you can get away without memcpy

#

but packed itself is questionable

#

packed generates single byte loads on some archs meme

vestal sapphire
#

yeah but that's correct then

carmine current
#

right, but memcpy + non-packed would be more efficient

nocturne tide
#

it's better to copy it out of unaligned memory once

vestal sapphire
#

depends on what you want to trade, time or memory meme

carmine current
#

personally, I'd avoid packed

quaint fern
#

it did to me just as you said on riscv builds

#

but adding the aligned attribute lets you provide the external alignment you want and that corrected the code generation

#

rust did not offer that privilege. anyway, it's not as much of a loss to go without packed if you're in C++

carmine current
#

good to know that an alignment attribute fixes it

quaint fern
#

rust for its part has not got this

#

their equivalent of packed reduces external alignment to 1 unconditionally and is incompatible with the attribute that increases external alignment

vestal sapphire
trim eagle
#

Based

vestal sapphire
#

current state is:

  • I can set up the IOMMU, including knowing which PCI devices go through it
  • I deny all DMA requests
  • I can log faults
#

ig next step is having a hw proto request to allow passthrough of DMA requests

carmine current
#

Nice

carmine current
#

can you set up passthrough on a per-device level? or do you need to construct PTs that contain all RAM?

vestal sapphire
#

I can just set a bit per device (per function even) to just do pt

#

if the IOMMU supports that

fervent zodiac
#

can you support SMMUs?

#

at least on a theoretical level

#

(or DART/SART on apple real hw)

vestal sapphire
#

probably yes, I haven't looked at them yet tho

fervent zodiac
#

(keep in mind that DART/SART have fixed 16k page sizes)

vestal sapphire
#

anything that's emulated by qemu is probably going to be done first tho

fervent zodiac
#

ofc

#

virtio-iommu?

vestal sapphire
#

virtio-iommu is kinda unnecessary tho

#

qemu supports emulating both VT-d and the AMD equivalent

fervent zodiac
#

yes i know, i'd do it anyway

#

because of diversity of implementation or whatever

vestal sapphire
#

we already need 2 anyways

fervent zodiac
#

ah fair

#

yeah

#

then its probably not necessary

vestal sapphire
#

I'm setting this up to be a generic interface specifically to also support SMMU down the line, should be good enough

carmine current
#

arm SMMUs work a bit differently, AFAIU they have a finite number of "stream IDs" that you can use to associate devices and PTs

#

but idk the details

fervent zodiac
#

on apple you have one DART per device (ish) afaik

#

so the iommu is not global

carmine current
#

but that's also the case on x86

fervent zodiac
#

ah maybe not

carmine current
#

you can have multiple iommus and there's a device <-> iommu mapping in the DRAT

fervent zodiac
#

ah yeah

#

okay

#

ah yeah and there is the other more different iommu used basically only for nvme i think

#

or maybe other things too nvm

vestal sapphire
#

okay I can kinda boot with the IOMMU in passthrough mode

#

virtio-block is being weird about it

carmine current
#

does it fault?

vestal sapphire
#

no it just waits for half a minute

carmine current
#

and then?

#

it works?

vestal sapphire
#

yep

carmine current
vestal sapphire
#

yeah I don't know either

#

now it just works thinkong

carmine current
#

very nice

vestal sapphire
#

nukes shouldn't use Intel IOMMUs?

serene portal
carmine current
#

uh, this is very hard to read

serene portal
#

yea discors compression

carmine current
#

can you find a frame that's somewhat readable and upload that as an uncompressed picture?

serene portal
#

HEL_CHECK failed: poll_msi.error()
in client.cpp line 239

carmine current
#

@vestal sapphire something for you to fix just dropped ^ halfmemeleft

serene portal
trim eagle
carmine current
#

actually maybe i can also fix that

serene portal
#

context: i have 4 m.2 nvmes in my system and 1 via usb c

carmine current
#

doesn't seem nvme related

#

Hmmm, i'm a bit confused

#

but i can take a look at this in the evening

#

seems that the MSI allocation succeeds but the installMsi request still somehow errors out

#

and afaict we should get to the auto descError = co_await PushDescriptorSender{conversation, IrqDescriptor{object}}; on this code path

#

which should cause the client side to succeed

#

Marvin if you have some time you could add extra logs to the thor code path that i linked above to check if we fail somewhere or if we get to the PushDescriptorSender

vestal sapphire
serene portal
#

download

#

it's blurry anyways

vestal sapphire
#

doesn't play either

serene portal
#

lmao

vestal sapphire
#

ah vlc works chad

native prairie
#

plays for me but the compression makes it useless

serene portal
#

yea

#

source is only midly better

upbeat smelt
#

i wonder what packages i'm missing to make this video play in firefox

serene portal
#

libavdecode KEKW

upbeat smelt
#

i mean it must be some specific codec since other videos play

vestal sapphire
serene portal
#

it's h264 avc

carmine current
#

The video also doesn't play for me with the official discord .deb, i had to download it