<Bitweasil>
So, question. If I want to boot a Pi3 (ARMv8 core) in AArch32/MON mode, is there a way to do that? I think I'm getting dumped out in hypervisor mode, but it's... unclear, stuff broadly isn't working unless I use the old kernel option and load at 0x0, coming in at SVC.
<clever>
Bitweasil: with the open or closed firmware?
<Bitweasil>
Stock Pi foundation stuff.
<clever>
Bitweasil: arm_64bit=0 will force the arm core to start in arm32 mode
<Bitweasil>
My conclusions so far: (1) The armstubs still exist, and they're part of the firmware blob now, instead of being separate files. (2) they pass execution into the kernel in, depending on config parameters, either in hyp mode or svc mode.
<clever>
keep in mind, the kernel load addr differs, so if your kernel is not 100% PIC, things mal malfunction in fun ways
<Bitweasil>
And (3) I think I can override the armstub to just pass me on to my kernel in mon mode, which is what I want.
<clever>
i believe they pass control off in HYP mode now
<Bitweasil>
That's what seems to be the case.
<Bitweasil>
Unless you set some old kernel parameters, at which point you show up in SVC mode.
<clever>
if you set kernel_old=1, then your kernel gets loaded to 0 and replace the armstubs entirely
<Bitweasil>
Yes. I agree. And if I build a kernel for that, it works, I just end up in SVC mode on the ARMv8 chips.
<Bitweasil>
(vs MON mode on the ARMv7 chips)
<Bitweasil>
Anyway, yes, I know, I'm nuts, doing AArch32 stuff on the ARMv8 chips, but we need to ground truth a few instructions. :/
<clever>
i was booting 32bit linux on the pi3 for the longest time, because my 64bit bootloader lacked kexec
<Bitweasil>
Linux. Woah. Nosebleed. :p
<clever>
so, do you need to replace the stubs and use your own kernel, or can you work stubless?
<Bitweasil>
I'm pretty sure I can work stubless, if it'll call me in AArch32 Monitor mode.
<clever>
the "stubless" way, actually did have a stub, originally, you had to manually prepend the stub onto your linux build, when making kernel.img
<Bitweasil>
If I load myself as armstub=kernel7.img (or whatever), I should get execution at 0x0?
<clever>
yeah
<clever>
and kernel_old=1 should do the same thing
<Bitweasil>
kernel_old=1 was loading me in SVC mode.
<clever>
it should load your kernel= to 0 and skip the stub entirely
<Bitweasil>
Right, but it was entering in the wrong mode.
<clever>
thats weird
<clever>
because it shouldnt be able to change modes
<clever>
without a stub, you control the first opcode out of reset
<Bitweasil>
I know. :/
<Bitweasil>
Anyway, that matches what I'm finding, just... weirdness. I'll keep troubleshooting. Thanks!
<clever>
Bitweasil: behind the scenes, there is a magic control bit in the arm core
<Bitweasil>
Is there a way to say "Only load the armstub, not the kernel"?