Wait until boot ends

I'm trying to switch cores on my boot-time driver. But it doesn't end well.

Access violation - code c0000005 (!!! second chance !!!)
nt!KiSwapContext+0xf:
fffff800`768a779f 0f29742430      movaps  xmmword ptr [rsp+30h],xmm6

Since its an access violation, not even a bugcheck, something is very wrong.
I tried KeSetSystemGroupAffinityThread and KeSetSystemAffinityThread, both resulted in the same outcome. (since KeSetSystemAffinityThread internally calls the former).

I thought I can wait for Win32 to initialize. There was a callback for that, I read somewhere in MSDN. But could not find it. Since this part of the code is not "critical" and can be delayed, I just want to learn how long to delay it for. Or until at least, the boot ends.

Access violation implies that you have run off the end of the stack. Are you calling KiSwapContext directly?

No. Just calling the functions I mentioned.

Seems like the call wasn't the issue? Anything that touches SIMD registers get an access violation. Even Rust's own library. At least, when its movaps and not movups. So something about alignment? But then, what?
image

I messed up the stack so now its unaligned. Probably.

yes. that was why