#
…

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: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:34skmp__yeah I recall that, I took some notes
06:34skmp__(though i'm no longer directly involved in fex)
06:35skmp__there's one complication of mremap that wasn't accounted in our previous discussion there
06:35skmp__but nothing that can't be worked around - more so since userspace vma mappings are used
06:36skmp__s/used/kept
06:38skmp__though, I'm very uneasy of how many unhandled cases that approach has
06:38marcanAll approaches to this problem are going to be either incomplete or very difficult to cover all the cases :)
06:38marcanit's a difficult problem
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:39skmp__so maybe I overvalue how much games do the same
06:40skmp__it's a fun little problem to think before bedtime :P
06:40skmp__there's also the extra complication of interworking, even if the guest is happy and all
06:40skmp__we still need to be able to use host libraries in the same address space - say host opengl driver stack
06:41skmp__to transparently forward
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:43skmp__(s/supporting/exposing IG)
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:46skmp__though, conceptually, it would avoid (forward to userspace) all of those concerns
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
06:52skmp__I like* so much (damn today I keep mistyping, brb coffee + cat petting time)
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:02marcanbut that can probably be dealt with on a case by case basis
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:11jannaulet's hope so
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:43jannauon both machines the blessed port with uart
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
10:47jannaunot reproducible anymore
11:07mazjannau: pinging Joerg to make sure that this is on his radar wouldn't hurt.
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:49svenyeah, would be nice if we finally get t6k dart support in mainline
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:54skmp__opengl, vulkan
12:54skmp__that's all I care about
12:55skmp__@j`ey yeah, I'm just trying to figure out the upstreams right now
12:55skmp__and the relevant code / people to discuss
12:56Race has quit [Ping timeout: 480 seconds]
12:56skmp__there's some tricks that can be used to make it less work
12:57skmp__but one way or the other, if people want to have x86 emulation, 4K pages are a given
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)
12:59skmp__oh possibly
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:00skmp__which, technically it is, because i'm providing the vm
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:01marcanthey are already doing that
13:01jannauprobably harder to convince them to carry a 16k special kernel for apple silicon
13:01skmp__branding wise, it will look really bad
13:01marcanit's going to be harder to convince them to have 16K kernels as an alter- yeah what jannau said
13:01skmp__'ubuntu is 10% slower than osx - apple is right osx is best'
13:01skmp__no one likes that narative
13:01marcanwell, linux is already 10% faster than osx because osx is bad
13:02mazalso, if you think os-x is better, go use it. we're not presecriptive.
13:02skmp__well, 4k standar page size isn't really a 'standard'
13:02jannauonce 4k iommu support is upstream of course
13:02skmp__it's only been standard for a decade or so at best
13:02skmp__plus, 16k is the right size
13:02skmp__apple is right there
13:02skmp__4k is too small for the amount of ram we have
13:03skmp__and 16K is just so much more power efficient at the tlb cache level
13:03marcana more practical thing might be to teach linux how to decide on the page size at *boot time*
13:03skmp__(because it holds 4x as much mapped area)
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:03marcanand then maybe we can have multi-pagesize kernels and distros just ship that
13:03mpsuhm, so I have to make 64K kernel for neoverse-n1 machine with 512GB ram
13:03marcan(and it could still be a stepping stone towards mixed page sizes)
13:04skmp__@jannau The iommu has 4k page support?
13:04skmp__@mps that's how it used to be up to early 2000s
13:04skmp__IBM always used random page sizes
13:04skmp__microsoft used 1K for wince
13:04marcanskmp__: no, that's what the 4K support patch is for, working around that
13:04skmp__everyone just used 'whatever was best'
13:04mpsskmp__: yes, I rmember
13:05skmp__I member
13:05skmp__marcan: so it is not a strict hardware limit?
13:05skmp__if so, a boot option is the best 'hack' right now
13:05marcanit is a strict hardware limit, but DMA is special anyway
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:06skmp__Well, one could say that says more about the kernel, than the feature
13:06skmp__but anyways
13:06skmp__the point is getting this in front of the users atm
13:06skmp__not discussing how we got into this mess
13:07marcanI say just fake 4K in userspace first, see how far that gets you
13:07marcanit will be a lot easier and get you results much faster than any attempt at messing with the kernel
13:07skmp__uh, maybe
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__but doing it in userspace is a waste of time as well
13:07skmp__as it won't work for all solutions anyway
13:07skmp__so we'll have to dive into the kernel
13:07skmp__and after 16 hours of emulator programming, i'd rather chillax with some easy kernel work
13:07skmp__rather than this
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:08marcan"easy" kernel work lol
13:08marcanI still think you are vastly underestimating how hard this is on the kernel side
13:08skmp__have you seen what is involved in the emulation side?
13:08mpshm, F2FS still works only on 4K kernels
13:08marcanhave you seen what is involved in the kernel side?
13:08skmp__i've read large parts
13:08skmp__mostly to work around kernel bugs
13:09skmp__it's pretty easy to understand, simple code
13:09skmp__for the most part
13:09skmp__a bit love for gotos and labels but oh well
13:09marcan8573 instances of "struct page", all of which could assume pages are fixed size :)
13:09skmp__that reminds me I need to notify someone about that signal handling bug I found
13:09marcanbut hey, if you think it will be easy to teach Linux multiple page sizes, go for it!
13:09skmp__Tech is easy man
13:09skmp__it's been like that for a long time now
13:09skmp__the politics make it hard
13:10skmp__code is ephemeral anyway
13:10skmp__you write it now, delete it tomorrow
13:10skmp__that's the nature of it
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:10skmp__yea that's what I'm afraid there
13:10marcanyou should be
13:10skmp__Well, I disagree
13:10skmp__A project where contributors are afraid of politics is uh
13:10skmp__a project
13:11marcanI mean given the reality of how Linux is developed
13:11skmp__but that doesn't change reality much
13:11marcanI'm not saying it's the best state of affairs
13:11marcanI'm saying you should be scared given the current state of affairs :)
13:11marcanso I would highly suggest having a long discussion with the mm folks about this
13:11marcanabout what is practical and what isn't
13:11marcanbefore trying anything
13:11skmp__yes, possibly
13:11skmp__well, I want to do it mostly for the lulz tbh
13:11skmp__You know my wish for userspace paging anyway
13:11marcanyeah lol
13:11skmp__though possibly a BSD variant is best
13:12skmp__for that
13:12skmp__(or fuscia)
13:12skmp__(but eh, google, ...)
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:12skmp__well, that's why I'm here
13:12skmp__I want to have popcorn time for me
13:12skmp__and also maybe be of use
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:13marcan(thus: you need to talk to mm folks)
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:13skmp__no need for source or anything
13:14skmp__will hardly be the first time
13:14skmp__but I think the point is more of how to not waste time and energy on fun and possibly meaningless endeavours
13:15skmp__got any more specific contact for the 'mm folks' ?
13:15marcantalking to the mm folks would be a good idea to figure out what is meaningful ;)
13:15skmp__Dear mm folks, .. :P
13:16marcannot really, but MEMORY MANAGEMENT in MAINTAINERS will get you a name and a special purpose mailing list ;)
13:17marcan(feel free to cc asahi@lists.linux.dev, we care about this!)
13:17skmp__thanks a ton
13:18skmp__in another note, how's the gpu side of things coming along?
13:18skmp__I'd really love to take a look there
13:18skmp__the name (AGX?) is peculiar
13:18skmp__it kind of implies some imgtec lineage
13:18marcanyou want to talk to Lina about that (she's in #asahi-gpu)
13:18marcanoh it definitely has PowerVR lineage
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:25jannaumaybe even just a tested by once asahi includes it and is pushed to asahi-dev
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:40skmp__that's so cute
13:40skmp__imgtec got a break after all
13:41skmp__after all these years of being a mee-also thing
13:41skmp__good for them
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:09marcanjannau: Apple calls it AGX everywhere except the device tree
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:45M4t64[m]may be related, but ane is referred to as sne internally
14:48rpirea has quit [Quit: rpirea]
14:49M4t64[m]*at the firmware level
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
…