2022-09-08
00:15uniq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:15thelounge757 has quit [Remote host closed the connection]
00:18skmp__which seems to be highly informative and a pretty good read, if the codebase is still similar
00:19thelounge757 has joined #asahi-dev
00:21DarkShadow44 has joined #asahi-dev
00:24thelounge7571 has joined #asahi-dev
00:28amarioguy has joined #asahi-dev
00:29thelounge757 has quit [Ping timeout: 480 seconds]
00:45e1eph4nt has quit [Ping timeout: 480 seconds]
00:51e1eph4nt has joined #asahi-dev
00:59e1eph4nt has quit [Ping timeout: 480 seconds]
01:07e1eph4nt has joined #asahi-dev
01:08riker77_ has joined #asahi-dev
01:13riker77_ is now known as riker77
01:24thelounge7571 has quit [Remote host closed the connection]
01:27uniq has joined #asahi-dev
01:30thelounge7571 has joined #asahi-dev
02:20uniq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:23e1eph4nt has quit [Ping timeout: 480 seconds]
02:29thelounge7571 has quit [Remote host closed the connection]
02:31thelounge7571 has joined #asahi-dev
02:43e1eph4nt has joined #asahi-dev
02:52e1eph4nt has quit [Ping timeout: 480 seconds]
02:53claraaudbtc[m] has joined #asahi-dev
03:16e1eph4nt has joined #asahi-dev
03:31amw has quit [Ping timeout: 480 seconds]
03:31thelounge7571 has quit [Remote host closed the connection]
03:33thelounge7571 has joined #asahi-dev
03:43uniq has joined #asahi-dev
03:52amw has joined #asahi-dev
03:58SSJ_GZ has joined #asahi-dev
04:06marcanskmp__: I honestly have no idea if you're looking to add "real" 4K support to the kernel. I imagine it won't be easy, but probably not much better resource than reading the code itself.
04:07marcanone thing that did get merged semi recently is page folios, which are used in the other direction (higher order pages), but might be of use here?
04:23uniq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:28e1eph4nt has quit [Ping timeout: 480 seconds]
04:32thelounge7571 has quit [Remote host closed the connection]
04:33thelounge7571 has joined #asahi-dev
04:40marcanmaybe the ticket is to go the other way and start from a nominally 4K kernel, then change the allocation/tracking to always use 16K page folios by default, then figure out how to turn the kernel address space and a subset of process address spaces into 16K mode
04:45e1eph4nt has joined #asahi-dev
05:01c10l has joined #asahi-dev
05:01claraaudbtc[m] has quit [autokilled: This host violated network policy and has been banned. Mail support@oftc.net if you think this is in error. (2022-09-08 05:01:58)]
05:03uniq has joined #asahi-dev
05:19clararussel[m]https://t.me/+RUUsDo-kHfg0NzI0... (full message at https://matrix.org/_matrix/media/r0/download/matrix.org/MMnmBvihHRlbMzvEozSuGnAU)
05:28clararussel[m] was banned on #asahi-dev by ChanServ [*!~clararus_@2001:470:1af1:101::*]
05:28clararussel[m] was kicked from #asahi-dev by ChanServ [You are not permitted on this channel]
05:33thelounge7571 has quit [Remote host closed the connection]
05:34thelounge7571 has joined #asahi-dev
05:35uniq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
05:53e1eph4nt has quit [Ping timeout: 480 seconds]
06:03e1eph4nt has joined #asahi-dev
06:31skmp__@marcan: I'd be interested for this use case (emulation in a system that the 'best' page size isn't 4k) for now, so not sure if it needs to be 'real' 4k or not
06:32skmp__yeah, that documents some form of higher order pages and also gives context on how things fit together as well as gotchas
06:33marcanIf you just want to add support to FEX for 16K systems without kernel changes, then it's mostly just about playing with the mmap/etc wrappers and doing some ugly tricks when you get unaligned ELF sections
06:34skmp__I'm familiar with the vm 'frontend' (application <-> vma ranges interactions) as that was needed to cross check that the userspace vma tracking matched kernel
06:34thelounge7571 has quit [Remote host closed the connection]
06:35skmp__there's one complication of mremap that wasn't accounted in our previous discussion there
06:38marcanAll approaches to this problem are going to be either incomplete or very difficult to cover all the cases :)
06:39skmp__but then again, I've been working in user space that intimetally plays with specific page sizes and semantics since for ever at this point
06:40skmp__we still need to be able to use host libraries in the same address space - say host opengl driver stack
06:42skmp__I guess I also see the value of the NT kernel only supporting '64k' segments for maps even on '4k' page hosts - as much as I hated it back then I had to work around it
06:44skmp__I also poked quite a bit in that userspace paging idea - which I find much, much more exciting and extendable
06:45skmp__I'm not sure a fix specifically for x86/64 emulation for linux on m1 would justify inclusion in the kernel
06:45thelounge7571 has joined #asahi-dev
06:45skmp__maybe something more exotic that opens new frontiers would, but then again maybe the scope is much better so it won't
06:49skmp__another semi-programmable middle ground could be to re-repurpose BPFs and give hooks where userspace can do what it wants, akin to how seccomp does
06:50skmp__though, honestly, this 'bpf as a secure vm in kernel space' thing is something I don't like so much
07:10e1eph4nt has quit [Ping timeout: 480 seconds]
07:22mps has joined #asahi-dev
07:37e1eph4nt has joined #asahi-dev
07:45thelounge7571 has quit [Remote host closed the connection]
07:45e1eph4nt has quit [Ping timeout: 480 seconds]
07:51thelounge7571 has joined #asahi-dev
08:27amw_ has joined #asahi-dev
08:33amw has quit [Ping timeout: 480 seconds]
08:45e1eph4nt has joined #asahi-dev
08:47uniq has joined #asahi-dev
08:50thelounge7571 has quit [Remote host closed the connection]
09:02marcanskmp__: for 4K apps running with native kernel support the whole process would be 4K. system libraries built to support 16K systems can run fine on 4K kernels.
09:02marcanyou'd only have an interworking problem if those system libraries for some reason used shared memory / protocols that depend on the page size
09:03uniq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:04marcanso really there's two approaches here, just run in 16K mode and play around with syscalls/loader stuff to fake-support 4K as much as possible, or do the hard work of making the kernel support mixed page sizes and just run every FEX process in 4K mode (which is what Rosetta does).
09:05marcanI personally don't think userspace paging makes any sense, since getting it right involves as much complexity in the kernel as just supporting 4K pages, and getting it wrong means massive security vulnerabilities.
09:07thelounge7571 has joined #asahi-dev
09:16j`eyyou'd probably want to talk to upstream maintainers about mixed page sizes too, it's a lot of work and you want to find out if they're open to it first?
09:17uniq has joined #asahi-dev
09:48j`eyjannau: I just realised that robin ack'd the v3, so I think that means it's waiting for joerg to pick it up now?
09:51e1eph4nt has quit [Ping timeout: 480 seconds]
10:06e1eph4nt has joined #asahi-dev
10:07thelounge7571 has quit [Remote host closed the connection]
10:28thelounge7571 has joined #asahi-dev
10:31uniq has quit [Quit: Textual IRC Client: www.textualapp.com]
10:42jannauhas someone recently seen spi hid probe errors with "waiting for device info failed: -19" (mb pro 14" m1 max)? might be related to having a usb-c cable conencted to another apple silicon machine
10:45jannauappears to a "hardware" issue as u-boot is affected as well. differently though, auto-boot stops with a few random characters on the prompt
11:20chadmed has quit [Read error: Connection reset by peer]
11:21e1eph4nt has quit [Ping timeout: 480 seconds]
11:28thelounge7571 has quit [Remote host closed the connection]
11:31e1eph4nt has joined #asahi-dev
11:34Race has joined #asahi-dev
11:39chadmed has joined #asahi-dev
11:39e1eph4nt has quit [Ping timeout: 480 seconds]
11:49thelounge7571 has joined #asahi-dev
12:01thelounge7571 has quit [Ping timeout: 480 seconds]
12:09pjakobsson has joined #asahi-dev
12:09e1eph4nt has joined #asahi-dev
12:38rpirea has joined #asahi-dev
12:45thelounge7571 has joined #asahi-dev
12:54skmp__> @marcan you'd only have an interworking problem if those system libraries for some reason used shared memory / protocols that depend on the page size
12:56Race has quit [Ping timeout: 480 seconds]
12:57skmp__if upstream doesn't want to collaborate with the end users, people will end up keeping patchsets
12:59skmp__and, m1 takes a big (iirc 12%ish) perf hit from using 4k pages, so it will be very hard to convince a distro to do that
12:59marcanskmp__: I don't think that's going to be a common problem, realistically, and it would probably be something that those upstream libraries would accept fixes for (e.g. some way of determining the system *max* page size, not the *current* page size, and using that)
13:00skmp__I'm an emulator author, my job is to predict how people will misasume things and then it'll end up on my bug tracker as a bug on my project
13:00marcanopengl and vulkan don't care, that all goes through GEM/whatever on the kernel side and the driver there would allocate things using the right page size
13:00marcanif anything I expect some corner cases with, like, pulseaudio and/or pipewire, that kind of thing
13:00jannauskmp__: I think it will not hard to convince distro's to enable apple silicon support in their standard arm64 4k kernels
13:01marcanit's going to be harder to convince them to have 16K kernels as an alter- yeah what jannau said
13:03marcana more practical thing might be to teach linux how to decide on the page size at *boot time*
13:03marcanit's going to involve making a huge amount of changes to compile-time constants but at least it wouldn't require a massive rework of the VM subsystem
13:05marcanit is much easier to teach the kernel to allocate 16K pages for DMA than it is to teach it mixed page sizes with userspace involved
13:07marcanit will be a lot easier and get you results much faster than any attempt at messing with the kernel
13:07marcanif that's unsatisfactory, we can start talking about kernel changes, but any reasonable approach there will likely take a very long time to settle on and be implemented, if practical at all
13:07skmp__and after 16 hours of emulator programming, i'd rather chillax with some easy kernel work
13:08marcanif it gets you 90% of the way there now it's worth it over being 0% of the way for years while someone figures out how to do this in the kernel, if it's even practical
13:10marcanthat's definitely another aspect, you're going to spend a lot more time in politics and a lot less time writing code on the kernel side
13:12marcanwell, thing is here we actually want things upstream so... "for the lulz" isn't really useful unless it's actually a good solution that convinces upstream to change their opinion
13:12rpirea has quit [Quit: rpirea]
13:12rpirea has joined #asahi-dev
13:13marcanI'm not going to stop you from doing whatever you want with the kernel, but don't expect us to merge it either even in our tree unless it's seriously beautiful and clearly correct :p
13:13marcanbecause I am not qualified to evaluate a deep VM change like this for security impact, and I am not risking that
13:13e1eph4nt has quit [Ping timeout: 480 seconds]
13:13skmp__Well, if I really wanted to have to run, I can always just patch the kernel at runtime to do what I want
13:14skmp__but I think the point is more of how to not waste time and energy on fun and possibly meaningless endeavours
13:16marcannot really, but MEMORY MANAGEMENT in MAINTAINERS will get you a name and a special purpose mailing list ;)
13:23jannauJoerg was looking at t6000 dart yesterday and wanted to wait a little bit longer for feedback but will apply it sometime next week
13:24jannauso if someone else than Sven wants to take look I guess that would be welcome, https://lore.kernel.org/all/20220901012519.7167-1-j@jannau.net/
13:27jannauskmp__: agx is our interpretation to avoid conflicts/misunderstandings with sgx. Apple still calls it sgx in their device tree
13:36c10l2 has joined #asahi-dev
13:39e1eph4nt has joined #asahi-dev
13:42c10l has quit [Ping timeout: 480 seconds]
13:45thelounge7571 has quit [Remote host closed the connection]
13:47e1eph4nt has quit [Ping timeout: 480 seconds]
13:51thelounge7571 has joined #asahi-dev
13:52rpirea has quit [Quit: rpirea]
13:53rpirea has joined #asahi-dev
13:57e1eph4nt has joined #asahi-dev
13:58rpirea has quit [Quit: rpirea]
13:58rpirea has joined #asahi-dev
14:23DarkShadow44 has quit [Quit: ZNC - https://znc.in]
14:23DarkShadow44 has joined #asahi-dev
14:24DarkShadow44 has quit []
14:24DarkShadow44 has joined #asahi-dev
14:48rpirea has quit [Quit: rpirea]
14:51thelounge7571 has quit [Remote host closed the connection]
14:55thelounge7571 has joined #asahi-dev
15:04e1eph4nt has quit [Ping timeout: 480 seconds]
15:12e1eph4nt has joined #asahi-dev
15:21e1eph4nt has quit [Ping timeout: 480 seconds]
15:29e1eph4nt has joined #asahi-dev
15:37e1eph4nt has quit [Ping timeout: 480 seconds]
15:42e1eph4nt has joined #asahi-dev
15:55thelounge7571 has quit [Remote host closed the connection]
15:56thelounge7571 has joined #asahi-dev
16:36thelounge7571 has quit [Remote host closed the connection]
16:37thelounge7571 has joined #asahi-dev
16:50e1eph4nt has quit [Ping timeout: 480 seconds]
16:55thelounge7571 has quit [Remote host closed the connection]
16:57thelounge7571 has joined #asahi-dev
16:59e1eph4nt has joined #asahi-dev
17:07e1eph4nt has quit [Ping timeout: 480 seconds]
17:16e1eph4nt has joined #asahi-dev
17:25e1eph4nt has quit [Ping timeout: 480 seconds]
17:31e1eph4nt has joined #asahi-dev
17:56thelounge7571 has quit [Remote host closed the connection]
18:00thelounge7571 has joined #asahi-dev
18:02thelounge7571 has quit [Remote host closed the connection]
18:05thelounge7571 has joined #asahi-dev
18:27thelounge75713 has joined #asahi-dev
18:30thelounge7571 has quit [Ping timeout: 480 seconds]
18:41e1eph4nt has quit [Ping timeout: 480 seconds]
18:52e1eph4nt has joined #asahi-dev
19:27thelounge75713 has quit [Remote host closed the connection]
19:32thelounge75713 has joined #asahi-dev
19:46revokeduser[m] has joined #asahi-dev
19:59e1eph4nt has quit [Ping timeout: 480 seconds]
20:23e1eph4nt has joined #asahi-dev
20:31thelounge75713 has quit [Remote host closed the connection]
20:32e1eph4nt has quit [Ping timeout: 480 seconds]
20:34thelounge75713 has joined #asahi-dev
20:40e1eph4nt has joined #asahi-dev
20:48e1eph4nt has quit [Ping timeout: 480 seconds]
20:56e1eph4nt has joined #asahi-dev
21:34thelounge75713 has quit [Remote host closed the connection]
21:37thelounge75713 has joined #asahi-dev
21:39jluthra has quit [Remote host closed the connection]
21:39jluthra has joined #asahi-dev
21:47SSJ_GZ has quit [Ping timeout: 480 seconds]
22:06e1eph4nt has quit [Ping timeout: 480 seconds]
22:16e1eph4nt has joined #asahi-dev
22:24e1eph4nt has quit [Ping timeout: 480 seconds]
22:32e1eph4nt has joined #asahi-dev
22:36thelounge75713 has quit [Remote host closed the connection]
22:38thelounge75713 has joined #asahi-dev
23:38thelounge75713 has quit [Remote host closed the connection]
23:39e1eph4nt has quit [Ping timeout: 480 seconds]
23:44thelounge75713 has joined #asahi-dev
23:48e1eph4nt has joined #asahi-dev