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.
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?
re your original question, when you say ‘switch cores’, what exactly do you mean?
It is unlikely that a higher level concept like win32 has anything to do with this
an access violation exception happens when the CPU is instructed to operate on a memory location in a way not consistent with the page protection for that memory. In UM, that could happen without direct bugs in your code, but I don’t think that there is a reasonable way for that to happen in KM without a direct bug in your code
As mentioned, the real question is waiting for win32 to start.
I was thinking thst was why I couldn't switch cores. Turns out thats because an unaligned RSP.
But issue still persists. I can switch cores, good. I need to wait until win32 initializes, still.