#asahi · 2021-05-08 08:52
marcanyou also need to emulate AIC#asahi · 2021-05-08 08:51
marcanyou would need to restrict the RAM that Linux is allowed to use, and give macos a contiguous chunk of physical RAM#asahi · 2021-05-08 08:47
marcanpipcet[m]: it's not going to work unless you make all of macos' RAM also identity mapped#asahi · 2021-05-08 07:45
marcanalthough e.g. the HV page tables all assume 16K pages which few ARM systems support AIUI, so...#asahi · 2021-05-08 07:45
marcanmaybe just the HV bits can be extracted into a stand-alone thing you can plug into another existing bootloader more easily?#asahi · 2021-05-08 07:45
marcanI really don't want to turn this into a big portable bootloader thing, but on the other hand the HV stuff is eminently useful elsewhere#asahi · 2021-05-08 07:44
marcanyeah, it's already useful for debugging linux to some extent... and now I'm conflicted, because m1n1 is quite apple silicon-centric by design#asahi · 2021-05-08 07:25
marcanspeaking of hypervisors, going to stream some more of that in a few minutes#asahi · 2021-05-08 07:24
marcanit's certainly something to investigate in the future, but it'll probably come quite further down the line#asahi · 2021-05-08 07:24
marcanso that might be useful for experiments, but possibly not for end users; to do it properly KVM would need more M1-specific stuff and that's harder to implement and upstream#asahi · 2021-05-08 07:23
marcanalso, to run macos unmodified, KVM may need quite a bit of patching to support custom M1 features; at the very least we need to set everything to trap, but that might be very slow as it causes vmexits for tons of stuff#asahi · 2021-05-08 07:22
marcanin particular the GPU is a big question mark, but there's reason to believe Apple is interested in virtualizing macos, so it's possible the hardware is built to enable this kind of feature#asahi · 2021-05-08 07:21
marcanonce we better understand the hardware, we'll have a better idea of what can be done#asahi · 2021-05-08 07:20
marcanand not all the hardware in the M1 runs through the same kind of IOMMU#asahi · 2021-05-08 07:20
marcanyou can't just "pass through" hardware under KVM like I can under my toy hypervisor, there needs to be DMA and IRQ remapping#asahi · 2021-05-08 07:20
marcanpipcet[m]: the problem with "passing through" is you need to involve the IOMMUs#asahi · 2021-05-08 07:19
marcandottedmag: kvm on linux on m1 should already work better in some ways than the hypervisor stuff on macos (:)), but that's to virtualize linux/windows#asahi · 2021-05-07 19:47
marcanoff to sleep#asahi · 2021-05-07 19:46
marcan(after bputil as documented)#asahi · 2021-05-07 19:46
marcanworks perfectly fine#asahi · 2021-05-07 19:46
marcanjust tested sudo nvram boot-args=-v on a fully up to date macos#asahi · 2021-05-07 19:28
marcan(our wiki has `bputil -nkcas` in the guide too)#asahi · 2021-05-07 19:19
marcan(I'm still on a beta I think, fwiw)#asahi · 2021-05-07 19:13
marcan11.2 is when the useful kmutil was introduced, so that doesn't make a whole lot of sense, unless I'm still on a beta and they changed it for release.#asahi · 2021-05-07 19:04
marcanwhen is "recently"?#asahi · 2021-05-07 19:04
marcanthe nvram variable definitely works for me, I just confirmed changing it changes the value of tba.video.display depending on whether -v is present or not#asahi · 2021-05-07 18:52
marcanthere's no way for me to guess that you're editing BootArgs directly instead of changing the nvram variable#asahi · 2021-05-07 18:50
marcanbecause everyone else has been using nvram as documented in every mac guide and therefore hasn't run into this#asahi · 2021-05-07 18:49
marcanso *please*, if you're going to write code or pick random files out of your filesystem or anything else that isn't something documented, tell us *what* you're doing so we can figure out what the problem is#asahi · 2021-05-07 18:49
marcanI just pushed that to chainload.py.#asahi · 2021-05-07 18:49
marcanturns out: "-v" is parsed by iBoot. you want tba.video.display = 0 to get that effect.#asahi · 2021-05-07 18:48
marcannow you're changing boot-args in code instead of using nvram like our wiki mentions, and like every article on how macs boot explains#asahi · 2021-05-07 18:48
marcanfirst time it was using some random kernel instead of the one I told you / in our docs#asahi · 2021-05-07 18:47
marcansee, this is the second time now you've done something weird instead of following instructions, didn't tell anyone, and left us to scratch our heads because nobody has the same problem you do#asahi · 2021-05-07 18:46
marcanpipcet[m]: how are you changing boot-args?#asahi · 2021-05-07 17:41
marcanpipcet[m]: did you get -v to work?#asahi · 2021-05-07 17:23
marcanthe HV isn't much different in that it still lets OSX control all the hardware except USB and not much else#asahi · 2021-05-07 17:22
marcanthis was all designed to work like this *because* of the hypervisor#asahi · 2021-05-07 17:22
marcanit's not actually that much different from a hypervisor, except you're limited to passive RAM snooping, you can't take control of execution#asahi · 2021-05-07 17:22
marcanit's not surprising it works; not that much is shared between cores and the USB code deliberately has ~zero dependencies on other hardware, particularly interrupts#asahi · 2021-05-07 13:10
marcanbut they've never done the android thing of a secure world for crypto/etc#asahi · 2021-05-07 13:10
marcanon older chips#asahi · 2021-05-07 13:10
marcanI think they used to use EL3 for some kernel security stuff but stopped doing that#asahi · 2021-05-07 13:09
marcanmarshmallow: fwiw Apple have never used the secure world like that I think?#asahi · 2021-05-07 00:15
marcanand that obviously works#asahi · 2021-05-07 00:15
marcanpipcet[m]: that's interesting, but if RVBAR required more alignment that'd cause m1n1 to have the same problem bringing up SMP itself#asahi · 2021-05-06 16:19
marcan(that is not to say the mach-o loader code isn't buggy in some way, but I'd expect things to break worse if it were; feel free to dig deeper though)#asahi · 2021-05-06 16:18
marcanwhich is required for RVBAR on CPU0, which is locked by iBoot2 (I'm not sure if this actually matters on M1 or not; I think it did for earlier designs without PC-preserving wfi but it may still matter for some kind of deeper sleep modes)#asahi · 2021-05-06 16:17
marcanthat means macos ends up exactly where it would've ended up if loaded by iBoot2#asahi · 2021-05-06 16:17
marcanchainload.py loads in-place