#
✕ nick:marcan
#asahi · 2021-02-06 07:54
marcanthe initramfs is optional of course
#asahi · 2021-02-06 07:53
marcanlet me know how it works :)
#asahi · 2021-02-06 07:53
marcanthere's a mach-o trick (and iBoot loading quirk) used to make this work without touching the mach-o headers, just with a simple cat
#asahi · 2021-02-06 07:53
marcanthe kernel & initramfs should be compressed (because otherwise m1n1 can't tell where they end)
#asahi · 2021-02-06 07:52
marcanbasically just `cat m1n1.macho kernel dtb initramfs > m1n1-with-stuff.macho`
#asahi · 2021-02-06 07:52
marcanusage here: https://github.com/AsahiLinux/docs/wiki/Developer-Quickstart#direct-payload-booting
#asahi · 2021-02-06 07:52
marcanjust pushed m1n1 support for built-in payloads, for those without serial
#asahi · 2021-02-05 17:20
marcanI'll test your patch tomorrow
#asahi · 2021-02-05 17:20
marcananyway, sleep :)
#asahi · 2021-02-05 17:19
marcanbut yeah
#asahi · 2021-02-05 17:19
marcanin this case we wouldn't be able to do that case without saving the timers for this reason
#asahi · 2021-02-05 17:17
marcaneven on VM->HV-EL0 userspace context switch?
#asahi · 2021-02-05 17:16
marcanI guess you need to do that to context switch VMs anyway...
#asahi · 2021-02-05 17:16
marcanwhich would mean when context switching to TGE=1 we need to take over the timers and save state (or at least mask them)
#asahi · 2021-02-05 17:16
marcanthe timers confuse me now though, because... okay, so we have HYP and non-HYP timers, non-HYP do this automasking thing... but not with TGE=1... so now with TGE=1 the hypervisor "owns" all timers and has to deal with them?
#asahi · 2021-02-05 17:14
marcanso how do you know which EL0 is which
#asahi · 2021-02-05 17:14
marcanthe "problem" with ARM virtualization is that EL0 is used by *both* the level 2 HV *and* the guest
#asahi · 2021-02-05 17:13
marcanTGE is so that guests can go EL0-EL1
#asahi · 2021-02-05 17:10
marcan(except for places where I've already seem the CPU speculate stuff into madness, and had to add them)
#asahi · 2021-02-05 17:10
marcanthis is why m1n1 is fun, it's so dumb and simple you get to experience the wonders if "no barriers, anywhere" :)
#asahi · 2021-02-05 17:09
marcanmaz: that would make sense
#asahi · 2021-02-05 17:09
marcanmodwizcode: good question...
#asahi · 2021-02-05 17:08
marcanit's just interesting that isb kicked the fiq into working again
#asahi · 2021-02-05 17:08
marcananyway, I'll look for that mask register
#asahi · 2021-02-05 17:08
marcanit's just that the way that mask "stuck" when I flipped TGE seemed to be a quirk of the instruction pipeline
#asahi · 2021-02-05 17:07
marcanoh in guest mode it masks itself
#asahi · 2021-02-05 17:07
marcanthis is really sounding like those timers are wired deep into the instruction pipeline...
#asahi · 2021-02-05 17:07
marcanneeds the isb though, running a bunch of code does nothing. so isb "kicks" something into re-evaluating that FIQ state in light of the new TGE setting
#asahi · 2021-02-05 17:06
marcanturns out it sticks by accident. an isb makes it fire a FIQ again (and FIQ storm if not handled, as you would expect from TGE=1 mode)
#asahi · 2021-02-05 17:05
marcanmaz: you know how I was talking earlier about the timers? and how guest timer FIQs get masked somewhere and only delivered once, and that mask sticks when you turn on TGE?
#asahi · 2021-02-05 17:05
marcanoh this is a fun quirk
#asahi · 2021-02-05 16:46
marcanactually let me try something silly...
#asahi · 2021-02-05 16:46
marcanI think AIC really is just a global block
#asahi · 2021-02-05 16:44
marcanwell, there is one per CPU, and one special address that maps to your CPU
#asahi · 2021-02-05 16:44
marcanopticron: yeah, there is a single "reason" register that returns the lowest firing irq number when read, and simultaneously masks it
#asahi · 2021-02-05 16:43
marcanI suspect they may be abusing the top address lines for this, though I'm not sure
#asahi · 2021-02-05 16:43
marcanI wonder how that's done in hardware
#asahi · 2021-02-05 16:43
marcanmodwizcode: this is why AIC knows the current CPU and displays it its registers
#asahi · 2021-02-05 14:20
marcanbbl, dinner :)
#asahi · 2021-02-05 14:19
marcanit's so beautifully simple
#asahi · 2021-02-05 14:19
marcanI really like it
#asahi · 2021-02-05 14:19
marcanyeah
#asahi · 2021-02-05 14:19
marcanand I guess this is the first arm64 platform that can't do that in hardware
#asahi · 2021-02-05 14:19
marcanlinux sends 7 different messages via IPIs
#asahi · 2021-02-05 14:18
marcan:)
#asahi · 2021-02-05 14:18
marcanyou need at least 8 targets
#asahi · 2021-02-05 14:18
marcanI mean how would two true IPIs work
#asahi · 2021-02-05 14:18
marcanit's two *per-cpu* IPIs
#asahi · 2021-02-05 14:17
marcanbut clearly "self" is intended as self
#asahi · 2021-02-05 14:17
marcanwhich is why they are really just two IPIs

plus ›