#asahi-dev · 2021-01-29 18:07
modwizcodeBootargs (along with device tree) are put at 0#asahi-dev · 2021-01-29 18:06
modwizcodeI was working with an old commit for a long time.#asahi-dev · 2021-01-29 18:06
modwizcodeAlso maybe that#asahi-dev · 2021-01-29 18:06
modwizcodeYeah I wasn't emulating boot args at the time (this is before I made a new machine type when I was working with a modified exynos4210 setup)#asahi-dev · 2021-01-29 18:06
modwizcodeFor some reason the first few times I tried that it failed to boot but there could be a lot of other things wrong#asahi-dev · 2021-01-29 17:59
modwizcodeThe machine type I added is called apple-m1 at the moment and you just pass m1n1.elf to -kernel.#asahi-dev · 2021-01-29 17:58
modwizcodehttps://github.com/modwizcode/qemu/tree/add_M1_test#asahi-dev · 2021-01-29 17:58
modwizcodeIt's ugly but I was just about to link it#asahi-dev · 2021-01-29 17:48
modwizcodeI got it booting m1n1 unmodified now. Well mostly unmodified. The device tree code in m1n1 needs to actually check it's bounds properly :p#asahi-dev · 2021-01-29 17:47
modwizcodeYeah#asahi-dev · 2021-01-29 17:27
modwizcodeAfaik there's no apple stuff at all#asahi-dev · 2021-01-29 17:27
modwizcodeno#asahi-dev · 2021-01-29 17:12
modwizcodeThere's no A14#asahi-dev · 2021-01-29 16:38
modwizcodeInteresting so ther is a way (used in at least noe place) where extra CP registers are defined on the core. Still not sure if it would make more sense to just add a new core type for the M1. Probably should ask someone.#asahi-dev · 2021-01-29 16:27
modwizcodeIs there any meaningful difference between the performance and efficiency cores architecturally?#asahi-dev · 2021-01-29 16:27
modwizcodeI think that you define an array of CP registers which can have functionality diverted out to other code. For now I'm going to extend the existing one with apple specific definitions. I'm not sure if the qemu people will want it as a new CPU type but that's probably the best way to handle it.#asahi-dev · 2021-01-29 16:25
modwizcodeI should find that code#asahi-dev · 2021-01-29 16:24
modwizcodewait no I'm just wrong about that I think, but I would have to handle it as another cpu core type instead of just giving it an SoC wrapper.#asahi-dev · 2021-01-29 16:23
modwizcodeWhat I'm most worried about is that Apple reuses some unused aarch64 registers that I think might be hard to support. I don't think qemu lets me hook the registers easily in a like SoC/core specific way due to it's current architecture.#asahi-dev · 2021-01-29 16:14
modwizcodeYou could probably get it working easier by using the (not yet commited) patch series for supporting HVF (apple's hypervisor framework)#asahi-dev · 2021-01-29 16:14
modwizcodeYeah I haven't seen anyone try to run it on the ARM qemu#asahi-dev · 2021-01-29 16:14
modwizcodeLike making a new machine definition is not straightforward#asahi-dev · 2021-01-29 16:14
modwizcodeI just don't have a lot of experience here nor do I know anyone with it#asahi-dev · 2021-01-29 16:13
modwizcodeand there's obvious usecases for testing stuff#asahi-dev · 2021-01-29 16:13
modwizcodeI mean virtualbox and things support emulation of macOS#asahi-dev · 2021-01-29 16:13
modwizcodeYeah I think that'd be useful too#asahi-dev · 2021-01-29 16:13
modwizcodeLike qemu has this desire to work away from source code hardware descriptions to a file based description but there's no code for that.#asahi-dev · 2021-01-29 16:12
modwizcodeI'd like to bring up getting the code into an upstream friendly state but I don't really know where to start/who to get in touch with#asahi-dev · 2021-01-29 16:12
modwizcodebut upstream would hate everything I've written so far I think XD#asahi-dev · 2021-01-29 16:12
modwizcodeUpstream could not like it#asahi-dev · 2021-01-29 16:11
modwizcodedavidrysk[m]: or were you suggesting essentially that, adding support for the mach-o loading in qemu#asahi-dev · 2021-01-29 16:10
modwizcodeI was going to try to add simple macho support just enough to load m1n1#asahi-dev · 2021-01-29 16:09
modwizcodeA stubbed iBoot wouldn't be a terrible idea but that's more work for people to load#asahi-dev · 2021-01-29 16:09
modwizcodeI think they just run openfirmware lol#asahi-dev · 2021-01-29 15:40
modwizcodeAfter this though I need to start stubbing in peripherals properly. Ideally the whole machine config could be created simply from a converted device tree, although that seems to not be a thing in qemu yet and it's far too useful a feature for an idiot like me to contribute.#asahi-dev · 2021-01-29 15:39
modwizcodeIt also can't properly load at 0 which is the real problem since my device board for m1 work defines a big heap of ram at 0 original. Because parts of the code assume address 0 = NULL and break#asahi-dev · 2021-01-29 15:38
modwizcodeBut it shouldn't have to, this is an annoying issue with qemu for other work too and it should be fixed#asahi-dev · 2021-01-29 15:38
modwizcodeYou're right though that can work.#asahi-dev · 2021-01-29 15:37
modwizcodeThen it doesn't detect the entry point automatically and the segment layout isn't flat iirc#asahi-dev · 2021-01-29 15:36
modwizcodeThere's a sort of way to do it right that involves duplicating a lot of code. You can give it a "translation function but that runs a relocater too which isn't exactly desired.#asahi-dev · 2021-01-29 15:36
modwizcodeI'm pretty close on getting a QEMU profile that can boot m1n1 properly. Unfortunately it will require a horrible hack since qemu always loads elfs directly at their physical address locations, which m1n1 has set to 0. So either people need to patch the linker script or they need a horrible hacked version of qemu.#asahi-dev · 2021-01-29 15:32
modwizcodelol rip not having malloc#asahi-dev · 2021-01-27 17:26
modwizcodeWow that's actually fairly surprising#asahi-dev · 2021-01-25 19:52
modwizcodeI'm still trying to find that, but of course that's not really a m1n1/asahi problem it's some kind of qemu problem. My solution was to hack in a like 16KB buffer, as long as your buffer is big enough to fit a whole write transaction, and the vcpu is scheduled in time to read it before the next one is pushed, the problem disappears :p#asahi-dev · 2021-01-25 19:49
modwizcodeso whatever the monitor does kicks it when you type.#asahi-dev · 2021-01-25 19:49
modwizcodeIf you run single threaded codegen or weirdly enable the monitor on stdio and then type random crap in on multithreaded it works#asahi-dev · 2021-01-25 19:49
modwizcodeBut I think I mostly tracked down the actual issue to a qemu thing, basically multicore code-gen seems to have some issue where io never gets polled again. So it ends up polling only in these like once per 0.5s chunks, which with a buffer of 1 (without fifo) is unbelievably slow.#asahi-dev · 2021-01-25 19:48
modwizcode*off#asahi-dev · 2021-01-25 19:48
modwizcodeI'd be very interested in the io speed with it out#asahi-dev · 2021-01-25 19:47
modwizcodemarcan: Yeah that's what I kinda figured