In order to prevent leaking data in the padding field. Also remove the
memset done to the fpu_regs in case of no FPU context present, since it's
already taken care by the memset of the whole CPU context structure. The
same applies to setting ctxt.flags to 0 in case there's no FPU context.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reported-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
if ( v->pause_flags & VPF_down )
continue;
+ memset(&ctxt, 0, sizeof(ctxt));
+
/* Architecture-specific vmcs/vmcb bits */
hvm_funcs.save_cpu_ctxt(v, &ctxt);
memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs));
ctxt.flags = XEN_X86_FPU_INITIALISED;
}
- else
- {
- memset(ctxt.fpu_regs, 0, sizeof(ctxt.fpu_regs));
- ctxt.flags = 0;
- }
ctxt.rax = v->arch.user_regs.eax;
ctxt.rbx = v->arch.user_regs.ebx;