2021-12-17
01:15yuyichao_ has joined #asahi-dev
01:19yuyichao has quit [Ping timeout: 480 seconds]
01:46yuyichao_ has quit [Ping timeout: 480 seconds]
02:33leah has quit [Ping timeout: 480 seconds]
02:52chadmed has quit [Quit: Konversation terminated!]
02:55riker77_ has joined #asahi-dev
03:00riker77 has quit [Ping timeout: 480 seconds]
03:00riker77_ is now known as riker77
03:13StupidYui has quit [Read error: Connection reset by peer]
03:33leah has joined #asahi-dev
04:02phiologe has joined #asahi-dev
04:03squags has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
04:03squags has joined #asahi-dev
04:05PhilippvK has quit [Ping timeout: 480 seconds]
04:05kov has quit [Quit: Coyote finally caught me]
04:05kov has joined #asahi-dev
04:40nabaiste^ has joined #asahi-dev
04:57tpw_rulesis any of the rtkit stuff documented anywhere except in that file? or has anyone posted logs of rtkit stuff wrt the nvme device?
05:29yuyichao_ has joined #asahi-dev
05:54Emantor has quit [Quit: ZNC - http://znc.in]
05:55Emantor has joined #asahi-dev
06:37chadmed has joined #asahi-dev
06:38Dcow has joined #asahi-dev
06:39chadmed has quit [Remote host closed the connection]
06:44Dcow has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:52jannau has quit [Ping timeout: 480 seconds]
06:52_jannau_ has quit [Ping timeout: 480 seconds]
06:54Dcow has joined #asahi-dev
06:59Dcow__ has quit [Ping timeout: 480 seconds]
07:10jannau has joined #asahi-dev
07:10_jannau_ has joined #asahi-dev
07:59gladiac is now known as Guest8685
07:59gladiac has joined #asahi-dev
08:05Guest8685 has quit [Ping timeout: 480 seconds]
08:22Dcow_ has joined #asahi-dev
08:38chadmed has joined #asahi-dev
08:55coder_kalyan has joined #asahi-dev
09:32Dcow_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:35chadmed has quit [Quit: Konversation terminated!]
10:03chadmed has joined #asahi-dev
10:42Dcow_ has joined #asahi-dev
10:57kettenissven: I'm probably going to look at adding the code to (re-)start the coprocessors in OpenBSD this weekend
10:58svenlet me know if you have any questions, I’ve done that in that “new” nvme driver there. And also
10:59aleasto has joined #asahi-dev
11:00svenfwiw, that thing doesn’t support the admin abort command. I’ll remove that one from the Linux driver as well
11:42Dcow_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:46as400[m] has joined #asahi-dev
11:53Dcow_ has joined #asahi-dev
12:11Dcow_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
12:13Dcow_ has joined #asahi-dev
12:17Dcow_ has quit []
12:58chadmed has quit [Ping timeout: 480 seconds]
13:24tpw_ruleskettenis: did you already have code to shut them down in u-boot in some other branch? i worked on it a bit last night but haven't got it working yet
13:35tpw_ruleskettenis: i got far enough to figure out you need this flag: https://github.com/u-boot/u-boot/blob/7958292f5ffa4ecdaaf4c73c6df28006051db6e0/drivers/mmc/mmc-uclass.c#L504 to ask u-boot to remove it before starting the OS
13:37tpw_rulesbut the processors did not seem to be responding to my messages to shut them down. i was a bit suspicious that u-boot left them in a bad state starting up.
13:38tpw_rulessven: ah ok, i got confused because i saw a commit with the same name that was more recent
13:40tpw_ruleskettenis: yeah the drive does work, but it seems the processors are confused. i altered how u-boot started them slightly and then the processors at least replied to my shutdown messages, but linux still couldn't start them back up properly. ah well, i will get back to it in a few hours
13:42tpw_rulesby the way, do all the macbook keyboards work in u-boot in the apple-m1-m1n1-nvme branch
13:42marcanleaving them running isn't really valid anyway without some kind of handoff mechanism for the SART buffers
13:47svenand if you do large transfers it's going to send some "new WhateverBuffer %d" created messages
13:51nabaiste^ has quit [Remote host closed the connection]
14:29kgarrington has joined #asahi-dev
14:29kgarrington has quit [Remote host closed the connection]
14:42yuyichao_ has quit [Ping timeout: 480 seconds]
14:56skoobasteeve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
14:59yuyichao_ has joined #asahi-dev
15:06skoobasteeve has joined #asahi-dev
15:16Dcow_ has joined #asahi-dev
15:22jbowen has joined #asahi-dev
16:24Dcow_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:26zimsneexh has joined #asahi-dev
16:36Dcow_ has joined #asahi-dev
16:37Dcow_ has quit []
16:42Dcow_ has joined #asahi-dev
17:18yuyichao_ has quit [Quit: Konversation terminated!]
17:23m42uko has quit [Ping timeout: 480 seconds]
17:25yuyichao has joined #asahi-dev
17:43sventhat old tree had a big “WIP” and “DO NOT MERGE” in the device tree commit that you people all just ignore :p
17:46marcanI think we've been kind of labeling everything out of inertia, but yeah, I don't see us doing anything with that one
18:26kilrain[m] has joined #asahi-dev
18:29yuyichao_ has joined #asahi-dev
18:32yuyichao has quit [Ping timeout: 480 seconds]
19:31conradevDoes anyone know how this raw image change will affect the installation flow? Does this give any insight into what materials are needed on a partition to convince Apple to boot it, or is it orthogonal?
19:31conradevDoes anyone know how this raw image change will affect the installation flow? Does this give any insight into what materials are needed on a partition to convince the bootloader to boot it, or is it orthogonal?
19:40aleasto has quit [Remote host closed the connection]
19:53alyssamarcan: sven: relatedly - Is it theoretically possible to run (a clone of) kmutil under Linux, after security has been downgraded in 1TR?
19:56sventhe security model requires assertion of physical presence to update the boot object (i.e. long-press the power button to go into 1TR)
19:56alyssaon e.g. chromebooks with their funny boot model, once security is downgraded you can reflash the machine live with dd to the right partition
19:57ChaosPrincesswhat happens if you bless a mach-o with kmutil, and then overwrite that file on disk?
19:58ChaosPrincesskmutil configure-boot whatever.macho
19:58svenconfigure-boot talks to SEPOS and requests it to include the boot object's hash into this local policy thing and then sign that
20:01svenit'll also ask for your password during the update because SEPOS will have to re-encrypt anything that was encrypted with a key derived from the old firmware with the key derived from the new firmware
20:02ChaosPrincessso its kinda like secureboot + mok(if permissive security) + disk encryption via tpm tied to firmware and kernel hashes?
20:12svenhrm... now that i think about it again, i think you can actually install custom kexts without taking a detour through 1TR after security has been downgraded once
20:25ChaosPrincesssven: so, thats not quite how kmutil works apparently. if you do configure-boot, it will stash the new boot object _somewhere_, and you can freely overwrite the old file, it no longer matters
20:27ChaosPrincessfollowing the instructions is for those who dont want to spend a few hours trying to understand why edits to the initrd dont seem to work :P
21:00Dcow_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:20tpw_ruleskettenis: i an convinced at this point u-boot is not properly starting the ANS ASC, despite the fact that the drive works. see the logs here: https://pastebin.com/qdXKfVhZ . u-boot does not do most of the transactions on endpoint 4, never gets the final 0xb message on the management endpoint, and never gets any log messages
21:22tpw_rulesi have a feeling it's not happy with the memory addresses it's given. it's not obvious to me how linux allocates the memory it hands out, and it doesn't seem to touch those MMIO registers at 0x2774000xx
21:26svenit looks like it's trying to configure SART at 0x277400000 while that should actually be at 0x27bc50000
21:26tpw_rulesyeah i just had that realization too. but the nvme's sart in the device tree is at 0x27bc50000 . so maybe u-boot is loading it wrong
21:28svenkeep in mind that the device tree for u-boot and linux probably still looks a bit different at this point
21:30tpw_rulesthis is the relevant part of the u-boot device tree: https://pastebin.com/Vzyv2B6S it's the same as the linux one, except the phandles are different naturally
21:30svenunless apple changed something in the ANS firmware the nvme layer will not come up before at least crashlog and syslog have been initialised successfully
21:30tpw_rulesi see that 0x277400000 pointer in the nvme's registers, do you expect that to point to the sart?
21:32tpw_rulesso that line should be reg = <0x02 0x7bcc0000 0x00 0x40000 0x02 0x7bc50000 0x00 0x10000>; ? i'm not so sure
21:33tpw_ruleswell a) because it's how it is in that pastebin in the linux kernel device tree which works and b) i would expect it to read the address of the sart registers from the linked sart node
21:34tpw_rulesthen yes, i'm pretty sure u-boot copied over the linux device tree, the semantics changed, but no one noticed because the drive still initialized enough to be readable
21:35svenas i said, i very much remember trying to get away with as little initialization as possible
21:39svenmy money is still on some issue with the device tree. that hypervisor trace very much looks like u-boot for some reason thinks SART is 0x277400000. and i know it didn't use to think that because it also worked for me
21:48tpw_rulesthis line https://github.com/kettenis/u-boot/blob/4f0f957e8e8f6ccb4d4b616d7954e85478e3d7e2/drivers/nvme/nvme_apple.c#L94 should be `addr = ofnode_get_addr_index(node, 0);`
21:56roxfan has quit [Remote host closed the connection]
22:00roxfan has joined #asahi-dev
22:02m42uko has joined #asahi-dev
22:04svenbut i'm still not sure how that could ever work. it should hang once nvme is brought up because it will try to write to the syslog at that point
22:06tpw_rulesi mean it does by all accounts hang. it's just that that doesn't seem to matter too much somehow
22:07tpw_rulesnot really knowing any of the context, maybe the nvme still works if the IOP is okay but the AP is not?
22:11kettenisboth the u-boot and the OpenBSD driver still have some magic writes inherited from the corellium driver
22:12pavellatko[m] has joined #asahi-dev
22:12tpw_rulesj`ey: i mean my conception, driven purely by the names of the relevant messages, is that each thing that runs rtkit has both an IOP and an AP. is that true?
22:13sventpw_rules: AP = that thing that runs linux/openbsd/u-boot/..., IOP = that thing which runs RTKit
22:14tpw_rulessven: so there are a bunch of IOPs and one AP (of several cores)? i'm a little confused about what the SET_AP_PWR_STATE message is for then
22:15svenask apple about that one. the name comes from a string RTKit sends over syslog when you use that message with an invalid power state
22:17pavellatko[m] is now known as latko[m]
22:27svenhrm, so even with those 0x102/0x1002 writes it still tries to write to the syslog. i'm still confused how that ever worked
22:30tpw_rulesi did change a few other miscellaneous things to make the trace look more like linux's. but if/when i get all this working i'll send you a patch
22:55svenhttps://opensource.apple.com/source/xnu/xnu-4570.41.2/iokit/IOKit/IOKernelReporters.h.auto.html
23:14amarioguy has joined #asahi-dev
23:18amarioguyso.... hate to ask but how can I start contributing? is there a git repo where we submit stuff like pull reqs and all that?
23:19j`eyand people can test it by cherry-picking or markan will put it into the main asahi repo if its good enough for wider testing
23:29yuyichao has joined #asahi-dev
23:32yuyichao_ has quit [Ping timeout: 480 seconds]
23:42yuyichao has quit [Ping timeout: 480 seconds]