vm/x86: support extended fpu state transfer

Extend Genode's vCPU FPU state and adjust all users to copy
at most FPU data they actually support.

Issue #5314
This commit is contained in:
Alexander Boettcher
2024-09-04 15:41:29 +02:00
committed by Norman Feske
parent 5993fa9c7f
commit ff506b0375
9 changed files with 33 additions and 20 deletions

View File

@ -400,6 +400,7 @@ struct Foc_vcpu : Thread, Noncopyable
if (state.fpu.charged()) {
state.fpu.charge([&] (Vcpu_state::Fpu::State &fpu) {
asm volatile ("fxrstor %0" : : "m" (fpu) : "memory");
return 512;
});
} else
asm volatile ("fxrstor %0" : : "m" (_fpu_vcpu) : "memory");
@ -412,6 +413,7 @@ struct Foc_vcpu : Thread, Noncopyable
state.fpu.charge([&] (Vcpu_state::Fpu::State &fpu) {
asm volatile ("fxsave %0" : "=m" (fpu) :: "memory");
asm volatile ("fxsave %0" : "=m" (_fpu_vcpu) :: "memory");
return 512;
});
asm volatile ("fxrstor %0" : : "m" (_fpu_ep) : "memory");