Radim, On Fri, Feb 2, 2018 at 1:04 PM, Radim Krčmář <rkrcmar@xxxxxxxxxx> wrote: > Right, it's unlikely that we'll be doing more checks on kvm_valid_regs, > so I've moved it here and replaced the block with > > if (vcpu->run->kvm_valid_regs & ~KVM_SYNC_X86_VALID_FIELDS) { > r = -EINVAL; > goto out; > } > > You can see the result in kvm/queue. Thanks for cleaning that up & queuing the commits! > Btw. the userspace doesn't know what the next userspace exit is going to > be, so it the purpose of kvm_valid_regs to avoid needless writes of > registers on old userspaces? If you mean userspace agents that don't have code to use SYNC_REGS, then yes. Or new userspace agents that have not enabled features that use S_R or features that only need a subset of available register sets. Originally I had FPU and debug_regs as well and expected that those would not be as broadly used and wanted to enable turning them on/off. Also, I wanted to keep the flexibility because I have related patches extending and building on SYNC_REGS that I will be sending for review in the near future. thanks again, Ken