diff options
author | Ken Hofsass <hofsass@google.com> | 2018-01-31 16:03:35 -0800 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-03-06 18:40:43 +0100 |
commit | 7b7e39522a61f402d41dd9a67f3fa2133ef9d4e8 (patch) | |
tree | 2416acd62546483498495af33f6561ed00986b87 /include | |
parent | faeb7833eee0d6afe0ecb6bdfa6042556c2c352e (diff) | |
download | linux-7b7e39522a61f402d41dd9a67f3fa2133ef9d4e8.tar.gz linux-7b7e39522a61f402d41dd9a67f3fa2133ef9d4e8.tar.bz2 linux-7b7e39522a61f402d41dd9a67f3fa2133ef9d4e8.zip |
KVM: x86: add SYNC_REGS_SIZE_BYTES #define.
Replace hardcoded padding size value for struct kvm_sync_regs
with #define SYNC_REGS_SIZE_BYTES.
Also update the value specified in api.txt from outdated hardcoded
value to SYNC_REGS_SIZE_BYTES.
Signed-off-by: Ken Hofsass <hofsass@google.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/kvm.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 2d2d926113ba..088c2c92db55 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -396,6 +396,10 @@ struct kvm_run { char padding[256]; }; + /* 2048 is the size of the char array used to bound/pad the size + * of the union that holds sync regs. + */ + #define SYNC_REGS_SIZE_BYTES 2048 /* * shared registers between kvm and userspace. * kvm_valid_regs specifies the register classes set by the host @@ -407,7 +411,7 @@ struct kvm_run { __u64 kvm_dirty_regs; union { struct kvm_sync_regs regs; - char padding[2048]; + char padding[SYNC_REGS_SIZE_BYTES]; } s; }; |