History

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.

Ken Hofsass committed 8 years ago

Commit 7b7e3951 parent faeb7832 files · +6 −2Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/kvm.h+5−1
@@ -396,6 +396,10 @@ struct kvm_run { · 395 unmodified lines
396396 char padding[256];
397397 };
398398
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
399403 /*
400404 * shared registers between kvm and userspace.
401405 * kvm_valid_regs specifies the register classes set by the host
@@ -407,7 +411,7 @@ struct kvm_run { · 5 unmodified lines
407411 __u64 kvm_dirty_regs;
408412 union {
409413 struct kvm_sync_regs regs;
410− char padding[2048];
414+ char padding[SYNC_REGS_SIZE_BYTES];
411415 } s;
412416 };
413417