This is outside the hv_exc_entry/hv_exc_exit bracketing now, so modify
the register directly. We only stop the PMCs when we go into the
slowpath.
Signed-off-by: Hector Martin <marcan@marcan.st>
The macOS 13.3 DCP firmware extended swap_set_layer_cmd in an
incompatible way. Let dcp_ib_swap_set_layer() send the matching struct
based on the firmware version.
Signed-off-by: Janne Grunau <j@jannau.net>
The macOS 13.3 DCP firmware uses TYPE_REPLY instead of TYPE_NOTIFY for
the disp0-service interface init message.
Signed-off-by: Janne Grunau <j@jannau.net>
This add supports for concatenated (compressed) cpio archives and relies
on the kernel to decompress the initramfs.
Signed-off-by: Janne Grunau <j@jannau.net>
This definitely isn't going to work yet, but it's better than ending up
in the secondary loop if it ever works.
Signed-off-by: Hector Martin <marcan@marcan.st>
This lets us eliminate HV timer ticks on secondary CPUs, which should
significantly improve the scalability of this whole thing.
(We leave them at 1Hz just in case, since that much won't hurt)
Signed-off-by: Hector Martin <marcan@marcan.st>
This will be useful for CI and similar use cases, to distinguish
different machines. Also fix spurious NUL-termination of the descriptor
strings while I'm here.
Signed-off-by: Hector Martin <marcan@marcan.st>
Put the WFI mode back how macOS expects it on boot, since it won't set
it itself. Then, also trap attempts by macOS to disable FIQs. This
happens in the sleep/core off path. It is not sufficient to make all
that work properly, but it's a start.
Signed-off-by: Hector Martin <marcan@marcan.st>
I already screwed something up in cpufreq, and it makes it difficult to
understand what happened if it happens in stage1 before the proxy runs,
and difficult to undo in stage2.
Let's move all this stuff to kboot, since it isn't necessary until then
(and this will also avoid doing unnecessary init for macOS under the
HV). If we need it in proxy scripts, we can add proxy commands for this
later.
Signed-off-by: Hector Martin <marcan@marcan.st>
I don't think that field ever did anything and Apple don't set it on
newer macOS/SoCs. Also expand DESIRED1 to T602x width.
Signed-off-by: Hector Martin <marcan@marcan.st>
Nobody can figure out where this code came from and it's broken for
devices where OSLog is actually implemented these days... let's drop it
and see if anything complains.
Signed-off-by: Hector Martin <marcan@marcan.st>
We're not using it in the end because we fixed this in Linux, but I went
through the trouble of writing the function so we might as well leave it
lying around.
Signed-off-by: Hector Martin <marcan@marcan.st>