On 10.01.20 12:45, Janosch Frank wrote: [...] > +static void kvm_arch_vcpu_ioctl_clear_reset(struct kvm_vcpu *vcpu) > +{ > + struct kvm_sync_regs *regs = &vcpu->run->s.regs; > + > + /* Clear reset is a superset of the initial reset */ > + kvm_arch_vcpu_ioctl_normal_reset(vcpu); > + > + memset(®s->gprs, 0, sizeof(regs->gprs)); > + /* Will be picked up because of save_fpu_regs() in the initial reset */ > + memset(¤t->thread.fpu.vxrs, 0, sizeof(current->thread.fpu.vxrs)); So I checked with a userspace that sets f8(call-saved) to 0x123 during this ioctl. f8 is 0 afterwards. The guest f8 is also correct, just because QEMU does clear out its copy of the fprs and syncs that back via synv regs. So this must be /* we have not synced the registers from kvm_run to the thread structure. We must clear out kvm_run*/ memset(®s->vrs, 0, sizeof(regs->vrs)); > + memset(®s->acrs, 0, sizeof(regs->acrs)); > + > + regs->etoken = 0; > + regs->etoken_extension = 0; > + > + memset(®s->gscb, 0, sizeof(regs->gscb)); [....]