diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-08-05 18:36:09 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-08-25 10:28:25 -0400 |
commit | 1327138e294ffda120a50c8f31d792addb196c79 (patch) | |
tree | 64ed2619cae4f2768b43f541ca5b73999d241646 /include/linux/kvm.h | |
parent | cd5998ebfbc9e6cb44408efa217c15d7eea13675 (diff) |
KVM: fix userspace ABI breakage
The following part of commit 9ef621d3be56e1188300476a8102ff54f7b6793f
(KVM: Support mixed endian machines) changed on the size of a struct
that is exported to userspace:
include/linux/kvm.h:
@@ -318,14 +318,14 @@ struct kvm_trace_rec {
__u32 vcpu_id;
union {
struct {
- __u32 cycle_lo, cycle_hi;
+ __u64 cycle_u64;
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
} cycle;
struct {
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
} nocycle;
} u;
-};
+} __attribute__((packed));
Packing a struct was the correct idea, but it packed the wrong struct.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r-- | include/linux/kvm.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 69511f74f912..70a30651cd12 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -320,12 +320,12 @@ struct kvm_trace_rec { | |||
320 | struct { | 320 | struct { |
321 | __u64 cycle_u64; | 321 | __u64 cycle_u64; |
322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
323 | } cycle; | 323 | } __attribute__((packed)) cycle; |
324 | struct { | 324 | struct { |
325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
326 | } nocycle; | 326 | } nocycle; |
327 | } u; | 327 | } u; |
328 | } __attribute__((packed)); | 328 | }; |
329 | 329 | ||
330 | #define KVMIO 0xAE | 330 | #define KVMIO 0xAE |
331 | 331 | ||