#
…

2021-09-23

00:09bgb has quit [Ping timeout: 480 seconds]
00:17bgb has joined #asahi
00:40bgb has quit [Ping timeout: 480 seconds]
00:43yuyichao has quit [Ping timeout: 480 seconds]
00:49bgb has joined #asahi
00:58bgb has quit [Ping timeout: 480 seconds]
01:07bgb has joined #asahi
01:15bgb has quit [Ping timeout: 480 seconds]
01:17___nick___ has quit []
01:19___nick___ has joined #asahi
01:22yuyichao has joined #asahi
01:24bgb has joined #asahi
02:29bgb_ has joined #asahi
02:31bgb has quit [Ping timeout: 480 seconds]
02:43phiologe has joined #asahi
02:47PhilippvK has quit [Ping timeout: 480 seconds]
03:14marvin24_ has joined #asahi
03:17marvin24 has quit [Ping timeout: 480 seconds]
03:38yuyichao has quit [Ping timeout: 480 seconds]
04:23yuyichao has joined #asahi
04:26chadmed has quit [Quit: Konversation terminated!]
04:51chadmed has joined #asahi
06:36marcanalright, might take a bit to set up, but let's see if I can do the teardown/USB debug stream today
07:01mazj_ey: that name doesn't have to be unique.
07:02mazj_ey: this name is just a vague indication of where the interrupt is coming from, but is not meant to be a debug infrastructure. we have /sys/debug/irq for that.
07:25chadmed has quit [Quit: Konversation terminated!]
07:29j_eymaz: thanks, I assumed it had to be unique
07:30mazj_ey: nah, it's just some userspace candy for /proc/interrupts
07:32j_eymaz: and the in-memory state thing, I started to try to remove, but decided it was better to get a first version on the mailing list first
07:40mazj_ey: fair enough. TBH, I don't think there is any major issue with this driver (we have far worse in the tree already).
07:40mazj_ey: I'm only trying to make sure that M1 is as clean as possible from an irqchip perspective so that I can point people at it and consider retiring.
07:41j_eymaz: :-)
07:45sventhere's still this interesting question of how to handle these 7 or so AIC interrupts that can be distributed freely to the GPIO pins.
07:46svenprobably doesn't matter for the first version (and maybe not at all because we'll only have to use like two or three gpio interrupts anyway)
07:48svenalyssa: so either this dwc3 has a quirk where you can't stop commands (ugh) or i have to actually start looking into this usb phy (ugh)
07:48svenerm.. *can't issue stop commands for device mode transfers
07:48mazsven: huh... doesn't the GPIO block expose a mux where any 32 pin can generate an interrupt that is then relayed by a single AIC interrupt?
07:49mazbecause that's what the driver implements...
07:49linearcannon has quit [Read error: Connection reset by peer]
07:49sventhis thing has 200+ pins and I thought you could assign any pin to any of its 7 AIC interrupts
07:50mazif the GPIO block actually implements a 1:1 mapping between a single pin and an AIC interrupt, then the driver is completely wrong.
07:50svenif you need less than 7 interrupts you can do a 1:1 mapping
07:51j_eyyou can map the pins to one of 7 interrupts
07:51mazsure, but the question is whether you can have a a 32:1 mapping or not.
07:51linearcannon has joined #asahi
07:52sveni though you could even have a 200:1 mapping
07:52sven*thought
07:52j_eyyes me too
07:53mazis there any writeup about this thing?
07:53j_eythe code :p
07:53sveni wish...
07:54_jannau_each pin config has 3 bits for interrupt control. so each pin can mapped to one of the 7 aic irqs or no irq
07:55maz_jannau_: OK. and you have a status per output interrupt to find out which interrupt has fired, I guess.
07:57mazin which case, I don't the the harm in having the driver evenly spreading the input pins over the 7 output lines, unless we want to play the priority game...
07:57_jannau_yes, there is for irq a bitfield for all pins to determine which pin fired
07:57_jannau_for each irq
07:57j_eythat's what the REG_IRQ() macro reads ^
07:58j_ey(and the "unused" variable unsigned irqgrp = 0;, is where we would change the value of the group)
08:00mazgroup 0 meaning no interrupt I guess?
08:01j_ey_jannau_: which group is no irq?
08:02_jannau_I think group 7 but I'm not sure
08:02j_eyI think it might be 7 actually, if so I can remove some other "hacks"
08:04j_ey(maybe, would have to test it ofc)
08:04_jannau_iirc group maps without offset of 1 into irq array and the irq status registers
08:05j_ey_jannau_: sorry what do you mean 'without offset of 1'?
08:07_jannau_if group 0 maps to aic_irqs[0]
08:11j_ey_jannau_: I wonder if you can ack by setting the group to 7 (assuming thats the no-irq), rather than setting the irq type in the register
08:13_jannau_I suppose you can mask via setting the group to no-irq, ack seeems to need a write in the irq status bit
08:17bgb_ has left #asahi [WeeChat 3.0.1]
08:28j_eysorry yeah I meant mask/unmask not ack
08:43mazj_ey: I guess that by doing that, you'd lose the pending state for edge interrupts. bad idea.
08:45j_eymaz: then my question is, can I get the "type" of an interrupt from irq_data?
08:47mazj_ey: you can get it indirectly, from irqdesc.
08:51mazj_ey: but can't you read the state from the actual register?
08:54j_eymaz: the code currently sets the type-of-interrupt field in the register to OFF to mask the interrupt, so when unmasking it needs to know what the type previously was
08:56mazj_ey: I'm worried that this leads to lost interrupts. the expectations are that if an edge lands while the interrupt is masked, it fires on unmask.
08:57mazit is likely that setting it to OFF disables the latch, and you lose the edge that landed while masked.
08:59j_eymacOS seems to be handling it like this btw. and I'm not sure how I can test the edge behaviour :/
09:01mazj_ey: how do you test it the first place?
09:01j_eymaz: im testing with spi/keyboar
09:02mazdoes the SPI controller signal a level or dege interrupt?
09:04mazmeh. if there is no other way, we'll have to live with it I guess.
09:06mazbtw, the function you're looking for is irqd_get_trigger_type(), but you'll have to have use the corresponding setter in your set_type callback.
09:06j_eymaz: thanks!
09:08maz(\o/ UART and USB2 over a single USB-C connection -- I reached the 21st century!)
09:10j_eylooking at corelliums dts, there are some EDGE interrupts in here
09:10mazdo they have the power button on the mini?
09:10mazthat'd be an ideal test case.
09:13sventhe power button interrupt comes from the SMC iirc
09:13svenbut you can use that TI USB PD chip. it has an edge interrupt
09:13svenand if you just unplug/plug something to the secondary usb port it will fire
09:17j_eysven: youre using IRQ_TYPE_LEVEL_LOW in your dt for the ti
09:17svenoh... duh.. edge
09:17svensorry, nevermind
09:18sven(the plug/unplug interrupt is edge trigger, but that's for the interrupt controller inside the TI chip)
09:23nskl has joined #asahi
09:29nsklaus_ has quit [Ping timeout: 480 seconds]
09:34roxfan has quit [Ping timeout: 480 seconds]
09:43tophevich[m]marcan: looking at the clock, I'd guess your "teardown/USB debug" stream wont happen today right?
09:53linearcannon_ has joined #asahi
09:53linearcannon has quit [Read error: Connection reset by peer]
09:54linearcannon_ has quit [Read error: Connection reset by peer]
09:54linearcannon has joined #asahi
09:55linearcannon_ has joined #asahi
09:55linearcannon has quit [Read error: Connection reset by peer]
10:00linearcannon_ has quit [Read error: Connection reset by peer]
10:00linearcannon has joined #asahi
10:01linearcannon_ has joined #asahi
10:01linearcannon has quit [Read error: Connection reset by peer]
10:06marcanahaha, foiled by apple
10:06marcanapparently this thing uses TR6 screws
10:06marcanI have down to TR7, then just T6 for smaller
10:06* marcanplaces an order for a proper screwdriver set...
10:07marcantophevich[m]: it would've started ~now were it not for... this problem
10:07tophevich[m]ifixit, or where do you order?
10:07j_eynothign a hammer cant fix
10:07marcanyeah, I just got the ifixit one on amazon
10:10svencan't find until you finally figure out wtf that usb pd thing does
10:10armarcan: what are you disassembling?
10:10marcana second mac mini
10:11marcanI'm going to scope out the USB lines to try to figure out the mystery of why the dwc3 thing locks up on internal hotplugs but not external ones
10:11marcanit makes no sense
10:11sveni think it just doesn't see the "new usb device connected" event :/
10:11marcanthat's not a thing though
10:11sven(which equally makes no sense)
10:12sveniirc in gadget mode it doesn't even get the "usb device disconnected" event
10:12arheh. i've seen the insides of the "devkit", and the pcb was the size of the intel mini, but almost all traces were on the inside layers of the pcb
10:12ar(also, the pcb was mostly empty)
10:12ari wonder if the production one is any different
10:13j_eywasnt the devkit an ipad in a mini case? (ish)
10:14marcanthere is a choke on the way of the USB lines
10:14marcanbetween the PD chip and the M1
10:14marcanso I know those are probeable
10:14arj_ey: the cpu iirc was from the then-current ipad, but i think it had more ram
10:16marcanthe production pcb is quite smaller than the intel one
10:28marcananyway, the screwdrivers should arrive tomorrow... though tomorrow I have some stuff to do, so I'm not so sure if I'll have time, we'll see
10:29marcanworst case, monday (busy weekend)
11:02nskli was wondering, are you folks expecting the wifi driver on macbookpro m1 to be especialy tricky to create ? or on the opposite, are you expecting it to be a relatively straightforward to do ? (like, for example, if it's well documented, or somehow similar chip being already well supported on linux ?)
11:02j_eypipcet[m] has it working I believe
11:02j_eyi think with only minor tweaks + the firmware that you need to grab from macOS
11:03nsklit already started working ? great news ..
11:04nsklwill there be many steps needed to grab relevant blobs to import from macos to linux side ?
11:05nskli mean beside the wifi stuff you've just pointed out, will there be more firmware to get and import ? is it a one shot -kind of overall general all encompassing firware to grab- or will it be many little separated ones ?
11:05j_eynskl: iboot loads all(?) the other firmware for us
11:06marcannskl: it's not a new driver
11:06marcanit's a standard broadcom fmac chip
11:06marcanit just needs some patches due to some custom apple silliness and slight silicon differences
11:06marcancorellium already did that ages ago, someone just needs to go through and clean up the mess and submit it
11:07marcanas for the firmware, I'll probably make the installer grab it from the running OS and put it somewhere for the installed OS to use
11:08marcanthe same chip is used in some Intel macs fwiw, so this isn't even M1 specific
11:08j_ey"10 files changed, 371 insertions(+), 75 deletions(-)" for the corellium wifi patch
11:08svenyeah, the corellium patch probably just needs to be split from a single commit to three or four of them and it needs additional code i think to grab the mac address from the device tree
11:08nskli thought corelium port had no wifi, and no internal ssd support too, requiring us to use an external drive, among a few other shrtcoming, but maybe it was their first release and since then things improved that i didn't know about.
11:08marcanand general cleanup/rewrites :p
11:09svenprobably
11:09marcanthey added wifi later
11:09svenbut shouldn't be a big deal
11:09nskli see, thanks for the answers.. lots of fast progress lately .. that's awesome
11:10marcanthe main problem with the corellium port is that it was a PoC port made with no intention of upstreaming, they just wanted a validation guest for their proprietary hypervisor
11:10marcanso they got lots of things to work, but lots of it in crazy ways that needed to be redone
11:11nsklthat's the impression i had too, that's also why i stayed away from it, prefering to wait for asahi and proper port
11:11marcanthere's a whole pile of drivers on the review pipeline already, I should send pmgr soon too
11:11marcanmight see about writing the cpufreq thing tonight if I have nothing else to do, seeing as the hardware hacking stream was foiled by Apple's screws
11:11* svenshould send tipd v2 and i2c as well
11:12j_eysven: the new approach with the split looks also fine I think
11:12svenyeah, and since heikki prefers that separate interrupt for the apple chip it also became a bit simpler imho
11:12sven*interrupt handler
11:13svenalso less chances of messing up some tps chip with weird quirks somewhere ;)\
11:14marcansven: can you describe the phy/xhci fail in a bit more detail? just want to have the info before I bring out the scope
11:15svenin gadget mode: if you disconnect the cable dwc3 never submits an USBDisconnected event and if you plug it in again you also get no USBReset or USBConnectionDone event
11:15marcanbut it works on the other side, right?
11:15svenin xhci mode: if you disconnect the cable xhci sees a disconnected event but never gets another cable connected event. the port status indicates that the correct cable status though
11:15svenif I use a dumb usb-c -> usb-a adapter and i disconnect the usb-a everything works (in host mode)
11:16marcanand in gadget mode leaving VBUS on works for me
11:16marcanand this gets fixed with a phy/dwc3 reset?
11:17svenwith a dwc3 reset, yes
11:17svenit also usually gets fixed with a partial phy reset (i.e. not what mac os, but just setting two reset bits)
11:17svenbut that can sometimes mess up dwc3 completely
11:17marcanI'm going to do a quick check on the usb pins with a scope externally on my normal M1, see what happens there
11:17marcanis there some tipd poking necessary anyway?
11:17marcan(e.g. under m1n1)
11:18svenyou just need to send that SPSS command (like m1n1 does) and then everything is autonomous
11:18svenmacos always pulls the entire PHY into reset when a cable is disconnected and tears down xhci completely
11:18sventhen when you connect a cable it just brings everything up again
11:19sven(it's pretty easy to see with that tracer you merged)
11:20marcanit stinks of hardware bug so much, but I just don't understand how it's even possible
11:20marcanlike does the tipd glitch the phy or something?
11:21marcansven: stupid idea... what about the SMC I2C?
11:22marcanis it possible the *SMC* reacts to the hotplug and actively screws something up?
11:22tophevich[m]marcan: you could say you were apple "screwed"
11:29alyssamarcan: in that one case, one would hope Apple could fix that in the SMC firmware and not the OS..
11:33marcanwait hold on
11:34marcanhotplugging just worked for me once, I swear
11:36Guest512 is now known as svenpeter[m]
11:38svenpeter[m]I disabled the interrupts for the smc and it still didn’t work fwiw
11:38svenpeter[m]Did it work again afterwards?
11:38svenpeter[m]Because at least in m1n1 hot plugging works exactly once
11:39marcanit worked once, once
11:39marcanI can't repro
11:40marcanoh, it just worked again
11:44marcansvenpeter[m]: I just got it to work like 4 times in a row
11:44marcanand then it died
11:44marcanit's inconsistent
11:44marcan(but once it dies it dies)
11:44svenpeter[m]Never worked more than once for me
12:05svenmarcan: fixed it yet? :>
12:18marcansven: no but I found something interesting
12:18marcanif I disconnect D+/D-, it works fine
12:18marcanif I disconnect CC, it works fine
12:19marcanif I disconnect CC, then D+/D-, then reconnect D+/D-, then reconnect CC, it works fine as expected (since once CC drops it'll detach the data pins from the PHY, so how could it do anything?)
12:19marcanbut if I disconnect D+/D-, then CC, then reconnect CC, then D+/D-, it's dead
12:19marcanso there's a race, which explains the repeatability problem
12:22_jannau_also explains why it works with the usb-c/a adapter
12:23marcanno, that's host mode, not gadget mode
12:24marcanit works differently because vbus matters in gadget mode but not in host mode
12:24marcansven: I have a theory that this isn't dwc3/the phy's fault, it's tipd's fault
12:24marcanwe'll know for sure with the teardown
12:25marcanhere's the thing: when I disconnect the data side, one of the lines goes up as expected (gadget pullup)
12:25marcanhowever, if I then disconnect CC and reconnect it, the pullup never comes back
12:25marcanthat's total wack
12:26marcanthe thing is, the ti chip has some kind of "protection" crap; I've seen it cancel modes for me when I drew too much current and such
12:26marcanit's possible that it sees the pullup voltage and hates it for some reason (maybe because it considers vbus not ready yet?)
12:27marcanand the whole phy/dwc3 reset dance? all just to turn the pullups off and on again enough for tipd to not hate it.
12:27marcanif I'm right, I'm going to say apple themselves haven't debugged this properly, and are convinced it's a dwc/phy problem, and are doing all that shit for nothing
12:27marcan(consider: software people figured out how to make this work and never talked to hardware people)
12:28j_eymarcan: well if you're right, lets see what happens in the macOS release after this is posted to LKML :P
12:28marcanso where's the pullup enable bit...
12:30yuyichao has quit [Quit: Konversation terminated!]
12:31yuyichao has joined #asahi
12:40alyssaj_ey: lmao
12:40alyssai've seen some pretty perverse Mali errata in my time
12:42marcan>>> clear32(0x38228c704, 1<<31)
12:42marcan>>> set32(0x38228c704, 1<<31)
12:43marcansven: that fixes gadget mode for me.
12:43marcanand that does, indeed, kill the pullups.
12:43marcan(stops the controller)
12:44svenlol :D
12:44marcanyou probably want some delay there too
12:44yuyichao has quit [Quit: Konversation terminated!]
12:44marcansince the tipd would have to notice
12:45marcanso the next plan of attack is dumping not dwc/phy regs, but *tipd* regs during this mess
12:45marcandinner first though
12:45marcanonly problem is if I fix this now, what will happen with the teardown? T_T
12:45marcanthe other half of the story is what about host mode; that uses pull-*downs* so what's up with that?
12:45yuyichao has joined #asahi
12:45marcan(it's possible we're dealing with two different problems here, of course)
12:47sveni originally thought that host mode was broken because i didn't setup the phy correctly for that fwiw (or, to put it different: i was very surprised when dwc just worked in host mode without any additional phy pokes)
12:47svenbut IIRC i tried reproducing macos' phy pokes for host mode and that didn't fix anything
12:49marcanah, but this is interesting. if I set it to SuperSpeed mode it turns off the pull-ups, but still wedges
12:50marcani.e. if I replug, then switch to high-speed mode without a reset (which normally does turn on the pullups immediately), it doesn't
12:50marcanreset the controller and it does
12:50marcanso there's something else here
12:51yuyichao_ has joined #asahi
12:51marcananyway, dinner first
12:51yuyichao has quit [Remote host closed the connection]
12:54aleasto has joined #asahi
12:56marcansven: also there is some other chip in the way, some kind of level shifter
12:56marcanand it has i2c too, and a reset line
12:56svenhuh, interesting
12:57marcanand *that* is driven by the retimer chip
12:57marcanwhich is a whole separate big thing with JTAG etc
12:57marcanand firmware
12:58marcanwait no, it's on the CD3217
12:59marcanthe CD3217 is the i2c *master* for those other chips
12:59marcanwell, that's one i2c bus I need to poke then
12:59marcanbut this is getting real smelly in this direction
13:00svenso we'll just patch the CD3217 ourselves to fix this? :>
13:00* handlerugis worried about the dinner
13:01maztoo late, it burned.
13:02marcanhttps://www.ti.com/product/TUSB2E22 this is the redriver that's on the USB2 path
13:03marcanso wait, how does eUSB work
13:04marcanwhy did I just discover a whole new cursed aspect of USB
13:04marcanit never ends, does it
13:05psykoselooks like usb just lower voltage
13:09marcanpsykose: and a 158 page spec, yes
13:09psykose157 pages of fluffy cats
13:10marcanwell, at least now we know how this kind of fail is possible
13:10marcanthere's a whole pile of cursed USB mess that is driven, on one side, by i2c from tipd
13:10marcanand on the other, talks to the M1 PHY
13:11marcanno wonder weird impossible interactions can happen
13:12sveni kinda understand why apple's SW engineers just decided to reset everything now :D
13:12marcanwait what
13:12marcandoes... does the M1 support one fewer hub at HS than every other computer?
13:13marcanand only *two* at FS?
13:13marcan... I think I have a FS hub lying around, I should test this
13:13marcanwho came up with this pile of fail?
13:13dottedmagmarcan: The answer is on pages 2-4
13:14marcanwell apple is first...
13:21marcansven: so the public TI part has the i2c pins of the apple part as "reserved"
13:21marcanwho wants to bet they're the same die :p
13:21svenwouldn't surprise me
13:22marcanok, so the thing is, if the repeater gets reset, which I bet it does when the TI part detects a hotplug... the phy needs to know about that
13:23marcanbecause it's the phy's job to put the repeater into host or device mode
13:23marcanI don't think there's any kind of way for the phy to detect that the repeater got reset
13:23marcanif so, then we don't have much choice, though we might be able to get away without a big hammer reset and do something more surgical (e.g. that poke I mentioned for gadget mode)
13:27alyssais the big hammer reset such a problem?
13:32alyssait's ugly as hell, but... if macOS does it that way at minimum we know it interacts fine with all the other type-C port drama (particularly displayport and thunderbolt crossbar)
13:32alyssaon that note, does macOS do even more big reset hammer shenanigans when hotplugging dp/tb before/after usb?
13:33sventhe moment you unplug the cable it already puts everything it can into reset
14:02yuyichao_ has quit [Ping timeout: 480 seconds]
14:18jbowen has joined #asahi
14:22yuyichao_ has joined #asahi
14:23yuyichao_ has quit []
14:24yuyichao has joined #asahi
14:41nsklyou probably already thought about it, but, will it be possible to have this install scenario: format everything clean. do initial macos install on _an external_ drive, then proceed installing asahi on the internal drive, it would grab all the needed stuffs from macos on the external drive, then once everything is installed, remove external drive and enjoy single os linux install on
14:41nsklmac m1
14:47nsklaus has joined #asahi
14:50marcannskl: you do not need to do any initial macos install; you can use system recovery
14:51marcanyou *do* need to have had a certain minimum macos version installed; if you haven't, you can just upgrade the stock macos first before wiping it, or do it on an external drive.
14:51nsklausmarcan: but, would it be possible at all to get rid of the recovery partition and have linux only stuff on the internal drive ?
14:51marcanno, that's like saying would it be possible to remove the UEFI firmware from a PC and have linux only on the drive
14:52marcanrecovery mode is part of system firmware, and starting with macOS 12.x you also need an additional copy of recoveryOS for each installed OS, Linux or otherwise
14:52marcantechnically you *could* wipe some of this stuff after installing linux, but you would end up with a half broken system that e.g. cannot use the boot picker
14:53nskl has quit [Ping timeout: 480 seconds]
14:53nsklausi see .. i enjoy mac M1, low power consumption, good cpu, gfx and all, but that few gigabytes bios like uefi partition always seemed to me like waste of space
14:53marcanit's how Apple designed these machines
14:54j_eynsklaus: just pretened the SSD is 250G instead of 256G or something :P
14:54marcanyeah, pretty much
14:54nsklausmaybe someday someone will find a cure for the apple fat "bios"
14:54marcanthere's no cure, this is all signed secureboot
14:54marcanit's part of how the machine is designed
14:55marcanthere's no way around it, wipe recoveryOS and you lose the boot picker. it's literally deleting part of the boot UI.
14:56nsklausand there would be absolutely no way to replace that "boot picker" completely ?
14:57marcanno, it's signed
14:58marcanon the plus side, these machines are probably *the* most secure user-controllable secureboot systems available to end-users today
14:58marcanif you want a machine running your own OS that can withstand an evil maid attack, these are your best bet
14:58marcanthey are practically the only system designed with a "physical access is not enough" philosophy
14:59marcanand you can build a secureboot linux on top of them
14:59marcan(at least you will be able to do it properly once we support the SEP for storage encryption and such)
14:59nsklauswait until someday apple get the brillant idea to pull the plug and remove third party OS option .. you never know with them what strange decision they could come up with all of sudden
15:00nsklaussony did just that too on ps3
15:00marcanthey spent countless developer hours making this work, they aren't going to remove it
15:00nsklausglad to hear
15:00marcansony did that on the ps3 because they're incompetent and can't actually build a secure system, so they chickened out when geohot found a silly glitch thing
15:00marcanapple are way beyond that
15:00marcanand the M1s do not rely on hypervisor nonsense for security
15:01marcanin fact, as far as I know they are the only secureboot system that offers *per-OS* security modes
15:01marcanwhich allows you to do things like run full-DRM macOS with Netflix and iOS apps and all that walled garden stuff, *and* Linux, dual-boot
15:01marcanbest of both worlds
15:01marcancan't do that on Android ;)
15:03nsklausi see there might be advantage too to their big blob 6gb bios. thanks for pointing it out, that's also reassuring to hear they probably won't suddenly change their mind about allowing third party os to run on their hardware
15:03marcanit's not just a third party OS, the "official" reason for all this is to run self-built versions of the macOS kernel
15:04marcanand either way, as long as they allow third-party drivers, it's basically the same security-wise
15:04marcanso there is no good way they could lock all this down without hurting macOS developers
15:04marcanthat's *why* they spent all the time on this; Apple management didn't make it like this for us (but I'm sure Apple engineers were thinking of it).
15:06marcanthere's even a blob written by (presumably) Apple engineers explaining how all that works: https://kernelshaman.blogspot.com/
15:06nsklausthanks for the link
15:10j_eymarcan: by the kernel engineering manager!
15:11marcanj_ey: does it actually say that somewhere?
15:12nsklaus'xnu' is the name apple gave to their kernel, is that right ? so it is necessary to build a custom macos kernel to allow to boot linux on m1 ?
15:12j_eynsklaus: no
15:12marcannsklaus: no, m1n1 replaces xnu
15:12marcanthat's why it builds as a mach-o executable like xnu
15:13marcanit's the same way m1n1 boots "linux" kernels but it can boot u-boot which happens to be built in the same format as a linux kernel; it doesn't have to care that what it's booting is not linux
15:13marcanas long as whatever we boot "looks" like xnu to the machine it will work
15:14marcanit doesn't have to be xnu
15:14nsklausi understand better now
15:16nsklausi was wondering where m1n1 was fiting in and in what form. i understand better now
15:16marcanthat blog is very helpful for understanding how things are supposed to work, but the only part that is the same for us is the bit that mentions `kmutil configure-boot` near the end
15:16marcaninstead of OpenSource.kc you use m1n1.macho. that's it.
15:17marcan(but our installer automates/guides you through that)
15:17ar170426 <@marcan> so there is no good way they could lock all this down without hurting macOS developers
15:17armarcan: they do have a history of hurting developers
15:17marcanto a *point*
15:17nsklausar: and users alike
15:18marcanbut they're not going to design all this stuff just to throw it away
15:18marcanand they're not going to throw it away for M1X/M2, and we're fast enough that by M3 things will be awesome and they'll have to think very hard about the PR hit if they actually try to make the next generation truly locked down like iOS ;)
15:19nsklausin worst case scenario we could do like the jailbreak tools do, and warn users to not update to certain macos version (to get incompatible, updated firmware)
15:19marcanthey aren't going to retroactively lock it out on existing machines
15:19marcanthat would be PR suicide
15:19marcanat most they might decide to drop the feature in a future generation, but that's years away if it ever happens
15:20marcanremember, Sony lost a class-action due to this
15:20marcanand should've also been sued under other laws (e.g. european warranty laws)
15:20marcanit is literally illegal to do this
15:21nsklausthat's reassuring to hear
15:21marcanand Linux on M1 is going to be much higher impact than Linux on PS3 ever was
15:23nsklausif someday linux on M1 allow users to run 32/64bits x86_64 apps, and eventualy virtualize macos too, you might have a better macos macos experience running it through linux instead. that should raise some eyebrows ;)
15:24nsklausi was thinking of fex_emu and your hypervisor too
15:25nsklausi tested quickly fex_emu in a vm, and that worked quite nicely already (my test is from a few months ago)
15:32marcanyes, fex is what I intend to provide in our images
15:33marcanvirtualizing macos is a bit of an issue, you'd have to run the vmkernel version of macos at least and GPU support requires writing a Metal implementation
15:33marcanso I don't really count on graphical macOS ever being practical in a VM on Linux
15:34marcan(on arm64 systems)
15:35marcanOTOH running *Linux* in a VM on Linux should already be faster than running it on macOS, since we use the M1's vGIC and they don't ;)
15:35marcanfaster IPIs/IRQs
15:39mazmarcan: it certainly is one of the fastest VM host I have in my zoo.
15:40marcanare you running with upclocked CPUs?
15:40mazmarcan: very close to N1, and that's only running on the small cores (until you give me that cpufreq driver).
15:40marcanif you're booting via usb/proxyclient, run experiments/cpu_pstates.py before
15:41marcanthat'll put all the big cores at max
15:42marcanactually if you're not on 12.x it might not quite be max
15:42marcanjust pushed a fix for that
15:43mazno idea, I never booted macos since March.
15:43maz(since I got the machine, actually)
15:43marcanthen definitely not, it wasn't out yet :)
15:43marcan(well, it's in beta now)
15:43marcanI'm actually not sure what machines/versions need that, but whatever
15:44marcan(mine doesn't, other people's do apparently)
15:45marcaneither way, I'll see about poking at the cpufreq driver tomorrow, should be pretty easy
15:45marcanalready gathered all the info (measured latencies too)
15:50mazmarcan: is that what you expect prior to 12.x?
15:50marcanif you didn't pull the update just now
15:51maza m1n1 update?
15:51mazor macos?
15:51marcanjust that script, I uncommented some stuff
15:52maz"IndentationError: unexpected indent
15:52marcanserves me right for not testing
15:53marcanforce pushed ;)
15:55maz2987.97!
15:55j_eyit should get to 32xx
15:55mazscrews up the UART output though.
15:56maz(at least for the first half of the boot)
15:57mazDebian install benchmark running.
15:57marcanj_ey: only with a single core active
15:57marcanwhich will never happen in linux
15:57marcan(until there's a cpuidle driver)
15:58marcan3G in m1n1 could mean an old m1n1
15:58j_eymarcan: i thought maz was running the pythons crpt though..
15:58j_ey*script
15:58marcanyeah, so old m1n1 I'm guessing?
15:58marcanprior to the smp mode rework
15:59mazit's a m1n1 from about a month ago.
15:59marcanyeah, I fixed this recently :)
15:59marcanmeanwhile this is now crashing for me :D
15:59marcanTTY> Starting CPU 4 (1:0)... Failed!
15:59marcanfor some reason *that* CPU fails to start
15:59marcanbut only after this commit just now!
15:59marcanso apparently this works on <15.0 and breaks on 15.0 :D
15:59mazah, the mac mini is finally getting warm!
16:00maz2m53.098s
16:00mazthat's.... hillarious.
16:00marcanwhat was it before?
16:01marcanalso the strange thing is I'm not setting any bits in those registers... they're all already set for me
16:01marcanbut somehow writing to them breaks it :D
16:01mazjust over 4 minutes.
16:01mazwhich was pretty good already.
16:02mazthis is way better than my N1 box.
16:04j_eywhat's this, installing a new debian into a vm?
16:06mazj_ey: yup. fully automated install from scratch (boot from EFI, install everything reboot into the created guest, power-off).
16:11mazhahaha! 2m23.308s if I taskset QEMU on the big cores...
16:12mazat this stage, I'm sure the storage is the bottleneck.
16:17marcanmaz: can you pull and run cpu_pstates again? I want to know what it says about DVMR
16:17marcanmacOS 12.x does not touch it and even rewriting the same value to the register causes brokenness for me, so maybe it's a one-shot deal
16:17marcanbut I want to see what bits it actually flips on older versions
16:18marcanalso if you chainload the latest m1n1, the benchmark should reach 3.2
16:18marcan(chainload before running the script; once SMP starts chainloading breaks)
16:26mazsure, let me give it a shot.
16:29marcaninteresting, so it's just the top bit
16:32mazhmmm. the chainloading isn't happy at all./
16:36marcanmaz: make sure you chainload *first* after a reboot
16:36marcanbefore running that script
16:36mazthat's what I do.
16:37mazbut maybe I need to give it a power-off instead of a reset...
16:37marcanreset should work, hm
16:38mazreconnection times out, and nothing after that.
16:38marcanah, are you on the second USB port? I noticed something weird about chainloading over that today, on my existing installed m1n1 (but after a chainload it's fine, so whatever it is I fixed it I guess?)
16:38mazleftmost port.
16:38marcanlooking which way?
16:38mazwhen facing the back of the mini
16:39marcanshould be the first port then
16:39marcanhm, not sure then, hard to debug without serial :/
16:39marcananyway, it's no big deal
16:39marcanI should get some sleep :)
16:39mazplease do!
16:39marcanthanks for testing!
16:40mazthanks for everything! :D
16:40j_ey /win 84
16:40j_eyerr, lala ignore that
16:41psykosethat's a lot of windows
16:41j_eyim too lazy to clean them up
17:47nsklaus_ has joined #asahi
17:47nsklaus has quit [Read error: Connection reset by peer]
18:10artemist0 has joined #asahi
18:10artemist has quit [Remote host closed the connection]
18:22steevrelatable
18:58yuyichao has quit [Quit: Konversation terminated!]
19:00yuyichao has joined #asahi
19:24jlkjlk has joined #asahi
20:04jlkjlk has quit []
20:34Retr0id has quit [Read error: Connection reset by peer]
20:35Retr0id has joined #asahi
22:19psykose has quit [Remote host closed the connection]
22:20psykose has joined #asahi
22:36aleasto has quit [Quit: Konversation terminated!]
23:06___nick___ has quit [Ping timeout: 480 seconds]
23:11phiologe has quit [Ping timeout: 480 seconds]
23:24phiologe has joined #asahi
23:38* alyssais getting close to a DCP driver that she's not completely embarassed by
23:38alyssaonly like... 95% embarassed
23:40yuyichao has quit [Ping timeout: 480 seconds]
23:41alyssa* for the Mini only. No promises it won't set your MacBook on fire.
…