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.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -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 host | 405 | * 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 | ||