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
3905 __u64 kvm_dirty_regs;3905 __u64 kvm_dirty_regs;
3906 union {3906 union {
3907 struct kvm_sync_regs regs;3907 struct kvm_sync_regs regs;
3908 char padding[1024];3908 char padding[SYNC_REGS_SIZE_BYTES];
3909 } s;3909 } s;
3910 3910
3911If KVM_CAP_SYNC_REGS is defined, these fields allow userspace to access3911If 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
396 char padding[256];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 * shared registers between kvm and userspace.404 * shared registers between kvm and userspace.
401 * kvm_valid_regs specifies the register classes set by the host405 * kvm_valid_regs specifies the register classes set by the host
@@ -407,7 +411,7 @@ struct kvm_run { · 5 unmodified lines
407 __u64 kvm_dirty_regs;411 __u64 kvm_dirty_regs;
408 union {412 union {
409 struct kvm_sync_regs regs;413 struct kvm_sync_regs regs;
410 char padding[2048];414 char padding[SYNC_REGS_SIZE_BYTES];
411 } s;415 } s;
412};416};
413 417

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