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

Unified · Split

2 files
  1. Documentation/virtual/kvm/api.txt +1 −1
  2. include/uapi/linux/kvm.h +5 −1
Documentation/virtual/kvm/api.txt+1−1
@@ -3905,7 +3905,7 @@ in userspace. · 3904 unmodified lines
39053905 __u64 kvm_dirty_regs;
39063906 union {
39073907 struct kvm_sync_regs regs;
3908− char padding[1024];
3908+ char padding[SYNC_REGS_SIZE_BYTES];
39093909 } s;
39103910
39113911 If KVM_CAP_SYNC_REGS is defined, these fields allow userspace to access
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t