kernel/x86_64: use standard xstate length
for sse/avx when found invalid Change-Id: I1c93e5dd8de80bf155eabb55c77119349a7186ab Reviewed-on: https://review.haiku-os.org/c/haiku/+/3372 Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
parent
5c752d3160
commit
18112d73b2
@ -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 (
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user