@@ -129,6 +129,7 @@
*/
#include <linux/device.h>
#include <linux/miscdevice.h>
+#include <asm/fpu/api.h>
#define MSR_ARRAY_BIST 0x00000105
#define MSR_COPY_SCAN_HASHES 0x000002c2
@@ -191,6 +191,10 @@ static int doscan(void *data)
/* Only the first logical CPU on a core reports result */
first = cpumask_first(cpu_smt_mask(cpu));
+ /* Prepare FPU state before entering the rendezvous loop */
+ kernel_fpu_begin();
+ fpu_reset_fpregs();
+
wait_for_sibling_cpu(&scan_cpus_in, NSEC_PER_SEC);
/*
@@ -202,6 +206,9 @@ static int doscan(void *data)
* are processed in a single pass) before it retires.
*/
wrmsrl(MSR_ACTIVATE_SCAN, params->activate->data);
+
+ kernel_fpu_end();
+
rdmsrl(MSR_SCAN_STATUS, status.data);
trace_ifs_status(ifsd->cur_batch, start, stop, status.data);