On 16/06/19 14:03, Liran Alon wrote: > Improve the KVM_{GET,SET}_NESTED_STATE structs by detailing the format > of VMX nested state data in a struct. > > In order to avoid changing the ioctl values of > KVM_{GET,SET}_NESTED_STATE, there is a need to preserve > sizeof(struct kvm_nested_state). This is done by defining the data > struct as "data.vmx[0]". It was the most elegant way I found to > preserve struct size while still keeping struct readable and easy to > maintain. It does have a misfortunate side-effect that now it has to be > accessed as "data.vmx[0]" rather than just "data.vmx". > > Because we are already modifying these structs, I also modified the > following: > * Define the "format" field values as macros. > * Rename vmcs_pa to vmcs12_pa for better readability. > * Add stub structs for AMD SVM. I'm not sure it makes sense to add stub structs for SVM yet. But as noted in the QEMU patch review we should definitely add VMCS12_SIZE (or better, a synonym of it that follows the KVM_NESTED_STATE_VMX_* naming). I have just sent a v2 and I plan to queue it pretty soon. Paolo