#
…

2021-02-05

00:00brandas has joined #asahi
00:00brandas has quit [Remote host closed the connection]
00:01brandas has joined #asahi
00:22brandas has quit [Quit: quit]
00:22brandas has joined #asahi
00:24stemnic5 has joined #asahi
00:24brandas has quit [Client Quit]
00:25stemnic has quit [Read error: Connection reset by peer]
00:25stemnic5 is now known as stemnic
00:25brandas has joined #asahi
00:27brandas has quit [Client Quit]
00:28brandas has joined #asahi
00:43brandas has quit [Quit: quit]
00:44brandas has joined #asahi
00:45brandas has quit [Client Quit]
00:45brandas has joined #asahi
01:20Raqbit has quit [Ping timeout: 256 seconds]
01:36_whitelogger has joined #asahi
01:45_whitelogger has joined #asahi
01:53Raqbit has joined #asahi
01:53rwhitby has quit [Quit: ZNC - http://znc.in]
01:57rwhitby has joined #asahi
02:08KindOne has quit [Ping timeout: 272 seconds]
02:15KindOne has joined #asahi
02:44Tokamak has quit [Ping timeout: 265 seconds]
02:47Tokamak has joined #asahi
02:59thestr4ng3r has quit [Read error: Connection reset by peer]
03:00thestr4ng3r has joined #asahi
03:26PhilippvK has quit [Ping timeout: 258 seconds]
03:26phiologe has joined #asahi
04:28furkan has quit [Remote host closed the connection]
04:40Tokamak_ has joined #asahi
04:43Tokamak has quit [Ping timeout: 264 seconds]
04:49marvin24_ has quit [Ping timeout: 258 seconds]
04:49marvin24 has joined #asahi
04:53Tokamak_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
05:03Tokamak has joined #asahi
05:11Tokamak has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
05:21mxw39 has quit [Remote host closed the connection]
05:21mxw39 has joined #asahi
05:32Tokamak has joined #asahi
06:06brandas has quit [Quit: quit]
06:07brandas has joined #asahi
06:08brandas has quit [Client Quit]
06:09brandas has joined #asahi
06:11brandas has quit [Client Quit]
06:17brandas has joined #asahi
06:31VinDuv has joined #asahi
06:35Tokamak has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:37psydruid has joined #asahi
06:53maor26 has joined #asahi
06:57Namidairo has quit [Quit: ZNC - https://znc.in]
06:57acelogic2 has quit [Ping timeout: 256 seconds]
06:58Namidairo has joined #asahi
07:15mndza has joined #asahi
07:29VinDuv has quit [Quit: Leaving.]
09:00dyniec[m] has quit [Quit: Idle for 30+ days]
09:00f4n4tix[m] has quit [Quit: Idle for 30+ days]
09:00nufflee[m] has quit [Quit: Idle for 30+ days]
09:00Standemonium[m] has quit [Quit: Idle for 30+ days]
09:00LeonardJanisRobe has quit [Quit: Idle for 30+ days]
09:00scubasteve1 has quit [Quit: Idle for 30+ days]
09:58baryluk has joined #asahi
10:15raster has joined #asahi
10:20qyousef has quit [Ping timeout: 240 seconds]
10:27jato has joined #asahi
10:32amw has quit [Ping timeout: 258 seconds]
10:49amw has joined #asahi
11:02amw has quit [Ping timeout: 246 seconds]
11:57sbingner has quit [Ping timeout: 260 seconds]
12:35sbingner has joined #asahi
12:42sbingner has quit [Ping timeout: 258 seconds]
13:32amw has joined #asahi
13:45Axenntio has joined #asahi
13:47Axenntio has quit [Remote host closed the connection]
13:57Axenntio has joined #asahi
14:00Axenntio has quit [Client Quit]
14:03acelogic has joined #asahi
14:07amw has quit [Ping timeout: 264 seconds]
14:07modwizcodemarcan: how did you figure out the interrupt config register changes for the UART? I see in AIC test you messing with flags including a set called crash?
14:08marcanit was... confusing and complicated
14:08marcansince I was trying to debug this using the serial itself for communications
14:08marcaneventually, as you can see, I resorted to blobs of asm to do things locally and capture register values before returning control to python
14:09modwizcodeyeah. But was there any method to what you chose to poke?
14:09Axenntio has joined #asahi
14:10Axenntio has quit [Read error: Connection reset by peer]
14:10marcanjust try random bits, all, none, binary search manually to see which ones break things...
14:10marcanthat kind of stuff
14:11Axenntio has joined #asahi
14:11modwizcodealso I've been a bit confused by the IPI handling, you say the AIC supports too (so called self and other), but i dont see register definitions for two, nor see the distinction
14:12Axenntio has quit [Remote host closed the connection]
14:12modwizcodeYou have the virtual IPIs but thats not important to non-linux code (neat idea tho)
14:13modwizcodeDid the config for the UART just become kinda obvious once you poked at it a bit?
14:15marcanthe "self" IPI is 0x80000000 in the trigger and status registers
14:15marcanthe "other" IPI is 1<<cpu in the trigger register, and 1 in the status/mask registers
14:15Calchan has quit [Ping timeout: 264 seconds]
14:15marcanthey are not symmetric in how you trigger them, but they are otherwise basically the same thing
14:16modwizcode0x80000000!? that's not part of the AIC?
14:16marcanthat's the *value*
14:17marcanthe top bit is "self", all the other bits are "IPI another CPU"
14:17modwizcodealao theres some IPI macros using 0x5000+something that are unused in the lnux driverr
14:17modwizcodethat seems weirdly specific but i guess its easy
14:17marcanand yes, 5000+x gives you another CPU's view of the registers
14:17modwizcodeI thought it was two true IPIs
14:17marcanso you can "self" another CPU, which isn't self any more
14:17marcanwhich is why they are really just two IPIs
14:17marcanbut clearly "self" is intended as self
14:18marcanit's two *per-cpu* IPIs
14:18marcanI mean how would two true IPIs work
14:18modwizcodethats very strange but yeah clearly a self IPI
14:18marcanyou need at least 8 targets
14:18modwizcoderight right
14:19modwizcodecuriously why does linux need more?
14:19marcanlinux sends 7 different messages via IPIs
14:19marcanand I guess this is the first arm64 platform that can't do that in hardware
14:19modwizcodethe AIC is so nive and simple compared to the GIC
14:19marcanI really like it
14:19marcanit's so beautifully simple
14:19modwizcodeits perfect lol
14:20marcanbbl, dinner :)
14:20modwizcodeThe GICv3 appeara to move more into system registers ehich is weird... luckily I don't have to use it :)
14:22Axenntio has joined #asahi
14:23Axenntio has quit [Remote host closed the connection]
14:24mazmodwizcode: sysregs are a lot more better than MMIO in a number of cases.
14:24mazs/more//
14:24modwizcodeI'm sure its useful but ARM insists on using both which I find to be the worat option
14:24mazand it allows the whole thing to scale to an insanely large number of CPUs, which you can't really do with the AIC scheme.
14:25mazARM doesn't *insist*, and that's the main problem.
14:25mazARM let you fuck up your system as much as you want!
14:25opticronthe issue I have with system registers is that the compiler either has to be made aware of them or you have to sprinkle raw instructions into your code
14:26mazno, you don't. you write wrappers once, and you use them consistently.
14:26modwizcodethe issue I have is the decompiler has to know about them or life sucks
14:26mazand you have similar issues with MMIO. do I need a barrier? what memory typoe?
14:26modwizcodeAlso ARM organizes them in an annpying way
14:27modwizcodeyou still need barriers with sysreg's generally from most arm docs ive seen
14:28mazof course you need barriers. it's just not different from using MMIO.
14:37Tokamak has joined #asahi
14:40acelogic has quit [Ping timeout: 272 seconds]
14:47roxfan2 has joined #asahi
14:50roxfan has quit [Ping timeout: 265 seconds]
14:53Guest14662 has joined #asahi
15:01Guest14662 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
15:04acelogic has joined #asahi
15:24davidrysk[m]why do I keep getting panics on macOS shutdown, with the AIC in the backtrace....
15:33jannaunice, xz decompression in m1n1 works. 20% faster kernel loading. no direct support for Image.xz in the kernel though
15:33modwizcodedavidrysk[m]: I wonder if it somehow accidentally removes the interrupt handling code before it kills all interrupts
15:39mechpilotace has joined #asahi
15:48Calchan has joined #asahi
16:00dwhatley[m] has quit [Quit: Idle for 30+ days]
16:00josiahmendes[m] has quit [Quit: Idle for 30+ days]
16:00mcnight[m] has quit [Quit: Idle for 30+ days]
16:00mofux[m] has quit [Quit: Idle for 30+ days]
16:02vimal has quit [Remote host closed the connection]
16:04marvin24 has quit [Ping timeout: 258 seconds]
16:04marvin24 has joined #asahi
16:06mofux[m] has joined #asahi
16:26modwizcodeOne nice thing about system registers vs. MMIO is that when defining handlers you have access to the CPU state itself. Meaning if you have local CPU versions of an MMIO register things seem painful...
16:26Tokamak has quit [Ping timeout: 246 seconds]
16:26modwizcodeI'm just going to do this wrong intentionally until I decide on a correct way that doesn't suck.
16:28Axenntio has joined #asahi
16:29opticronmodwizcode, yeah, instead of figuring out which block of the MMIO applies to the current CPU...
16:29Tokamak has joined #asahi
16:29mazanother crutial thing is that it allows trapping without messing with the page tables.
16:30modwizcodeThe issue is things like the interrupt reason register are a constant address but will have to behave different for each core since multiple cores can take an interrupt (reading it is also the ack, a decision I dislike overall too)
16:30Axenntio has quit [Client Quit]
16:31opticronthe read is an implicit ack on AIC?
16:31mazGICv2 solved that by having a set of banked register, but that was a huge pain to implement, and required early address decoding inside the CPU. terrible idea.
16:31modwizcodeopticron: yes it seems so
16:32modwizcodeI'm looking at the qemu GICv3 code (v1 and v2 are basically the same code and are... not helpful to look at) and it solves this problem in a way I dislike also
16:32Axenntio has joined #asahi
16:33Axenntio has quit [Client Quit]
16:33opticronyeah, I've written a GICv3 driver
16:33opticronit's an interesting mashup of sysreg and mmio
16:36roxfan has joined #asahi
16:37modwizcodeIt has a seperate struct for per-cpu state which is obvious. But it initializes it by creating it during construction of the parent GIC device then looping through the CPU count in QEMU and grabbing them from qemu_get_cpu and using that to assign their CPU reference.
16:38modwizcodeIt's a horrible way of doing things imo, because it precludes things like having an ARM system with a GIC and also having another type of CPU running too. Not sure if other things preclude that also but it's icky
16:40roxfan2 has quit [Ping timeout: 276 seconds]
16:42josiahmendes[m] has joined #asahi
16:43marcanmodwizcode: this is why AIC knows the current CPU and displays it its registers
16:43marcanI wonder how that's done in hardware
16:43marcanI suspect they may be abusing the top address lines for this, though I'm not sure
16:44marcanopticron: yeah, there is a single "reason" register that returns the lowest firing irq number when read, and simultaneously masks it
16:44marcanwell, there is one per CPU, and one special address that maps to your CPU
16:45modwizcodeI'm pretty sure that the way I'd do it is that each core has a set of local registers, and there's an arbiter or something that lets you also access them via the bus. But of course I don't design cores really so who knows
16:46marcanI think AIC really is just a global block
16:46marcanactually let me try something silly...
16:47modwizcodeThat is however, what I think my solution in QEMU is going to be. A special function you can use to wire up each CPU to it. Makes more sense for the SoC to drive the connections rather than the interrupt controller. It's a generic peripheral (I guss GIC gets a bit of a pass since with CP registers it's definitely ARM specific), but AIC is nice enough that I could see someone using this in other ways :)
16:52modwizcodeI suppose another way is to wire it up with aliases such that each CPU's view of the AIC is wired up with an alias over the per-cpu registers pointing to it's CPU specific memory region. I've seen other code do something like that and that might be cleaner actually
16:54Axenntio has joined #asahi
16:54Axenntio has quit [Remote host closed the connection]
17:02irl25519 has joined #asahi
17:05marcanoh this is a fun quirk
17:05marcanmaz: you know how I was talking earlier about the timers? and how guest timer FIQs get masked somewhere and only delivered once, and that mask sticks when you turn on TGE?
17:06marcanturns out it sticks by accident. an isb makes it fire a FIQ again (and FIQ storm if not handled, as you would expect from TGE=1 mode)
17:07marcanneeds the isb though, running a bunch of code does nothing. so isb "kicks" something into re-evaluating that FIQ state in light of the new TGE setting
17:07marcanthis is really sounding like those timers are wired deep into the instruction pipeline...
17:07mazmarcan: right. so we definitely need to find a way to mask the bloody interrupt before it is injected into the guest.
17:07marcanoh in guest mode it masks itself
17:08marcanit's just that the way that mask "stuck" when I flipped TGE seemed to be a quirk of the instruction pipeline
17:08modwizcodeA lot of arm stuff requires isb before cp writes are considered to be visible
17:08marcananyway, I'll look for that mask register
17:08marcanit's just interesting that isb kicked the fiq into working again
17:09modwizcodeDid it kick the fiq or did it kick the TGE?
17:09mazflipping TGE definitely needs some heavy handed sync. usually, it is followed by an exception return, so you get that for free...
17:09marcanmodwizcode: good question...
17:09marcanmaz: that would make sense
17:09mazwe only from it back when reaching the host on exit, and there is a metric butload of isb there...
17:10mazs/from/flip/
17:10modwizcodeTGE confuses me greatly. I can read all the docs to see how the virtualization features *work* but how I'm intended to use most of them is a mystery. Especially when combined with VHE (is that the right name?)
17:10marcanthis is why m1n1 is fun, it's so dumb and simple you get to experience the wonders if "no barriers, anywhere" :)
17:10modwizcodere: barriers, see my github issue :p
17:10marcan(except for places where I've already seem the CPU speculate stuff into madness, and had to add them)
17:11modwizcodeMy favorite thing was earlier when I was testing and didn't realize the board I was using had smp setup, so all the cores started running m1n1 and I got like m11nn11
17:11mazmodwizcode: it's actually pretty simple. E2H+TGE makes EL1 disappear. Most sysregs in _EL1 become _EL2.
17:11mazso you can run EL1 code at EL2 transparently.
17:11modwizcodeYes but why do I need E2H *and* TGE?
17:12mazyou get extra accessors to fish out EL1 sysregs from EL2.
17:12mazbecause ARMv8.0 doesn't have VHE, so you need to be able to run non-VHE.
17:12winocmyou’d have to access some of them using _EL12 to get the unbanked register
17:12mazand TGE has its own meaning when !VHE.
17:13modwizcodeRight but what's the problem with E2H implying TGE
17:13mazof course M1 is violating the architecture by not implementing E2H==0.
17:13modwizcodeIt doesn't implement E2H==0?
17:13mazif E2H implies TGE, how do you enter a guest?
17:13marcanTGE is so that guests can go EL0-EL1
17:14modwizcodeSee this is the confusing part of having register descriptions with no conception of how they're used.
17:14marcanthe "problem" with ARM virtualization is that EL0 is used by *both* the level 2 HV *and* the guest
17:14marcanso how do you know which EL0 is which
17:14winocmEL0&2 versus EL0&1 translation regimes
17:14modwizcodeARM virtualization makes x86 virtualization look sane from what I've seen. Although I don't understand x86 virtualization well enough to say that :p
17:14mazwell, it's not x86's flavour of virtualisation.
17:14winocmer, the other way around EL2&0, I misremembered
17:15mazanyway, the design goal for VHE was to take an unmodified EL1 OS, and run it at EL2.
17:15mazobviously, that goal complicates the hypervisor.
17:16mazspecially if that hypervisor has to handle nVHE as well.
17:16marcanthe timers confuse me now though, because... okay, so we have HYP and non-HYP timers, non-HYP do this automasking thing... but not with TGE=1... so now with TGE=1 the hypervisor "owns" all timers and has to deal with them?
17:16marcanwhich would mean when context switching to TGE=1 we need to take over the timers and save state (or at least mask them)
17:16winocmfor external reference
17:16marcanI guess you need to do that to context switch VMs anyway...
17:17mazyou always need to save/restore the timer state on context switych.
17:17marcaneven on VM->HV-EL0 userspace context switch?
17:18mazyou could detect that particular case, but that's pretty rare, and hard to identify.
17:18mazKVM saves everything on preemption.
17:19mazI had a prototype doing some lazy stuff a la FPSIMD, but it was complicated for no real performance benefit.
17:19marcanin this case we wouldn't be able to do that case without saving the timers for this reason
17:19marcanbut yeah
17:20marcananyway, sleep :)
17:20marcanI'll test your patch tomorrow
17:21mazthanks, and good night!
17:32VinDuv has joined #asahi
17:32irl25519 has quit [Quit: irl25519]
17:33poppoppenguin has joined #asahi
17:43sbingner has joined #asahi
17:43vimal has joined #asahi
17:46sbingner has quit [Excess Flood]
17:49sbingner has joined #asahi
18:07mndza has quit [Ping timeout: 265 seconds]
18:08raster has quit [Quit: Gettin' stinky!]
18:18dagb has quit [Remote host closed the connection]
18:26Axenntio has joined #asahi
18:27Axenntio has quit [Client Quit]
18:30mxw39 has quit [Read error: Connection reset by peer]
18:36mxw39 has joined #asahi
18:36sbingner has quit [Ping timeout: 258 seconds]
18:41sbingner has joined #asahi
18:59GlanzmannIs there anything better on macbook pro than the air other than the crippled keyboard?
18:59GlanzmannOr is it the same hardware?
19:01davidrysk[m]Glanzmann: better audio, better cooling, base model of air has 1 fewer GPU core
19:01davidrysk[m]regarding the keyboard, they did put the physical esc key back
19:01bastiliansame hardware, minus the fan. which seems to make all the difference. there are few videos on youtube of people putting in thermal pads to make the bottom a heatsink for the CPU and it seems to be able to push as hard as the pro like that.
19:01davidrysk[m]yeah, though the base gets significantly hotter when you do that.
19:02davidrysk[m]there's threads on macrumors about it
19:02Glanzmanndavidrysk[m]: What is better with the audio? Better speaker? I come from a lenovo t490, everything is better. :-)
19:02davidrysk[m]"high dynamic range" speakers, and "studio quality" microphones
19:02bastilianoh, yeah, i think they said ~60C
19:02GlanzmannI see. I don't know about you guys, but my macbook air (I use it now for 6 weeks) never gets hot.
19:02davidrysk[m]a macbook air will throttle after 10 minutes at full tilt.
19:02GlanzmannUnless I start qemu. And one other programm I don't recall.
19:03Glanzmanndavidrysk[m]: Oh I see, I don't need that.
19:03davidrysk[m]if I'm compiling a large project at -j9, or use qemu or something similar, it will get hot and eventually throttle
19:03davidrysk[m](or in my case, fans spin up)
19:04GlanzmannMini also has a fan, hasn't it?
19:04krbtgttoo bad the battery life on the mac mini is non-existent
19:04krbtgtyou unplug the power cable and it turns off, so much for M1 battery efficiency!
19:05GlanzmannHave you guys already tried the corelliumhq kernel? Have you benchmarked the power consumption? I gave it yesterday a spin. No audio, but you can perfectly work with it. But I had it on a power cord.
19:18acelogic has quit [Ping timeout: 258 seconds]
19:20roxfandoes it do any power management?
19:23GlanzmannI saw soemthing, but I'm not really sure.
19:29Tokamak has quit [Ping timeout: 264 seconds]
19:32Tokamak has joined #asahi
19:45acelogic has joined #asahi
19:49carlosn has left #asahi [#asahi]
19:57jordan_ has joined #asahi
20:02tsrt^ has quit []
20:22raster has joined #asahi
20:39jannauno PMUv3 (Arm performance monitors) on M1 :(
20:51vimal has quit [Remote host closed the connection]
20:55vimal has joined #asahi
21:05never_releasedjannau: macOS doesn't implement it for VMs
21:06never_releasedbut I can assure you that a bunch of perf counters is present :P
21:06raster has quit [Quit: Gettin' stinky!]
21:07jannaunever_released: PMUver bits in ID_AA64DFR0_EL1 in EL2/m1n1 are b'1111' IMPLEMENTATION DEFINED
21:08jannaui.e. apple's PMU needs to be reverse engineered for perf support in linux
21:09never_releasedreverse engineered?
21:09never_releasedOSS XNU should have the bits
21:10jannauI wouldn't have expected that
21:17jannauthanks, found it myself
21:19VinDuv has quit [Quit: Leaving.]
21:53acelogic has quit [Ping timeout: 256 seconds]
22:04danilonc has quit [Ping timeout: 240 seconds]
22:07danilonc has joined #asahi
22:15davidrysk[m]yeah XNU has a whole pile of system registers for performance counters
22:15davidrysk[m]between that and osfmk/arm64/monotonic_arm64.c
22:18acelogic has joined #asahi
23:01djb has quit [Read error: Connection reset by peer]
23:02djb has joined #asahi
23:03raster has joined #asahi
23:06amw has joined #asahi
23:07raster has quit [Client Quit]
23:11raster has joined #asahi
23:12raster has quit [Client Quit]
23:15raster has joined #asahi
23:31amw has quit [Ping timeout: 256 seconds]
23:37raster has quit [Ping timeout: 272 seconds]
23:51raster has joined #asahi
23:51qyousef has joined #asahi
…