KVM: x86: Modify struct kvm_nested_state to have explicit fields for data
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. Signed-off-by:Liran Alon <liran.alon@oracle.com> [Remove SVM stubs, add KVM_STATE_NESTED_VMX_VMCS12_SIZE. - Paolo] Reviewed-by:
Liran Alon <liran.alon@oracle.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Showing
- Documentation/virtual/kvm/api.txt 31 additions, 15 deletionsDocumentation/virtual/kvm/api.txt
- arch/x86/include/uapi/asm/kvm.h 22 additions, 11 deletionsarch/x86/include/uapi/asm/kvm.h
- arch/x86/kvm/vmx/nested.c 44 additions, 35 deletionsarch/x86/kvm/vmx/nested.c
- arch/x86/kvm/vmx/vmcs12.h 3 additions, 2 deletionsarch/x86/kvm/vmx/vmcs12.h
- tools/arch/x86/include/uapi/asm/kvm.h 1 addition, 1 deletiontools/arch/x86/include/uapi/asm/kvm.h
- tools/testing/selftests/kvm/x86_64/vmx_set_nested_state_test.c 21 additions, 21 deletions.../testing/selftests/kvm/x86_64/vmx_set_nested_state_test.c
Loading
Please register or sign in to comment