diff --git a/src/system/kernel/arch/x86/64/thread.cpp b/src/system/kernel/arch/x86/64/thread.cpp index f767ca0f16..3cf8ee6e32 100644 --- a/src/system/kernel/arch/x86/64/thread.cpp +++ b/src/system/kernel/arch/x86/64/thread.cpp @@ -144,11 +144,6 @@ arch_thread_init(kernel_args* args) // Save one global valid FPU state; it will be copied in the arch dependent // part of each new thread. if (gHasXsave || gHasXsavec) { - if (gFPUSaveLength > sizeof(sInitialState.fpu_state)) { - panic("XSAVE FPU context is larger than allowed " - "(need at least %" B_PRIu64 " bytes)", gFPUSaveLength); - return B_ERROR; - } memset(sInitialState.fpu_state, 0, gFPUSaveLength); if (gHasXsavec) { asm volatile ( diff --git a/src/system/kernel/arch/x86/arch_cpu.cpp b/src/system/kernel/arch/x86/arch_cpu.cpp index 692fd1cc46..db5eac8e39 100644 --- a/src/system/kernel/arch/x86/arch_cpu.cpp +++ b/src/system/kernel/arch/x86/arch_cpu.cpp @@ -1554,6 +1554,8 @@ arch_cpu_init_post_vm(kernel_args* args) call_all_cpus_sync(&enable_xsavemask, NULL); get_current_cpuid(&cpuid, 0xd, 0); gFPUSaveLength = cpuid.regs.ebx; + if (gFPUSaveLength > sizeof(sInitialState.fpu_state)) + gFPUSaveLength = 832; arch_altcodepatch_replace(ALTCODEPATCH_TAG_XSAVE, gHasXsavec ? &_xsavec : &_xsave, 4);