#
…

2021-04-21

00:21rjeffman has quit [Ping timeout: 260 seconds]
00:49luca020400 has quit [Ping timeout: 260 seconds]
01:10Caloludr has joined #asahi
01:20tomboy64 has quit [Ping timeout: 246 seconds]
01:32riker77 has quit [Ping timeout: 245 seconds]
01:34riker77 has joined #asahi
01:54mxw39 has quit [Quit: Konversation terminated!]
02:04raster has quit [Quit: Gettin' stinky!]
02:17maknho has quit [Ping timeout: 252 seconds]
02:18maknho has joined #asahi
02:45phiologe has quit [Ping timeout: 250 seconds]
02:46odmir has quit [Remote host closed the connection]
02:46phiologe has joined #asahi
02:47odmir has joined #asahi
02:47odmir has quit [Remote host closed the connection]
03:03KindOne has quit [Ping timeout: 240 seconds]
03:05KindOne has joined #asahi
03:10KindOne has quit [Ping timeout: 260 seconds]
03:11KindOne has joined #asahi
03:20odmir has joined #asahi
03:21marvin24 has quit [Ping timeout: 250 seconds]
03:21marvin24 has joined #asahi
03:25odmir has quit [Ping timeout: 260 seconds]
04:06Nazral has quit [Ping timeout: 265 seconds]
04:18Nazral has joined #asahi
04:37HeN has quit [Quit: Connection closed for inactivity]
05:14VinDuv has joined #asahi
05:32herbas has joined #asahi
05:33herbas has quit [Client Quit]
05:59karlyeurl has quit [Ping timeout: 245 seconds]
06:00karlyeurl has joined #asahi
06:11ephe_meral1 has joined #asahi
06:11Bublik_ has joined #asahi
06:14Bublik has quit [Ping timeout: 252 seconds]
06:22luca020400 has joined #asahi
06:24VinDuv has quit [Quit: Leaving.]
07:16tomtastic has quit [Ping timeout: 245 seconds]
07:45vimal has joined #asahi
07:52tomtastic has joined #asahi
08:05tomtastic has quit [Ping timeout: 245 seconds]
08:07wicast has quit [Quit: WeeChat 3.1]
08:23herbas has joined #asahi
08:25herbas has quit [Client Quit]
08:35klaus has joined #asahi
09:17herbas has joined #asahi
09:19herbas has quit [Client Quit]
09:19HeN has joined #asahi
09:20tomtastic has joined #asahi
09:21maz| is now known as maz
09:35konradybcio has quit [Ping timeout: 245 seconds]
09:36konradybcio has joined #asahi
09:56ephe_meral1 has quit [Ping timeout: 252 seconds]
10:06raster has joined #asahi
10:21choozy has joined #asahi
11:31Bublik_ has quit [Ping timeout: 260 seconds]
11:32Bublik_ has joined #asahi
11:52nimroot[m] has joined #asahi
11:59nimroot[m]Is anyone aware what NIC is used for M1 MBA? All information I could get is that it's wifi-6 / bluetooth 5.0 compatible.
12:03arndnimroot[m]: bcm4378
12:04arndcorellium have a fairly small patch for drivers/net/wireless/broadcom/brcm80211/brcmfmac/ to add support
12:04pipcet[m](that's wifi, not bluetooth, iiuc)
12:06pipcet[m]their main hack is that the mac address is stored in the device tree rather than on the device
12:06choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
12:07pipcet[m]they have some horrible scheme to load the driver, figure out which firmware to use, then re-load the driver after setting the firmware path
12:09arndthe patch does a bunch of things, it also adds the PCI device ID (that part is probably fine), and some bits for interrupt handling that I didn't understand but that are probably needed in some form
12:14kov has joined #asahi
12:14pipcet[m]I just wanted to point out there's a userspace hack as well. /usr/bin/wifistart in their ubuntu image or something like that.
13:06tmlindprobably the wlan nvram mac address should be handled by a separate driver and the wlan driver could then ask for it?
13:07pipcet[m]probably, the firmware's a little trickier though, IIUC
13:08tmlinddepending on what all the nvram is used for and assuming it's on some separate controller, syscon might be usable in the simple cases for handling the nvram. but only if no other real framework is around to deal with it i'd say :)
13:09pipcet[m]it's not a simple memory-mapped device, I think that's limited to those cases?
13:10pipcet[m]or am I misreading that?
13:12tmlindyeah a proper driver for using some generic framework would be always better, in any case syscon is documented at Documentation/devicetree/bindings/mfd/syscon.yaml
13:12pipcet[m]thanks, I'll have a look
13:12ephe_meral1 has joined #asahi
13:13pipcet[m]I don't consider the wifi bit in particular a major issue, but it might be a good place to start if people here insist on rewriting all the Corellium code since it's relatively self-contained.
13:28rjeffman has joined #asahi
13:57Nazral has quit [Ping timeout: 252 seconds]
14:09Nazral has joined #asahi
14:11Namidairo has quit [Read error: Connection reset by peer]
14:11Namidairo has joined #asahi
14:16kettenisthe mac address will be in the device tree, all the driver has to do is pick it up from there like the tg3 driver already does
15:36tmlindsounds good to me
15:56taziden has quit [Ping timeout: 250 seconds]
15:59taziden has joined #asahi
16:00kettenis has quit [Ping timeout: 240 seconds]
16:02kettenis1 has joined #asahi
17:01VinDuv has joined #asahi
17:55marcanpipcet[m]: it wasn't the community reaction that got corellium to reconsider putting more resources into it; it was the opposite
17:55marcanthe CTO had DMed me about them being working on this internally before; I asked for details and he said "oh actually it's not a priority any more"
17:56marcanthen I heard nothing from them until around when the macOS beta with external kernel support was released; I tweeted something about not being able to use the old sandcastle kernel they had released (because it wasn't properly signed off nor had it been released with usable history / any kind of traceability)
17:57marcanthe CTO got mad at me, went on a nonsensical tirade on DMs, while I tried to calmly explain what would be needed for the community to be able to use their code
17:57marcanthen he stopped replying, and they announced "we've ported Linux to M1" the next day
17:57marcanthen the next day they released a kernel blob (no source) that also contained the broadcom firmware embedded (taken from macOS, not legally redistributable)
17:58marcanI pointed that out, they removed the file from their server, then it came back without the blob
17:58marcanthe whole thing was very clearly a reactionary thing to get some PR for them, because the CTO was mad at me because I said we couldn't use a vendordump-style kernel with no signoff
17:59marcanbut after this PR stunt, they promised to upstream things and never did; never_released tried to upstream some bits and they never replied on the mailing list to any of that series
17:59marcannor did they reply to any of my submissions, which were CCed to them
18:01marcanas far as I can tell, they have no real interest in upstreaming; given the lack of communication from them, and that they haven't even updated their kernel since february, it was 1) a background PR project they had, but with little interest in upstreaming, which 2) they hastily released to stick it to me, and then 3) made empty promises about upstreaming, but quickly 4) lost interest after realizing ...
18:01marcan... it takes real effort to do things right and get them upstreamed rather than just dump out a PoC on github
18:02marcanI have strong evidence that their drivers are developed by reverse engineering macOS drivers; that may or may not be legal depending on how they do it exactly, but without further assurances about their development process, I am not willing to risk things by working directly with their code as a base
18:04marcaneither way, we clearly have very different development methodologies, and goals; if they want to help the community out, they can start by talking to us :-)
18:05marcanpersonally, given that they obviously have at least self-made hardware documentation (since their main product is a VM after all), if they want to gain some community goodwill I would suggest they start releasing that, rather than a PoC kernel :-)
18:05marcanbut given some of what I've seen in their code, I have my doubts that they are as thorough as I try to be when understanding hardware; after all, to make a VM you just need to bullshit things enough for the one OS that matters (iOS) to run on it, not actually understand the hardware fully :-)
18:06svenpeterLess drama, more mmiotracer please :P
18:06marcanexactly.
18:06marcanso yeah, that's the story, and now I'm going to go to sleep and see if I can actually be productive tomorrow :P
18:12ephe_meral1 has quit [Ping timeout: 260 seconds]
18:25taziden has quit [Ping timeout: 250 seconds]
18:31taziden has joined #asahi
18:36pthariensflame has joined #asahi
18:37pthariensflame has quit [Client Quit]
18:57KindTwo has joined #asahi
18:59KindOne has quit [Ping timeout: 240 seconds]
18:59choozy has joined #asahi
19:03KindTwo has quit [Ping timeout: 260 seconds]
19:05KindOne has joined #asahi
19:11choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
19:13KindTwo has joined #asahi
19:14KindOne has quit [Ping timeout: 246 seconds]
19:15KindTwo has quit [Remote host closed the connection]
20:45Swant is now known as IKEA
20:45IKEA has quit [Remote host closed the connection]
20:45VinDuv has quit [Quit: Leaving.]
20:46jeffmiwabout the mmiotracer, I've been trying to run some code in EL1 with HCR_EL2.VM bit set to get the stage 2 translation working for the hypervisor
20:46Swant has joined #asahi
20:47jeffmiwI have failed so far :( but not giving up...
20:48jeffmiwI'm getting an instruction abort due to a level 0 translation at the first instruction after the ERET which means my VTCR_EL2 & VTTBR_EL2 settings are wrong
20:49jeffmiwso I'm going to check all bits again to at least get some instructions going in EL1 with stage2 translation active
20:50jeffmiwdid anyone play with stage2 translation thanks to HCR_EL2.VM bit set ?
20:54Swant is now known as IKEA
20:54IKEA has quit [Remote host closed the connection]
20:54Swant has joined #asahi
20:56pipcet[m]well, if it helps us get better code I'm perfectly okay with some drama :-)
20:59pipcet[m]what are the mmiotracer plans, actually? play hypervisor for MacOS using m1n1?
20:59svenpretty much
21:00svenand then at least intercept read32/write32 from macos to understand how the hardware works
21:00pipcet[m]can we actually boot macos yet?
21:00svendon't think so
21:00jeffmiwnot tried yet
21:01pipcet[m]I very briefly tried to even find whatever macos boots instead of our macho binary
21:01jeffmiwbut that should work if you just do chainloading without messing up with hypervisor stuff
21:01svenyeah, the xnu kernel should be able to run in both el1 and el2 without any changes
21:02svenprobably needs some patches to the ADT but should be fine otherwise
21:03pipcet[m]so, uh, where is the xnu kernel, actually?
21:03svenit's complicated :-)
21:03sventhere's a macho binary with just the kernel somewhere in /System
21:04svenbut what gets actually booted is what apple calls kernelcache i think
21:04svenwhich is essentially the kernel + all kexts
21:04sven//System/Library/Kernels/kernel.release.t8101
21:06pipcet[m]and do we know that testing whether it's running under a hypervisor and bailing if there is one isn't the first thing that does?
21:07svendoesn't really matter, we could just patch those checks
21:07svenbut as i said, the kernel looks like it'll run just fine in el1
21:10pipcet[m]I can think of relatively cheap ways for Apple to potentially have done this, so all I'm saying it might be a good idea to work out how to start MacOS in EL0 first, then worry about the mmiotracer if there's a chance it might work.
21:10pipcet[m]done this = prevented virtualization of their hardware
21:11svenokay, let me rephrase: i'm 99% sure the kernel will run just fine in EL1 on Apple Silicon hardware
21:11pipcet[m]that would be wonderful!
21:11svenit will fail fairly early on non-apple hw though once it tries to access apple specific MSRs or instruction set extensions
21:12nimroot[m]marcan: just read the story and that's just messed up. Wouldn't imagine that Corellium is such a Karen.
21:13pipcet[m]if it's that easy, I still think it might be worth it to try stealing a CPU core from macos and run our code on that in parallel to macos. We wouldn't see the MMIO accesses directly, but we could do some debugging nonetheless
21:14svennot sure what that would gain us compared to running it under a hypervisor
21:15pipcet[m]easier to do, higher likelihood of working, less valuable data.
21:15sveni disagree on all three points :D
21:15svenactually, no
21:15svenjust on the first two
21:15pipcet[m]not the third one, hopefully :-)
21:15svenyeah :-)
21:16svenrunning xnu itself in el1 is really just a matter of maybe patching the ADT and loading the kernelcache correctly
21:16svenafter that we can add the 2nd stage translation
21:17svenor if you still doubt that it'll even run in el1 just take a working kernel and patch _start to drop to el1 as early as possible
21:18pipcet[m]I might do that.
21:19sveniirc project zero did that stealing a cpu core thing to build an ios debugger. they abused some debug registers though to actually debug the other cores
21:19svenand i'd be surprised if these still exist on the m1 ;)
21:19nimroot[m]It might be a stupid question, but what's EL1 and what's EL2?
21:20pipcet[m]if there really is a macho binary that starts macos we should get that working ASAP and see what we can make it do
21:20svennimroot[m]: "exception levels". i believe x86 calls these "rings"
21:20PthariensFlame[mnimroot: Architectural parts of (modern) Arm processors. Think of them like X86's "rings", if you're familiar with those.
21:21PthariensFlame[mnimroot: EL1 is where OSes generally run; EL2 is where hypervisors generally run.
21:22sventhe m1 also has gl1 and gl2 (guarded levels apparently) on top of that which are the same as el1/2 but the meaning of some permission bits in the pagetables change
21:22svenbut we can ignore those for linux
21:22PthariensFlame[msven: Is that RE'd, or a documented part of Arm?
21:23svenPthariensFlame[m: it's apple-specific
21:23nimroot[m]I see, yeah, I'm as familiar with cpu architecture as what college taught me (so not very much), but now I get what you are talking about :D
21:23sveni've played around with those a little bit today. don't think they are documented anywhere yet
21:25PthariensFlame[mVestiges of their preliminary attempt at BTI?
21:25PthariensFlame[mOr am I understanding "guarded" wrong?
21:26sveni don't know what BTI is
21:26j`eybranch target identification
21:26j`eyaka stops you branching to random places in code
21:27svenand i think the guarded name is misleading, it's essentially https://siguza.github.io/APRR/ with more custom extensions
21:27PthariensFlame[mIt's a required part of Armv8.5, which M1 almost implements.
21:27PthariensFlame[m<sven "and i think the guarded name is "> Oh, okay!
21:27sveni believe it's meant to prevent most of kernel text to modify pagetables
21:27PthariensFlame[mThat makes sense.
21:28sveni'll finish figuring out some details this week and document it then :)
21:51klaus has quit [Ping timeout: 252 seconds]
21:53rjeffman has quit [Ping timeout: 260 seconds]
22:03maknho has quit [Ping timeout: 252 seconds]
22:06pipcet[m]hmm, so it's not absolutely trivial to boot a macho kernel, it seems, but that doesn't mean much.
22:28TomJepp has quit [Ping timeout: 245 seconds]
22:46TomJepp has joined #asahi
22:51TomJepp has quit [Ping timeout: 245 seconds]
23:16zkrx has quit [Ping timeout: 246 seconds]
23:18TomJepp has joined #asahi
23:34zkrx has joined #asahi
…