x86, HYP: Cleanup VCPU FPU state

Otherwise ksActiveFPUState may point to freed memory after a vcpu
with active FPU state gets deleted.

Signed-off-by: Indan Zupancic <indan@nul.nu>
This commit is contained in:
Indan Zupancic 2024-09-09 16:54:30 +01:00 committed by Gerwin Klein
parent 296638287a
commit e00f2e2148

View file

@ -122,6 +122,9 @@ void clearCurrentVCPU(void)
vmclear(vcpu);
vcpu->launched = false;
ARCH_NODE_STATE(x86KSCurrentVCPU) = NULL;
if (&vcpu->fpuState == NODE_STATE(ksActiveFPUState)) {
switchLocalFpuOwner(NULL);
}
}
}