Use the KVM_SET_FPU ioctl() to set up guest initial FPU state.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
struct kvm_regs regs;
struct kvm_sregs sregs;
+ struct kvm_fpu fpu;
struct interrupt_table interrupt_table;
};
if (ioctl(self->vcpu_fd, KVM_SET_REGS, &self->regs) < 0)
die_perror("KVM_SET_REGS failed");
+ self->fpu = (struct kvm_fpu) {
+ .fcw = 0x37f,
+ .mxcsr = 0x1f80,
+ };
+
+ if (ioctl(self->vcpu_fd, KVM_SET_FPU, &self->fpu) < 0)
+ die_perror("KVM_SET_FPU failed");
+
}
void kvm__run(struct kvm *self)