Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Ken Hofsass and committed by
Radim Krčmář
7b7e3952 faeb7833

+6 -2
+1 -1
Documentation/virtual/kvm/api.txt
··· 3905 3905 __u64 kvm_dirty_regs; 3906 3906 union { 3907 3907 struct kvm_sync_regs regs; 3908 - char padding[1024]; 3908 + char padding[SYNC_REGS_SIZE_BYTES]; 3909 3909 } s; 3910 3910 3911 3911 If KVM_CAP_SYNC_REGS is defined, these fields allow userspace to access
+5 -1
include/uapi/linux/kvm.h
··· 396 396 char padding[256]; 397 397 }; 398 398 399 + /* 2048 is the size of the char array used to bound/pad the size 400 + * of the union that holds sync regs. 401 + */ 402 + #define SYNC_REGS_SIZE_BYTES 2048 399 403 /* 400 404 * shared registers between kvm and userspace. 401 405 * kvm_valid_regs specifies the register classes set by the host ··· 411 407 __u64 kvm_dirty_regs; 412 408 union { 413 409 struct kvm_sync_regs regs; 414 - char padding[2048]; 410 + char padding[SYNC_REGS_SIZE_BYTES]; 415 411 } s; 416 412 }; 417 413